MCPcopy
hub / github.com/coder/websocket / Subprotocol

Method Subprotocol

internal/wsjs/wsjs_js.go:126–128  ·  view source on GitHub ↗

Subprotocol returns the WebSocket subprotocol in use.

()

Source from the content-addressed store, hash-verified

124
125// Subprotocol returns the WebSocket subprotocol in use.
126func (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.
131func (c WebSocket) OnOpen(fn func(e js.Value)) (remove func()) {

Callers 1

ServeHTTPMethod · 0.45

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected