Forum Discussion

eduardo_26187's avatar
eduardo_26187
Icon for Nimbostratus rankNimbostratus
Jan 28, 2010

Rule to hide port in client side

Hi, this is my first post.

 

 

I' ve googled about how to do this rule, but I have no idea so far:

 

 

After doing a redirect this way:

 

 

when HTTP_REQUEST {

 

HTTP::redirect "https://[HTTP::host]:9081/Login.jsp"

 

}

 

 

I want to hide port 9081 to the user, but internally still managing port 9081 with websphere.

 

 

Thanks in advance.

1 Reply

  • Thanks Mr. hoollio,

     

     

    I already checked the section Rewrite HTTP Redirect Port, but is not what I am looking for, because I'd like to use the same port 9081 and hiding the TCP::local_port without showing any port in url.

     

     

    Checking the section STREAM::expression in the next example

     

     

    when HTTP_RESPONSE {

     

     

    Disable the stream filter by default

     

    STREAM::disable

     

     

    Check if response type is text

     

    if {[HTTP::header value Content-Type] contains "text"}{

     

     

    Match any http:// instance and replace it with nothing

     

    STREAM::expression {&http://.*?example\.com&&}

     

     

    Enable the stream filter for this response only

     

    STREAM::enable

     

    }

     

    }

     

    when STREAM_MATCHED {

     

    log local0. "[IP::client_addr]:[TCP::local_port]: matched: [STREAM::match], replaced with: [string map {http:// https://} [STREAM::match]]"

     

    STREAM::replace "[string map {http:// https://} [STREAM::match]]"

     

    }

     

     

     

    I think this example replaces the string for logging which is not useful at all.

     

     

    What I'm still looking for is a rule like this (with the correct sintax):

     

     

    when http:response {

     

    if {

     

    http: [gethost][port 9081]

     

    }

     

    hide_in_url port 9081

     

    http::redirect host:9081

     

    }

     

     

    Thanks in advance