Skip to main content
method WebSocket.prototype.close

Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.

Parameters

optional
code: number
optional
reason: string