Forum Discussion
krelm_52303
Nimbostratus
Nov 20, 2008Changing HTTP Header Host port
Am receiving http requests on a high port (55555) and need to remove this in the header for all requests (so it sends on as port 80).
For example...
Host: www.google.com:...
hoolio
Cirrostratus
Nov 24, 2008Can you post some anonymized samples of the URI's you want to rewrite? Is the client using an absolute URI? Something like this?
GET http://www.w3.org:55555/pub/WWW/TheProject.html HTTP/1.1
User-Agent: ...
If so, you could use string map instead of regsub. The string function would be more efficient than a regex.
HTTP::uri [string map {:55555/ /} [HTTP::uri]]
If you also need to rewrite the port in response content, you could use a stream filter and STREAM::expression based iRule. This would be more efficient than collecting the response content and performing regex operations on it. You can check the STREAM::expression wiki page (Click here) for examples.
Aaron
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