Documentation
¶
Index ¶
Constants ¶
const SessionKeySubprotocol = "ws:subprotocol"
SessionKeySubprotocol is the session key under which a listener-side socket stores the subprotocol negotiated during the WebSocket handshake (empty when none was negotiated).
Variables ¶
This section is empty.
Functions ¶
func NewTransport ¶
func NewTransport(pattern string, opts ...xtransport.Option) xtransport.Transport
func Subprotocols ¶ added in v1.0.6
func Subprotocols(protos ...string) xtransport.Option
Subprotocols configures WebSocket subprotocol negotiation. A listener accepts the first protocol offered by the client that appears in protos and echoes it in the handshake response; Dial offers protos to the server. RFC 6455 clients (browsers, the Node ws package) abort the connection when they offered a subprotocol and the server selects none, so a server speaking MQTT over WebSocket must be configured with Subprotocols("mqtt") to accept standard MQTT clients such as mqtt.js.
Types ¶
This section is empty.