Skip to main content

lium port-forward

Forward a local port to one of a pod's exposed ports. The CLI listens on 127.0.0.1 and relays each connection over plain TCP to the public port the pod maps for that internal port. It does not use SSH and adds no encryption, so the internal port must be one the pod exposes (lium describe lists them).

lium port-forward TARGET PORT [OPTIONS]

Arguments​

  • TARGET — Pod name, huid or index from lium ps.
  • PORT — Internal pod port to forward to. It must be in the pod's port mapping.

Options​

FlagEffect
-l, --local-port PORTLocal port to bind (default: same as the internal port)

Examples​

lium port-forward my-pod 8888 # localhost:8888 -> pod port 8888
lium port-forward my-pod 8888 -l 9000 # localhost:9000 -> pod port 8888
lium port-forward 1 22 -l 2222 # pod's SSH port on local port 2222

The forward stays open until you Ctrl-C.

A port the pod does not expose fails with port_not_exposed (exit 1) and lists the internal ports it does expose. To reach any other port, use an SSH tunnel: ssh -L 8888:localhost:8888 <the pod's ssh command>. A pod that is not running fails with pod_not_running, and a local port already in use with port_bind_failed (both exit 1).

See also​