Documentation Index
Fetch the complete documentation index at: https://wreq.sqdsh.win/llms.txt
Use this file to discover all available pages before exploring further.
Signature
websocket(...) resolves after the connection opens.
Constructor shape
WebSocket also supports constructor usage for browser-style ergonomics.
WebSocketOptions
Browser fingerprint profile for the connection.
Operating system fingerprint for the connection.
Proxy URL for the connection.
Additional headers for the WebSocket handshake.
Optional subprotocol list for compatibility with standard WebSocket shape.
Values are validated for non-empty unique entries and sent in the
Sec-WebSocket-Protocol handshake header.Maximum size in bytes for a single incoming WebSocket frame.
Increase this when the peer sends large unfragmented frames.
Maximum size in bytes for a complete incoming WebSocket message.
Increase this when the peer sends very large fragmented messages.
Binary payload format exposed at
event.data.Returned WebSocket instance
The instance mirrors familiar WebSocket APIs.- Properties
urlreadyStatebinaryTypebufferedAmountprotocolextensionsonopenonmessageoncloseonerror
protocol and extensions reflect negotiated values from the upgrade response when the server provides them.
- Methods
send(data)where data can bestring,Buffer,ArrayBuffer,ArrayBufferView, orBlobclose(code?, reason?)addEventListener(type, listener)removeEventListener(type, listener)
close(code, reason) accepts code 1000 or codes in the 3000 to 4999 range.
When providing a reason, the UTF-8 byte length must be 123 or fewer.
- Constants
WebSocket.CONNECTINGWebSocket.OPENWebSocket.CLOSINGWebSocket.CLOSED
Session support
For authenticated socket flows, usecreateSession() and then session.websocket(url, options).
Within a session, WebSocket uses the same session context and transport settings.
Examples
Helper style
Constructor style
Binary payload mode
Large incoming messages
Some providers send very large WebSocket payloads in a single frame. If you see an error such asSpace limit exceeded: Message too long, raise the frame or message limits explicitly.