Im implementing a Proxy Protocol decoder in Netty 4. This protocol allows an external proxy (in this case HAProxy) to provide remote address details to an internal server behind the proxy server.

To include this in my pipeline i need to override the SocketAddress provided by the Netty Channel. I guess i could just put the address provided by Proxy Protocol on the channel as an attribute, but id prefer to keep the decoder non-specific to my application if possible and just update the remoteAddress directly on the channel.

any ideas?

有帮助吗?

解决方案

Nope you can't override it as it is specific to the transport.

其他提示

As Norman mentioned, it's currently impossible. However, there's an ongoing discussion on how we have to implement proxy support seamlessly. Exposing the backend remote address is also one of the questions we have to answer for proper proxy support. Please feel free to join the discussion: https://github.com/netty/netty/pull/1740

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top