libp2p / rust-libp2p

The Rust Implementation of the libp2p networking stack.
https://libp2p.io
MIT License
4.45k stars 928 forks source link

websocket wasm cannot dial /tls/ws addresses #5509

Closed sukunrt closed 1 month ago

sukunrt commented 1 month ago

Summary

Dialing /dns/dht.nonsequitur.xyz/tcp/5123/tls/ws/p2p/12D3KooWPvLLPbUzs33TicVYPY78AEZSnd671irhqyi3UWLSBH8H fails.

Dialing /dns/dht.nonsequitur.xyz/tcp/5123/wss/p2p/12D3KooWPvLLPbUzs33TicVYPY78AEZSnd671irhqyi3UWLSBH8H works fine(Edited based on: https://github.com/libp2p/rust-libp2p/issues/5509#issuecomment-2251187938).

Expected behavior

Both the dials should work.

Actual behavior

/tls/ws dials fail

Relevant log output

No response

Possible Solution

/tls/ws and /wss are equivalent with /wss deprecated in favor of the more explicit tls/ws. The dialing logic should consider this.

Version

No response

Would you like to work on fixing this bug ?

Maybe

sukunrt commented 1 month ago

There was an issue that was supposed to handle this https://github.com/libp2p/rust-libp2p/issues/2449. But all the comments there only consider the multiaddr library aspects of the problem and not the dialing part of the problem.

Recently, this was brought up here https://github.com/eigerco/lumina/issues/314

aschmahmann commented 1 month ago

Do you mean:

Dialing /dns/dht.nonsequitur.xyz/tcp/5123/wss/p2p/12D3KooWPvLLPbUzs33TicVYPY78AEZSnd671irhqyi3UWLSBH8H works fine.

rather than ..../tls/wss/p2p/.... works fine since /tls/wss should be invalid