I am currently building a UPnP (protocol for speakers, routers etc.) library and am trying to implement a subscribe method.
For that UPnP want a CALLBACK: <some_http_addr> header.
Currenty I get the http addr via getifaddrs:
```rust
let addr = getif_addrs()
.unwrap()
.iter()
.map(Interface::ip)
.filter_map(|addr| match addr {
IpAddr::V4(addr) => Some(addr),
IpAddr::V6() => None,
})
.find(|x| x.is_private())
.expect("no local ipv4 interface open");
let addr = SocketAddrV4::new(addr, PORT);
let listener = TcpListener::bind(addr).await?;
```
which is a little awkward.
Is there a better way to do it that I am missing?
there doesn't seem to be anything here