pydo.harness.get_session_port_forward()
Generated on 13 Nov 2026
from pydo version
v0.46.0
Usage
client.harness.get_session_port_forward(
session_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
port=8000,
)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.
More Information
See /v2/agents/sessions/{session_id}/port-forward/{port} in the API reference for additional detail on responses, headers, parameters, and more.