Can't get local address of AddrStream
#2773
Labels
C-bug
Category: bug. Something is wrong. This is bad!
AddrStream
#2773
Version
hyper v0.14.17
Description
AddrStream
offers aremote_addr()
method that returns the remote (peer) address of the connection. But there's no equivalentlocal_addr()
method.TcpStream
has such a method, but the only way to get that fromAddrStream
isAddrStream::to_inner()
that consumes theAddrStream
entirely (which is to say, there's noas_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 anAddrStream::local_addr()
method or I need anAddrStream::as_inner()
method1 that I can then use to callTcpStream::local_addr()
.Footnotes
Or maybe an
<AddrStream as AsRef<TcpStream>>
impl. ↩The text was updated successfully, but these errors were encountered: