Subprotocol returns the WebSocket subprotocol in use.
()
| 124 | |
| 125 | // Subprotocol returns the WebSocket subprotocol in use. |
| 126 | func (c WebSocket) Subprotocol() string { |
| 127 | return c.v.Get("protocol").String() |
| 128 | } |
| 129 | |
| 130 | // OnOpen registers a function to be called when the WebSocket is opened. |
| 131 | func (c WebSocket) OnOpen(fn func(e js.Value)) (remove func()) { |