From e94a65bd07d4d3bcc3959241298fdb31560e617c Mon Sep 17 00:00:00 2001 From: Omer Akram Date: Mon, 15 Aug 2022 00:39:55 +0500 Subject: [PATCH] expose the websocket subprotocol --- nbhttp/websocket/conn.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nbhttp/websocket/conn.go b/nbhttp/websocket/conn.go index a6c5934e..86c76c5c 100644 --- a/nbhttp/websocket/conn.go +++ b/nbhttp/websocket/conn.go @@ -300,6 +300,11 @@ func (c *Conn) SetCompressionLevel(level int) error { return nil } +// The negotiated websocket subprotocol +func (c *Conn) Subprotocol() string { + return c.subprotocol +} + func newConn(u *Upgrader, c net.Conn, subprotocol string, remoteCompressionEnabled bool) *Conn { conn := &Conn{ Conn: c,