Forum Discussion

Andre_371's avatar
Andre_371
Historic F5 Account
Oct 12, 2010

iRules to differentiate WAP traffic and bypass proxy

Hi All,

 

 

I have some request from a telco to give a solution for them.

 

Their objective as following:

 

1. Internet without proxy:

 

Protocol: HTTP, destination: www.facebook.com

 

Protocol: WAP 2.0, destination: www.facebook.com

 

2. Intervet via proxy:

 

Protocol: HTTP, destination: other than www.facebook.com

 

Protocol: Wap 2.0, destination: other than www.facebook.com

 

Protocol: Wap 1.x, destination: any (including facebook)

 

Their subscriber has been configured the proxy setting automatically by OTA. But the challenge is once the subscriber browser (mobile phone) support WAP 2.0 and destination www.facebook.com they want to send the traffic directly to internet bypass their proxy server.

 

I tried to create iRules for them for the above objectives:

 

when HTTP_REQUEST {

 

if { [HTTP::host] equals "www.facebook.com" } {

 

not (switch -glob [string to lower [HTTP::header User-Agent]] {

 

"*blackberry*" -

 

"*windows ce*" -

 

"*palm*" -

 

"*sonyericsson*" -

 

"*mot-*" -

 

"*netfront*" -

 

"*nokia*" -

 

"*samsung*" -

 

"*smartphone*" -

 

"*symbian*"})} {

 

pool pool_internet

 

}

 

elseif { [HTTP::host] equals "www.facebook.com" } {[HTTP::header exists "accept"] } {switch -glob [HTTP::header "accept"] {"*wap*" -"*vnd.wap.xhtml+xml*" {

 

pool pool_internet

 

else {

 

pool pool_proxy

 

}

 

}

 

Actually i don't have any experience on creating iRules, i just tried my best to write. Please pardon me if you found any error in syntax. But I was wondering how can I detect whether this is HTTP or WAP 1.0 or WAP 2.0 Protocol or not, and how do I remove proxy setting if the traffic suppose go to internet directly bypass the proxy server. Can i just send to internet pool ? Need your help and advise guys for the iRules. thanks a lot.

 

 

 

 

  • Andre_371's avatar
    Andre_371
    Historic F5 Account
    Hi All,

     

     

    Resubmit as my previous topic is somehow not clear.

     

     

    I have some request from a telco to give a solution for them.

     

     

    Their objective as following:

     

     

    1. Internet without proxy:

     

     

    Protocol: HTTP, destination: www.facebook.com

     

     

    Protocol: WAP 2.0, destination: www.facebook.com

     

     

    2. Intervet via proxy:

     

     

    Protocol: HTTP, destination: other than www.facebook.com

     

     

    Protocol: Wap 2.0, destination: other than www.facebook.com

     

     

    Protocol: Wap 1.x, destination: any (including facebook)

     

     

    Their subscriber has been configured the proxy setting automatically by OTA. But the challenge is once the subscriber browser (mobile phone) support WAP 2.0 and destination www.facebook.com they want to send the traffic directly to internet bypass their proxy server.

     

     

    I tried to create iRules for them for the above objectives:

     

     

    when HTTP_REQUEST {

     

     

    if { [HTTP::host] equals "www.facebook.com" } {

     

    not (switch -glob [string to lower [HTTP::header User-Agent]] {

     

    "*blackberry*" -

     

    "*windows ce*" -

     

    "*palm*" -

     

    "*sonyericsson*" -

     

    "*mot-*" -

     

    "*netfront*" -

     

    "*nokia*" -

     

    "*samsung*" -

     

    "*smartphone*" -

     

    "*symbian*"})} {

     

    pool pool_internet

     

    }

     

    elseif { [HTTP::host] equals "www.facebook.com" } {[HTTP::header exists "accept"] } {

     

    switch -glob [HTTP::header "accept"] {

     

    "*wap*" -

     

    "*vnd.wap.xhtml+xml*" {

     

    pool pool_internet

     

    else {

     

    pool pool_proxy

     

    }

     

    }

     

     

    Actually i don't have any experience on creating iRules, i just tried my best to write.

     

    Please pardon me if you found any error in syntax.

     

     

    But I was wondering how can I detect whether this is HTTP or WAP 1.0 or WAP 2.0 Protocol or not,

     

    and how do I remove proxy setting if the traffic suppose go to internet directly bypass the proxy server.

     

    Can i just send to internet pool ? Need your help and advise guys for the iRules. thanks a lot.