mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-04-25 11:02:12 +00:00
Wildcard IP addresses (e.g. 0.0.0.0) are used to listen on all host interfaces. To report those addresses such that clients know about them and can actually make use of them we use the `get_if_addrs` crate and maintain a collection of addresses. We report the whole expansion at the very beginning of the listener stream with `ListenerEvent::NewAddress` events and add new addresses should they come to our attention. What remains to be done is to potentially allow users to filter IP addresses, for example the local loopback one, and to detect expired addresses not only if a new address is discovered.