web_websocket_connect

Creates a WebSocket connection.

C Language

int web_websocket_connect("ID=connection", "URI=ws://server:port", ["Origin=value ", SecWebSocketKey=value ",    "SecWebSocketProtocol=value ", SecWebSocketExtensions=value, OnOpenCB=func_name, OnMessageCB=func_name, OnErrorCB=func_name, OnCloseCB=func_name, ] LAST);
Example: web_websocket_connect, web_websocket_close, web_websocket_sendMiscellaneous Functions
IDA unique number indicating the connection number. This value is generated automatically during code generation.
URIThe WebSocket endpoint in ws:// or wss:// (secure WebSocket schema) format.
OriginOrigin header value.
Optional: Only generated if detected during the recording session.
SecWebSocketKeySec-WebSocket-Key header value.
Optional: The WebSocket key value. Not recorded, but can be added manually.
SecWebSocketProtocolSec-WebSocket-Protocol header value.
Optional: Only generated if detected during the recording session.
SecWebSocketExtensionsSec-WebSocket-Extensions header value.
Optional: Only generated if detected during the recording session.
OnOpenCBCallback function name for an OnOpen event (optional). For details, see WebSocket Callback Functions.
OnMessageCBCallback function name for an OnMessage event (optional). For details, see WebSocket Callback Functions.
OnErrorCBCallback function name for an OnError event (optional). For details, see WebSocket Callback Functions.
OnCloseCBCallback function name for an OnClose event (optional). For details, see WebSocket Callback Functions.
LAST Required marker for the end of the argument list.

This function creates a WebSocket connection upon which to send the message.

Headers that were detected during recording will be generated automatically, except for SecWebSocketKey. To add additional headers to the handshake request, place web_add_header or web_add_cookie steps before this function.

Callbacks will be generated with the default implementation commented out. For a description of the callback functions, see WebSocket Callback Functions.

Return Values

This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure.

Parameterization

Standard Parameterization is supported for all of this function's arguments.