fix: return local address for direct WebSocket connections

This commit is contained in:
21pages
2026-10-14 20:04:48 +08:00
parent 0ccaaf2cf6
commit 423fb71085
2 changed files with 7 additions and 4 deletions
+2 -2
View File
@@ -213,8 +213,8 @@ impl WsFramedStream {
match stream {
Either::Left(stream) => {
// MaybeTlsStream::get_ref() handles Plain, NativeTls and Rustls,
// returning the underlying TcpStream for peer_addr().
let addr = stream.get_ref().get_ref().peer_addr()?;
// returning the underlying TcpStream for local_addr().
let addr = stream.get_ref().get_ref().local_addr()?;
Ok((Either::Left(stream), addr))
}
Either::Right((stream, addr)) => Ok((Either::Right(stream), addr)),