You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
254 B
14 lines
254 B
3 years ago
|
package wsutil
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"net"
|
||
|
|
||
|
"nhooyr.io/websocket"
|
||
|
)
|
||
|
|
||
|
// NetConn creates opaque wrapper net.Conn for websocket.Conn.
|
||
|
func NetConn(c *websocket.Conn) net.Conn {
|
||
|
return websocket.NetConn(context.Background(), c, websocket.MessageBinary)
|
||
|
}
|