vert.x icon indicating copy to clipboard operation
vert.x copied to clipboard

Access TLVs of Proxy Protocol v2 header from NetSocket

Open trnguyencflt opened this issue 10 months ago • 6 comments

Describe the feature

Ability to read TLVs of Proxy Protocol header from NetSocket. To be more clear, in HAProxyMessageCompletionHandler#decode function, we only use HAProxyMessage msg only for overriding remote address and local address, however, in some use case, there are information in the proxy protocol header that are store in List<HAProxyTLV> tlvs of msg that are needed. Currently there is not a way to access that data when enabling proxy protocol in NetServerOptions of NetServer

trnguyencflt avatar Jan 19 '25 08:01 trnguyencflt

I see, you could like to access those info from the NetSocket ?

vietj avatar Jan 20 '25 09:01 vietj

I see, you could like to access those info from the NetSocket ?

Yes, NetSocket is created from NetServer (in #connectHandler), when NetServer is init with proxy protocol enabled then there should be a way to access proxy protocol data, the current way of getting only remote/local address isn't sufficient for all use cases. Thanks

trnguyencflt avatar Jan 20 '25 10:01 trnguyencflt

so in practice a map would be sufficient

vietj avatar Jan 20 '25 13:01 vietj

so in practice a map would be sufficient

Not sure if I fully understand this, TLVs are represented as a list in HAProxyMessage (of netty), could you explain more how the map works here? Thanks.

trnguyencflt avatar Jan 20 '25 14:01 trnguyencflt

I meant a Java map to expose this in API

vietj avatar Mar 05 '25 12:03 vietj

I meant a Java map to expose this in API

That'd work, thanks 👍

trnguyencflt avatar Mar 31 '25 09:03 trnguyencflt