-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Description
Go 1.18 adds the NetConn method to *tls.Conn. The new method is identical in purpose to the websocket connection's UnderlyingConn method.
To align the method names with the standard library, add a NetConn method to *Conn and deprecate UnderlyingConn:
// NetConn returns the underlying connection that is wrapped by c.
// Note that writing to or reading from this connection directly will corrupt the
// WebSocket connection.
func (c *Conn) NetConn() net.Conn {
return c.conn
}
// UnderlyingConn returns the internal net.Conn. This can be used to further
// modifications to connection specific flags.
// Deprecated: Use the NetConn method.
func (c *Conn) UnderlyingConn() net.Conn {
return c.conn
}