Creates the coordinator.
Optionalmodule: WsModuleLike
An injected ws module; omit to load it lazily
Whether a ws server has been created yet.
Shuts down the ws server, when one was ever created.
Completes the RFC 6455 handshake over an already-accepted TCP connection and binds the resulting socket to the decision's sink.
The Node request from the upgrade event
The raw duplex socket
The bytes the HTTP parser already buffered
The sink to bind the completed socket into
Optionalprotocol: string
The negotiated subprotocol to echo, when one was selected
Owns the
wsserver for one Node HTTP adapter and performs the handshake.Split out of the adapter so the adapter keeps its single responsibility (mapping HTTP) and so the handshake's branches are measurable in isolation. The
wsserver is created on the first accepted upgrade — a plain HTTP application therefore never loads the optional dependency at all.Since
0.2.0