Share feedback
Answers are generated based on the documentation.

sbx ports

DescriptionManage sandbox port publishing
Usagesbx ports SANDBOX [flags]

Description

Manage sandbox port publishing.

List, publish, or unpublish ports for a running sandbox. Without --publish or --unpublish flags, lists all published ports.

Port spec format: [[HOST_IP:]HOST_PORT:]SANDBOX_PORT[/PROTOCOL] If HOST_PORT is omitted, an ephemeral port is allocated automatically. If HOST_IP is omitted, the port is bound on loopback, expanded based on PROTOCOL and the sandbox's address families: tcp/udp binds both 127.0.0.1 and ::1 (or only 127.0.0.1 if the sandbox is IPv4-only); tcp4/udp4 binds only 127.0.0.1; tcp6/udp6 binds only ::1. PROTOCOL defaults to tcp. Supported protocols: tcp, tcp4, tcp6, udp, udp4, udp6.

Options

OptionDefaultDescription
--jsonOutput in JSON format (for port listing)
--publishPublish a port (can be repeated): [[HOST_IP:]HOST_PORT:]SANDBOX_PORT[/PROTOCOL]
--unpublishUnpublish a port (can be repeated): [HOST_IP:]HOST_PORT:SANDBOX_PORT[/PROTOCOL]

Global options

OptionDefaultDescription
-D, --debugEnable debug logging

Examples

# List published ports
sbx ports my-sandbox

# Publish sandbox port 8080 to an ephemeral host port
sbx ports my-sandbox --publish 8080

# Publish with a specific host port
sbx ports my-sandbox --publish 3000:8080

# Unpublish a port
sbx ports my-sandbox --unpublish 3000:8080