Set a port

Preview. Make a port public, so that anyone with its URL opens it, or private again. A new connection sees the change within seconds, and an open one stays open.

PUT
/sandboxes/{sandbox_id}/ports/{port}

Authorization

headerAuthorizationBearer <token>

Your Munito API key.

Path Parameters

sandbox_id*string

The id of the sandbox.

port*integer

A TCP port in the sandbox.

Range1 <= value <= 65535

Request Body

application/json
  1. body
public*boolean

Open the port to anyone with its URL, or close it to all but the token and signed URLs.

Response Body

The port, public or private as asked.

application/json
  1. response
object?string
Default"sandbox.port"
sandbox_id*string
port*integer
public*boolean

Anyone with the URL opens the port. A private port takes the token or a signed URL.

url*string

The port's URL. A server that listens on the port, on 0.0.0.0 or 127.0.0.1, answers there.

token*string

The sandbox's token. Send it in the header munito-sandbox-token to open any of its ports. It lasts as long as the sandbox.

curl -X PUT 'https://api.munito.ai/sandboxes/v1/sandboxes/string/ports/1' \
  -H 'Content-Type: application/json' \
  -d '{
  "public": true
}'
Example Response
{
  "object": "sandbox.port",
  "sandbox_id": "string",
  "port": 0,
  "public": true,
  "url": "string",
  "token": "string"
}