Skip to content

Commit a326378

Browse files
committed
quic: add LocalAddr() and RemoteAddr() to quic.Conn
1 parent 511cc3a commit a326378

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

quic/conn.go

+10
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ func (c *Conn) String() string {
176176
return fmt.Sprintf("quic.Conn(%v,->%v)", c.side, c.peerAddr)
177177
}
178178

179+
// LocalAddr returns the local network address, if known.
180+
func (c *Conn) LocalAddr() netip.AddrPort {
181+
return c.localAddr
182+
}
183+
184+
// RemoteAddr returns the remote network address, if known.
185+
func (c *Conn) RemoteAddr() netip.AddrPort {
186+
return c.peerAddr
187+
}
188+
179189
// confirmHandshake is called when the handshake is confirmed.
180190
// https://www.rfc-editor.org/rfc/rfc9001#section-4.1.2
181191
func (c *Conn) confirmHandshake(now time.Time) {

0 commit comments

Comments
 (0)