Domanda

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?

È stato utile?

Soluzione

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

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top