Is there a way to get the correct listening address from a remote node in a newly established connection?

According to the docs, the ConnectedPoints get_remote_address method won’t get me the remote address where the node is listening.

https://docs.rs/libp2p/0.34.0/libp2p/core/enum.ConnectedPoint.html#method.get_remote_address

What’s the proper way to handle this?

Proper way: using the Identify behaviour. (:

https://docs.rs/libp2p/0.34.0/libp2p/identify/index.html

1 Like