gun:ws_upgrade - Upgrade to Websocket
Upgrade to Websocket.
The behavior of this function depends on the protocol selected.
HTTP/1.1 cannot handle Websocket and HTTP requests concurrently. The upgrade, if successful, will result in the complete takeover of the connection. Any subsequent HTTP requests will be rejected.
Gun does not currently support Websocket over HTTP/2.
By default Gun will take the Websocket options from
the connection’s ws_opts.
The pid of the Gun connection process.
Path to the resource.
Additional request headers.
Configuration for the Websocket protocol.
A reference that identifies the newly created stream is returned. It is this reference that must be passed in subsequent calls and will be received in messages related to this new stream.
1.0: Function introduced.