Forum Discussion
eduardo_26187
Nimbostratus
Jan 28, 2010Rule 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 {
...
eduardo_26187
Nimbostratus
Feb 02, 2010Thanks 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
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
