-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Resolver interface to transport #1719
Conversation
966805b
to
5bce716
Compare
54e85e1
to
2dc2ace
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you planning to add the WebTransport logic in a follow-up PR?
p2p/transport/websocket/websocket.go
Outdated
fallthrough | ||
case ma.P_DNS6: | ||
fallthrough | ||
case ma.P_DNSADDR: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is equivalent to:
case ma.P_DNS, ma.P_DNS4, ma.P_DNS6, ma.P_DNSADDR:
Right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe easier: maddr.ValueForProtocol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be multiple loops to get the value, right?
Have you considered requiring the repo by its commit hash? That would allow you to run CI (and would have caught at least one of the issues here, the copying of the mutex). |
Co-authored-by: Marten Seemann <[email protected]>
Yep! |
includes libp2p/go-libp2p#1719 which fixes secure websockets (wss) by having the websocket transport resolve a multiaddr with a dns hostname and /wss into a multiaddr that explictly defines the sni component. e.g. converts /dns4/example.com/tcp/1234/wss into /dns4/example.com/tcp/1234/tls/sni/example.com/ws
includes libp2p/go-libp2p#1719 which fixes secure websockets (wss) by having the websocket transport resolve a multiaddr with a dns hostname and /wss into a multiaddr that explictly defines the sni component. e.g. converts /dns4/example.com/tcp/1234/wss into /dns4/example.com/tcp/1234/tls/sni/example.com/ws
includes libp2p/go-libp2p#1719 which fixes secure websockets (wss) by having the websocket transport resolve a multiaddr with a dns hostname and /wss into a multiaddr that explictly defines the sni component. e.g. converts /dns4/example.com/tcp/1234/wss into /dns4/example.com/tcp/1234/tls/sni/example.com/ws
includes libp2p/go-libp2p#1719 which fixes secure websockets (wss) by having the websocket transport resolve a multiaddr with a dns hostname and /wss into a multiaddr that explictly defines the sni component. e.g. converts /dns4/example.com/tcp/1234/wss into /dns4/example.com/tcp/1234/tls/sni/example.com/ws
fixes #1597
This adds a new Resolver interface that can be optionally implemented by transports. This lets a transport resolve a single multiaddr into many multiaddrs, while still letting the swarm handle concurrency in the actual dialing step.
This PR also fixes secure websockets (wss) by having the websocket transport resolve a multiaddr with a dns hostname and
/wss
into a multiaddr that explictly defines thesni
component. e.g. converts/dns4/example.com/tcp/1234/wss
into/dns4/example.com/tcp/1234/tls/sni/example.com/ws
. This is useful so that when the swarm resolves the dns4 address the websocket transport still has access to the hostname so that it can properly set the SNI. e.g. the swarm converts/dns4/example.com/tcp/1234/tls/sni/example.com/ws
into/ip4/1.2.3.4/tcp/1234/tls/sni/example.com/ws
, and the websockets transport still knows what the SNI should be when it's asked to dial.Tests will fail until multiformats/go-multiaddr#182 is merged and released.