mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-13 01:51:23 +00:00
[libp2p-dns] Implement /dnsaddr
resolution. (#1931)
* Implement `/dnsaddr` support on `libp2p-dns`. To that end, since resolving `/dnsaddr` addresses needs "fully qualified" multiaddresses when dialing, i.e. those that end with the `/p2p/...` protocol, we make sure that dialing always uses such fully qualified addresses by appending the `/p2p` protocol as necessary. As a side-effect, this adds support for dialing peers via "fully qualified" addresses, as an alternative to using a `PeerId` together with a `Multiaddr` with or without the `/p2p` protocol. * Adapt libp2p-relay. * Update versions, changelogs and small cleanups.
This commit is contained in:
@ -401,14 +401,12 @@ impl<T: Transport> Stream for RelayListener<T> {
|
||||
Poll::Ready(Some(BehaviourToListenerMsg::IncomingRelayedConnection {
|
||||
stream,
|
||||
src_peer_id,
|
||||
relay_peer_id,
|
||||
relay_addr,
|
||||
relay_peer_id: _
|
||||
})) => {
|
||||
return Poll::Ready(Some(Ok(ListenerEvent::Upgrade {
|
||||
upgrade: RelayedListenerUpgrade::Relayed(Some(stream)),
|
||||
local_addr: relay_addr
|
||||
.with(Protocol::P2p(relay_peer_id.into()))
|
||||
.with(Protocol::P2pCircuit),
|
||||
local_addr: relay_addr.with(Protocol::P2pCircuit),
|
||||
remote_addr: Protocol::P2p(src_peer_id.into()).into(),
|
||||
})));
|
||||
}
|
||||
|
Reference in New Issue
Block a user