Skip to main content
The ports channel reports which network ports are listening inside the workspace and lets you kill the process behind one. Port detection comes from a monitor sidecar in the VM, so you never poll. See the WebSocket overview for connecting.

Server to Client

snapshot

Sent on connect (and after a port refresh) with every currently-open port. Carries only port numbers.

change

A single port opened or closed. There is one message type with an action discriminator — no separate open/close types, and no PID or process name.

Killing a Process

kill (client to server)

Terminate the process on a port. The request requires a requestId so you can match the response.

killResponse (server to client)

The response type is killResponse and echoes the requestId.
Success
Failure

Preview URLs

Each open port is reachable through a public preview URL built from the workspace’s project ID prefix and its preview_token (returned by the connect handshake):
  • port — the listening port
  • projectIdPrefix — the first 8 hex characters of the project ID
  • previewToken — the 32-character lowercase alphanumeric preview_token
  • previewDomain — the configured preview domain
The token segment is required — preview URLs without a valid token are rejected.
The gateway resolves the workspace by project-ID prefix, validates the token against that workspace, and proxies both HTTP and WebSocket (HMR) traffic into the VM.

Example Flow