Skip to main content

Port Forwarding

When an agent starts a web server, database, or any TCP service inside a sandbox, Caged automatically detects it and generates a public preview URL.

How It Works

  1. Caged scans /proc/net/tcp inside the sandbox every 2 seconds
  2. New listening ports are detected and registered
  3. HTTP ports get public preview URLs with HTTPS
  4. The proxy routes requests from the preview URL to the sandbox

Viewing Ports

CLI

API

Dashboard

The sandbox detail page shows all detected ports with clickable preview links.

Password Protection

Add a password to restrict access to a preview URL:
Visitors will be prompted for the password before accessing the preview.

Recognized HTTP Ports

These ports automatically get preview URLs: Other ports are detected but listed as tcp protocol without preview URLs.

Rate Limits

Preview URLs are rate-limited to 100 requests per minute per port. This protects against abuse and ensures fair resource usage.

HTTPS

All preview URLs use HTTPS with a wildcard certificate for *.preview.caged.dev. No configuration needed.

Limitations

  • Only TCP ports are detected (UDP is not scanned)
  • Ports bound to 127.0.0.1 inside the sandbox are still accessible via preview URLs (the proxy connects internally)
  • WebSocket connections are supported through the preview proxy
  • Maximum of 20 exposed ports per sandbox