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 itspreview_token (returned by the connect handshake):
port— the listening portprojectIdPrefix— the first 8 hex characters of the project IDpreviewToken— the 32-character lowercase alphanumericpreview_tokenpreviewDomain— the configured preview domain