Files
coder/docs/cli/port-forward.md
Ammar Bandukwala dd97fe2bce chore(cli): replace lipgloss with coder/pretty (#9564)
This change will improve over CLI performance and "snappiness" as well as
substantially reduce our test times. Preliminary benchmarks show
`coder server --help` times cut from 300ms to 120ms on my dogfood
instance.

The inefficiency of lipgloss disproportionately impacts our system, as all help
text for every command is generated whenever any command is invoked.

The `pretty` API could clean up a lot of the code (e.g., by replacing
complex string concatenations with Printf), but this commit is too
expansive as is so that work will be done in a follow up.
2023-09-07 16:28:22 -05:00

1.6 KiB
Generated

port-forward

Forward ports from a workspace to the local machine. For reverse port forwarding, use "coder ssh -R".

Aliases:

  • tunnel

Usage

coder port-forward [flags] <workspace>

Description

  - Port forward a single TCP port from 1234 in the workspace to port 5678 on your
local machine:

     $ coder port-forward <workspace> --tcp 5678:1234

  - Port forward a single UDP port from port 9000 to port 9000 on your local
machine:

     $ coder port-forward <workspace> --udp 9000

  - Port forward multiple TCP ports and a UDP port:

     $ coder port-forward <workspace> --tcp 8080:8080 --tcp 9000:3000 --udp 5353:53

  - Port forward multiple ports (TCP or UDP) in condensed syntax:

     $ coder port-forward <workspace> --tcp 8080,9000:3000,9090-9092,10000-10002:10010-10012

  - Port forward specifying the local address to bind to:

     $ coder port-forward <workspace> --tcp 1.2.3.4:8080:8080

Options

-p, --tcp

Type string-array
Environment $CODER_PORT_FORWARD_TCP

Forward TCP port(s) from the workspace to the local machine.

--udp

Type string-array
Environment $CODER_PORT_FORWARD_UDP

Forward UDP port(s) from the workspace to the local machine. The UDP connection has TCP-like semantics to support stateful UDP protocols.