coder/docs/cli/port-forward.md

72 lines
2.0 KiB
Markdown
Raw Permalink Normal View History

2023-02-23 01:53:21 +00:00
<!-- DO NOT EDIT | GENERATED CONTENT -->
# port-forward
2023-01-27 18:10:40 +00:00
Forward ports from a workspace to the local machine. For reverse port forwarding, use "coder ssh -R".
2023-01-27 18:10:40 +00:00
Aliases:
- tunnel
2023-02-23 01:53:21 +00:00
## Usage
```console
coder port-forward [flags] <workspace>
2023-01-27 18:10:40 +00:00
```
## Description
2023-01-27 18:10:40 +00:00
2023-02-23 01:53:21 +00:00
```console
- Port forward a single TCP port from 1234 in the workspace to port 5678 on your
local machine:
2023-01-27 18:10:40 +00:00
$ coder port-forward <workspace> --tcp 5678:1234
2023-01-27 18:10:40 +00:00
- Port forward a single UDP port from port 9000 to port 9000 on your local
machine:
2023-01-27 18:10:40 +00:00
$ coder port-forward <workspace> --udp 9000
2023-01-27 18:10:40 +00: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 18:10:40 +00: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 18:10:40 +00:00
```
## Options
2023-01-27 18:10:40 +00:00
### -p, --tcp
| | |
| ----------- | ------------------------------------ |
| Type | <code>string-array</code> |
| Environment | <code>$CODER_PORT_FORWARD_TCP</code> |
2023-01-27 18:10:40 +00:00
2023-02-23 01:53:21 +00:00
Forward TCP port(s) from the workspace to the local machine.
2023-01-27 18:10:40 +00:00
2023-02-23 01:53:21 +00:00
### --udp
2023-01-27 18:10:40 +00:00
| | |
| ----------- | ------------------------------------ |
| Type | <code>string-array</code> |
| Environment | <code>$CODER_PORT_FORWARD_UDP</code> |
2023-02-23 01:53:21 +00: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.