Add support for HA Proxy Protocol TLV's#5972
Conversation
|
I'd rather expose that has a Map<Buffer, Buffer> instead (that map can be ordered if needed) |
87477f4 to
c40907d
Compare
|
Sure, I just updated the code accordingly |
| * the value contains the TLV value, mainly used for HA Proxy Protocol v2 | ||
| */ | ||
| @GenIgnore() | ||
| Map<Buffer, Buffer> tlvs(); |
There was a problem hiding this comment.
why do we need that ? Quic does not yet support proxying at the moment and we are not sure it makes sense
There was a problem hiding this comment.
that seems at the moment to be a TCP concern only
There was a problem hiding this comment.
Do you see a better place to put this one ? The goal is to access TLV's in NetServer#connectHandler
There was a problem hiding this comment.
sorry, it is fine here, I meant actually on QuicConnection it should apply to.
| * the value contains the TLV value, mainly used for HA Proxy Protocol v2 | ||
| */ | ||
| @GenIgnore() | ||
| Map<Buffer, Buffer> tlvs(); |
There was a problem hiding this comment.
this should return null when it does not apply, e.g. HTTP/3
|
The protocol technically allows for multiple occurrences of TLVs with the same type. It's probably not that common, but I am wondering if it makes sense to add unnecessary constraints. The underlying Netty decoder also uses a List, presumably for that reason. |
@vietj I was also not able to find anything about TLV uniqueness based on type here. |
vertx-core/src/main/java/io/vertx/core/http/HttpConnection.java
Outdated
Show resolved
Hide resolved
I think we can use an Iterable<Map.Entry<Buffer, Buffer>> instead |
c9094eb to
c36e061
Compare
Sure, done! |
3ff869f to
a77685a
Compare
| * This is mainly used for HA Proxy Protocol v2 | ||
| */ | ||
| @GenIgnore() | ||
| default Iterable<Map.Entry<Buffer, Buffer>> tlvs() { |
There was a problem hiding this comment.
I think the name should be more clear about what is provided, those are coming from HA proxy protocol, e.g. proxyProtocolV2HeaderTLVs seems more descriptive.
There was a problem hiding this comment.
Sure, should we rename it everywhere ? also in NetSocket etc ?
There was a problem hiding this comment.
yes it should be consistently renamed I think
c292362 to
c2c136e
Compare
| * This is mainly used for HA Proxy Protocol v2 | ||
| */ | ||
| @GenIgnore() | ||
| default Iterable<Map.Entry<Buffer, Buffer>> proxyProtocolV2HeaderTLVs() { |
There was a problem hiding this comment.
actually we could use List here as a better type since everything is buffered, no need to use a weaker collection type ?
TLV's are supported in netty, but currently not accessible to vert.x users. Here the TLV's are exposed in `NetSocket#proxyProtocolV2HeaderTLVs`
|
thanks @damianorenfer |
|
@vietj Do you think we can backport this to 4.x ? |
Motivation:
TLV's are supported in netty, but currently not accessible to vert.x users.
Here the TLV's are exposed in
NetSocket#tlvsThis also answers to #5452
Conformance:
ECA signed