Skip to Content
CLI & APICommand reference

stackblaze proxy

Forward a local port to one of the app's ports through a private tunnel (default - a free local port → the app's http port)

Usage: stackblaze proxy|port-forward [options] [local:remote]

Forward a local port to one of the app's ports through a private tunnel
(default: a free local port → the app's http port)

Options:
  --api-url <url>       StackBlaze API base URL (env STACKBLAZE_API_URL)
  --token <token>       API token, sb_pat_... (env STACKBLAZE_TOKEN)
  -p, --project <name>  Project name
  -e, --env <name>      Environment name (default: production)
  -a, --app <name>      App name
  -h, --help            Print help

Port spec:
  stackblaze proxy                 free local port → the app's http port
  stackblaze proxy 8080:3000       127.0.0.1:8080 → app port 3000
  stackblaze proxy 3000            same port on both sides
  stackblaze proxy :2222           free local port → app port 2222 (an extra TCP port)

Only the ports the app's own Service exposes are reachable: its http port
(the container port works as an alias) and any extra ports it declares; a
wrong port is refused with the allowed list. Each local TCP connection is
carried over an authenticated WebSocket to the StackBlaze API, which
port-forwards it to a ready pod of the app — nothing is exposed publicly. It
listens on 127.0.0.1 only, closes after 30 minutes idle, and Ctrl-C closes it.
Requires app write access and Console enabled for your organization
(Platform → Console & SSH), like `ssh`.

Example

Reach the app's port 8080 on 127.0.0.1:8080 without exposing it publicly, then call it from a second terminal.

stackblaze proxy 8080:8080 -p github-demo-cw8z -e dev -a hello-web-qw6y
Forwarding 127.0.0.1:8080 → hello-web-qw6y:8080  [github-demo-cw8z/dev]
  URL:  http://127.0.0.1:8080
Press Ctrl-C to close.
curl -sS -I http://127.0.0.1:8080/ | head -3
HTTP/1.1 200 OK
Server: nginx/1.27.3
Date: Wed, 25 Nov 2026 14:48:26 GMT

On this page