Creates a new Socket instance
The URL to connect the WebSocket to
The parameters for the Socket, such as a proxy
Closes the WebSocket connection
Optionalcode: numberAn optional code to send when closing the connection
Sends data through the WebSocket connection
The data to send, either as a string or binary data
Attempts to initialize the connection to the WebSocket
Whether the connection was successful
Whether the WebSocket will automatically reconnect
The binary type of the WebSocket
Whether the Websocket is currently connected
The connection timeout for the WebSocket
A handler that runs before you connect to the socket
A handler that runs when the socket closes
A handler that runs when the socket errors
A handler that runs when the socket gets a message
A handler that runs when the socket opens
The underlying actual WebsSocket
The URL of the WebSocket
A WebSocket with auto-reconnect and proxy capabilities