bhatti ports
List the listening TCP ports detected inside a sandbox.
Synopsis
bhatti ports <sandbox>
Description
The host periodically scans each running sandbox for listening ports and caches them. bhatti ports reads that cache and prints one row per port. Each row also shows the path-based proxy URL — a developer convenience for hitting the port from the host without a domain or bhatti publish.
The proxy URL goes through the API server at <api>/sandboxes/<id>/proxy/<port>/.... It requires the same Bearer auth as any other API call — useful for poking at services during development. For public, auth-free URLs, use bhatti publish.
Cold sandboxes are not scanned (they have no listening processes by definition). To list ports for a sleeping sandbox, wake it first or just send a request that triggers a wake.
Examples
bhatti ports dev
PORT URL
3000 http://localhost:8080/sandboxes/dev/proxy/3000/
6379 http://localhost:8080/sandboxes/dev/proxy/6379/
# Quick test against a service inside the sandbox
bhatti ports dev --json | jq -r '.[] | .proxy_url' | head -1 | xargs curl -H "Authorization: Bearer $BHATTI_TOKEN"
Options
This command takes only global flags. See Global flags for --url, --token, --json, --timing, --data-dir.
See also
bhatti publish— public auth-free URL for a port- API:
GET /sandboxes/:id/ports - API:
ANY /sandboxes/:id/proxy/:port/*