dots.v2.agents.sessions.bySession_id().portForward.byPort().get()
Generated on 5 Nov 2026
from DoTs version
v1.23.0
Usage
client.v2.agents.sessions.bySession_id(session_id).portForward.byPort(port).get(requestConfiguration?: RequestConfiguration<object>): Promise<undefined | ArrayBuffer>Description
Upgrades the request to a WebSocket and bridges it to one TCP connection on the session sandbox’s
guest port. Binary frames carry the opaque byte stream in both directions; the server closes with
a descriptive WebSocket close code when the tunnel ends. This is the raw TCP tunnel; browser clients
reaching the in-guest OpenHands Agent Server use the ingress URL
(GET /v2/agents/sessions/{session_id}/ingress), which has replaced this bridge for them.
WebSocket is not expressible in OpenAPI; this documents the GET that initiates the upgrade handshake
(HTTP 101 Switching Protocols). The handler dials the guest before upgrading, so a PAUSED session is
woken and served rather than rejected. port must be between 1024 and 65535. A request without the
WebSocket upgrade headers is answered 400 by the handshake layer.
Parameters
session_idstring requiredExample:
a1b2c3d4-e5f6-7890-abcd-ef1234567890The session UUID.
portinteger requiredExample:
8000The guest TCP port to connect to. Must be between 1024 and 65535.
Request Sample
More Information
See /v2/agents/sessions/{session_id}/port-forward/{port} in the API reference for additional detail on responses, headers, parameters, and more.