Files
coder/docs/reference/cli/port-forward.md
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
2.0 KiB
Markdown
Raw Normal View History

2023-02-22 19:53:21 -06:00
<!-- DO NOT EDIT | GENERATED CONTENT -->
2023-03-23 17:42:20 -05:00
# port-forward
2023-01-27 15:10:40 -03:00
2023-07-24 21:22:41 -05:00
Forward ports from a workspace to the local machine. For reverse port forwarding, use "coder ssh -R".
2023-01-27 15:10:40 -03:00
2023-03-23 17:42:20 -05:00
Aliases:
* tunnel
2023-03-23 17:42:20 -05:00
2023-02-22 19:53:21 -06:00
## Usage
```console
2023-03-23 17:42:20 -05:00
coder port-forward [flags] <workspace>
2023-01-27 15:10:40 -03:00
```
2023-03-23 17:42:20 -05:00
## Description
2023-01-27 15:10:40 -03:00
2023-02-22 19:53:21 -06:00
```console
- Port forward a single TCP port from 1234 in the workspace to port 5678 on your
local machine:
2023-01-27 15:10:40 -03:00
$ coder port-forward <workspace> --tcp 5678:1234
2023-01-27 15:10:40 -03:00
- Port forward a single UDP port from port 9000 to port 9000 on your local
machine:
2023-01-27 15:10:40 -03:00
$ coder port-forward <workspace> --udp 9000
2023-01-27 15:10:40 -03:00
- Port forward multiple TCP ports and a UDP port:
$ coder port-forward <workspace> --tcp 8080:8080 --tcp 9000:3000 --udp 5353:53
2023-01-27 15:10:40 -03:00
- 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
2023-01-27 15:10:40 -03:00
```
2023-03-23 17:42:20 -05:00
## Options
2023-01-27 15:10:40 -03:00
2023-03-23 17:42:20 -05:00
### -p, --tcp
| | |
|-------------|--------------------------------------|
2023-03-23 17:42:20 -05:00
| Type | <code>string-array</code> |
| Environment | <code>$CODER_PORT_FORWARD_TCP</code> |
2023-01-27 15:10:40 -03:00
2023-02-22 19:53:21 -06:00
Forward TCP port(s) from the workspace to the local machine.
2023-01-27 15:10:40 -03:00
2023-02-22 19:53:21 -06:00
### --udp
2023-01-27 15:10:40 -03:00
2023-03-23 17:42:20 -05:00
| | |
|-------------|--------------------------------------|
2023-03-23 17:42:20 -05:00
| Type | <code>string-array</code> |
| Environment | <code>$CODER_PORT_FORWARD_UDP</code> |
2023-02-22 19:53:21 -06:00
Forward UDP port(s) from the workspace to the local machine. The UDP connection has TCP-like semantics to support stateful UDP protocols.
### --disable-autostart
| | |
|-------------|-------------------------------------------|
| Type | <code>bool</code> |
| Environment | <code>$CODER_SSH_DISABLE_AUTOSTART</code> |
| Default | <code>false</code> |
Disable starting the workspace automatically when connecting via SSH.