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_id string required

Example: a1b2c3d4-e5f6-7890-abcd-ef1234567890

The session UUID.

port integer required

Example: 8000

The guest TCP port to connect to. Must be between 1024 and 65535.

Min: 1024

Max: 65535

Request Sample

Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

const response = await client.v2.agents.sessions
    .bySession_id("a1b2c3d4-e5f6-7890-abcd-ef1234567890").portForward
    .byPort(8000).get();

More Information

See /v2/agents/sessions/{session_id}/port-forward/{port} in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.