WebSocket

Follow a WebSocket connection frame by frame, in both directions, with timing and payloads that open like any other body.

Mac iPhone and iPad Android

WireLens captures WebSocket connections from the moment they open. The upgrade request and its 101 Switching Protocols response appear in the traffic list like any other flow, and the row stays there while the connection is open.

The WebSocket chip lists them all on the Mac and on iPhone and iPad.

The frame timeline#

PlatformWhere the frames are
MacThe Messages tab on the response side of the inspector
iPhone and iPadThe Messages tab, next to Overview and Timing
AndroidThe Messages tab of the request

Frames arrive live, in order, sent and received.

On the Mac, iPhone and iPad#

  • The header counts frames, sent, received and total bytes.
  • Filter by direction (All, Sent, Received) and by kind (All opcodes, Text, Binary, Control), and narrow by text with Search payloads.
  • The columns are Dir, Opcode, Length, Time, Δ (time since the previous frame) and Payload. A frame cut short at the capture limit is marked TRUNC.
  • Select a frame to read it. JSON opens in the same tree view as a response body.
  • Right-click a frame (long-press on iPhone and iPad) for Copy Payload, Copy Payload as Base64, Copy Opcode and Copy Timestamp.
  • The export button has Copy Selected Frame as JSONL and Copy Stream as JSONL. On the Mac it also has Export Stream as JSONL…, and Open Externally… opens a frame's payload in another app.

On Android#

The Messages tab lists frames with All, Sent and Received filters. Text payloads are shown as text, binary frames as their size.

Send your own#

On the Mac, the Compose window opens WebSocket sessions too: New Request ▸ New WebSocket. Enter the URL and an optional subprotocol, click Connect, then Send a text frame, Send Bytes from hex, send a file as a binary frame, or Ping. The frames appear in the same viewer. See Compose and repeat.

Decryption#

For wss://, the host has to be decrypted like any HTTPS host. See SSL Proxying. Until it is, the connection shows as a tunnel with its byte counts.

Scripting the upgrade#

On the Mac and on iPhone and iPad, a script can define onWebSocketHandshake to act on the upgrade request, for example to add or change a header before the connection is made. See Scripting.

From MCP#

On the Mac, list_websocket_sessions lists captured connections and get_websocket_messages reads their frames. See MCP for AI agents.

Something here is unclear, or wrong for your setup? Contact support or write to support@wirelens.app.