Forum Discussion
Stef_85923
Nimbostratus
Jul 29, 2011HSS header modification
I am trying to create an iRule wihci will affect the HSS header, the source IP will be be inserted in the new customer header (x-hss-auth) with a new on net/offnet flag. The iRule logic is the follw...
Kevin_Davies_40
Nacreous
Aug 02, 2011 This code injects the X-HSS-Auth header to reflect the source of the traffic
The header x-wsbsourceip should exist in the incoming request when coming from WAP networks
X-HSS-Auth is x.x.x.x,0.0.0.y where x is the source address, y is 0 for internet or 1 for On-Net/WAP traffic
when HTTP_REQUEST {
remove headers we dont want
HTTP::header remove {X-Net-Info} {X-Forwarded-For}
inject header to show where we came from.
if { [class match [IP::client_addr] equals WAP] } {
set header "[HTTP:header {x-wsbsourceip}],0.0.0.1"
} elseif { [class match [IP::client_addr] equals On-Net] } {
set header "[IP::client_addr],0.0.0.1"
} else {
set header "[IP::client_addr],0.0.0.0"
}
HTTP::header insert {X-HSS-Auth} $header
log "My IP address is [IP::client_addr]. My new header X-HSS-Auth: $header"
}
Hope that helps.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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