Skip to main content

Aliases

  • WebSocket.Connect
  • websocket.connect
  • websocket.Connect

Arguments

string
required
URL string passed to CURLOPT_URL before WebSocket client performs the WebSocket connection attempt.

Returns

WebSocket
WebSocket table containing OnMessage, OnClose, and connection state. Send and Close are resolved with the WebSocket object methods.

Example

Open a WebSocket, listen for messages and close events, then use the socket methods.