Description
Version
hyper v0.14.17
Description
AddrStream
offers a remote_addr()
method that returns the remote (peer) address of the connection. But there's no equivalent local_addr()
method. TcpStream
has such a method, but the only way to get that from AddrStream
is AddrStream::to_inner()
that consumes the AddrStream
entirely (which is to say, there's no as_inner()
method to get a reference).
This is really frustrating because I want to log the local IP address on incoming connections (I'm listening on 0.0.0.0
and I want to know which interface the connection is coming in on). So I either need an AddrStream::local_addr()
method or I need an AddrStream::as_inner()
method1 that I can then use to call TcpStream::local_addr()
.
Footnotes
-
Or maybe an
<AddrStream as AsRef<TcpStream>>
impl. ↩
Activity