rust-libp2p icon indicating copy to clipboard operation
rust-libp2p copied to clipboard

Add get_address_proto to handle trailing "tls/ws" in multiaddr

Open jochasinga opened this issue 3 years ago • 4 comments

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.

jochasinga avatar Feb 07 '22 17:02 jochasinga

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.

tomaka avatar Feb 08 '22 16:02 tomaka

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. Ultimately Protocol::Wss shouldn't be used except specifically for backwards compatibility.

Could you elaborate on those two points @tomaka ?

jochasinga avatar Feb 08 '22 21:02 jochasinga

@tomaka or @thomaseizinger some help on finishing this up?

jochasinga avatar Mar 21 '22 15:03 jochasinga

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?

mxinden avatar Apr 06 '22 10:04 mxinden