rust-libp2p
rust-libp2p copied to clipboard
Add get_address_proto to handle trailing "tls/ws" in multiaddr
Before returning Ws
protocol when hitting the last trailing /ws
in a multiaddr,
check to see if the next path segment is /tls
. If it is, then return Wss
instead.
This addresses #2449 the deprecated /wss
specifier for the new /tls/ws
in the spec.
I guess this is a first step :+1: , but for #2449 to be finished we need a couple more changes, such as producing /tls/ws
when receiving an incoming connection. Ultimately Protocol::Wss
shouldn't be used except specifically for backwards compatibility.
I guess this is a first step 👍 , but for #2449 to be finished we need a couple more changes, such as producing
/tls/ws
when receiving an incoming connection. UltimatelyProtocol::Wss
shouldn't be used except specifically for backwards compatibility.
Could you elaborate on those two points @tomaka ?
@tomaka or @thomaseizinger some help on finishing this up?
I am not particularly familiar with this code. @tomaka your input would be more helpful here.
In regards to above comment on this still missing some parts, if I am not mistaken the code below would append a ws
or wss
, but not a tls/ws
:
https://github.com/libp2p/rust-libp2p/blob/90140a6eafd8a500e654b14040941f9f5074474d/transports/websocket/src/framed.rs#L165-L166
Is that of some help @jochasinga?