Closed tomaka closed 1 year ago
Shouldn't this change be made on the multiaddr crate too?
Shouldn't this change be made on the multiaddr crate too?
Should be done via https://github.com/multiformats/rust-multiaddr/pull/48/.
I can tackle this @mxinden @tomaka.
Looks to me like even /wss
scheme isn't supported currently? Keep getting MultiaddrNotSupported("/ip6/::1/tcp/0/wss")
running test.
Since multiformats/rust-multiaddr#48 added tls support, will this be just upgrading libp2p-websocket to use it?
Does this test case for rust-multiaddr make sense @tomaka?
// rust-multiaddr/src/from_url.rs
#[test]
fn normal_usage_wss() {
let addr = from_url("wss://127.0.0.1:8000").unwrap();
assert_eq!(addr, "/ip4/127.0.0.1/tcp/8000/tls/ws".parse().unwrap());
assert_eq!(addr, "/ip4/127.0.0.1/tcp/8000/wss".parse().unwrap());
}
Basically, when parsing a multiaddress, when a tls
is found, we peek to see if the next one is "ws" and write that off as Protocol::Wss(..)
.
I don't think it's a good idea to make /tls/ws
and /wss
equal. This is too magic and could lead to violated assumptions.
In my opinion the only change needed is making libp2p-websocket
support /tls/ws
.
Hello everyone, are there any updates on TLS support for websockets?
Hello everyone, are there any updates on TLS support for websockets?
Support is there and there is an example in the docs! This ticket is only about the deprecated multiaddr component.
Hello everyone, are there any updates on TLS support for websockets?
Support is there and there is an example in the docs! This ticket is only about the deprecated multiaddr component.
Thank you! Would you be able to point me to the example?
Hello everyone, are there any updates on TLS support for websockets?
Support is there and there is an example in the docs! This ticket is only about the deprecated multiaddr component.
Thank you! Would you be able to point me to the example?
See https://docs.rs/libp2p-websocket/latest/libp2p_websocket/struct.WsConfig.html#examples. It is a bit hard to discover. We are in the process of making the APIs of our crates more consistent, see https://github.com/libp2p/rust-libp2p/issues/2217. Help in doing that for libp2p-websocket
would be appreciated :)
Closing in favor of https://github.com/multiformats/rust-multiaddr/issues/100.
According to the multiaddr spec, the
/wss
specifier is deprecated and/tls/ws
should be preferred.libp2p-websocket
only supports/wss
.(I've taken the liberty to mark this as "easy", as it's just about interpreting the multiaddr)