The workspace
Ports
What is listening inside the sandbox, and forwarding one out
On this page(3 sections)
The ports something is answering on, and giving one an address on the outside or taking that away.
GET/portsWhat is listening inside the sandbox
Every port something is answering on, and whether each one is reachable from outside.
What you send
Nothing. Call it as it is.
What comes back
| Field | Type |
|---|---|
portsEverything listening inside the sandbox right… | object[] |
portThe port number | number |
hostWhich loopback address it actually answers… | "127.0.0.1" | "::1" |
forwardableWhether it can be exposed at… | boolean |
kindWhether somebody's own work put it… | "workspace" | "system" |
titleWhat a person would call it | string |
purposeOne sentence about what it is… | string |
originWho put it there, which is… | "terminal" | "agent" | "panel" | "extension" … (7) |
pidThe process holding it | number |
commandThe command behind it, as it… | string |
cwdWhere it is running from, which… | string |
sessionThe terminal it came from, to… | string |
forwardedWhether it is currently reachable from… | boolean |
previewUrlWhere to open it | string |
answered in this tab
curl "$SANDBOX/ports" \
-H "x-intentic-control: $INTENTIC_TOKEN"import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.ports.list();POST/ports/forwardMake a port reachable
Gives one port an address on the outside. Asking twice is harmless: the second call hands back the address the first one made.
What you send
| Field | Type | Where |
|---|---|---|
portrequiredWhich port | integer | body |
What comes back
| Field | Type |
|---|---|
previewUrlWhere it can now be reached | string |
answered in this tab
curl -X POST "$SANDBOX/ports/forward" \
-H "x-intentic-control: $INTENTIC_TOKEN" \
-H "content-type: application/json" \
-d '{"port":5173}'import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.ports.forward({
"port": 5173
});POST/ports/unforwardStop exposing a port
Frees the slot at once. The address keeps resolving; it simply stops leading anywhere.
What you send
| Field | Type | Where |
|---|---|---|
portrequiredWhich port | integer | body |
What comes back
| Field | Type |
|---|---|
okAlways true | true |
answered in this tab
curl -X POST "$SANDBOX/ports/unforward" \
-H "x-intentic-control: $INTENTIC_TOKEN" \
-H "content-type: application/json" \
-d '{"port":5173}'import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.ports.unforward({
"port": 5173
});More in The workspace