Forum Discussion
Lukas_Ziegler
Jun 04, 2020Nimbostratus
Proxy Protocol via iRule --> how to implement v2
We are trying to implement proxy protocol (for use with SAP Web Dispatcher) and have this irule: when CLIENT_ACCEPTED {
set proxyheader "PROXY TCP[IP::version] [IP::remote_addr] [IP::local_addr]...
cjunior
Jun 04, 2020Nacreous
Hi,
I have no experience on that, but I find this:
https://support.f5.com/csp/article/K40512493
http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
https://github.com/ably/proxy-protocol-v2
Are you working with IPv4 and TCP ?
Maybe this:
when CLIENT_ACCEPTED {
# Protocol signature
set headerHex "0d0a0d0a000d0a515549540a"
# As Local
append headerHex "20"
# IPv4 and TCP
append headerHex "11"
# Length 22
append headerHex "0c00"
# Source IPv4 as Hex
foreach oct [split [IP::remote_addr] "."] {
append headerHex [format %02x $oct]
}
# Dest IPv4 as Hex
foreach oct [split [IP::local_addr] "."] {
append headerHex [format %02x $oct]
}
# Source port as Hex
append headerHex [format %04x [TCP::remote_port]]
# Dest port as Hex
append headerHex [format %04x [TCP::local_port]]
}
when SERVER_CONNECTED {
# Write header as byte
TCP::respond [binary format H* $headerHex]
}
Please, permit me to be wrong with that example code when it is just a shot.
If necessary, I think you can run proxy-protocol-v2 as node.js libraries in iRuleLX.
Kind regards.
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