2023-02-23 01:53:21 +00:00
|
|
|
<!-- DO NOT EDIT | GENERATED CONTENT -->
|
|
|
|
|
2023-03-23 22:42:20 +00:00
|
|
|
# port-forward
|
2023-01-27 18:10:40 +00:00
|
|
|
|
2023-07-25 02:22:41 +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
|
|
|
|
2023-03-23 22:42:20 +00:00
|
|
|
Aliases:
|
|
|
|
|
|
|
|
- tunnel
|
|
|
|
|
2023-02-23 01:53:21 +00:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
```console
|
2023-03-23 22:42:20 +00:00
|
|
|
coder port-forward [flags] <workspace>
|
2023-01-27 18:10:40 +00:00
|
|
|
```
|
|
|
|
|
2023-03-23 22:42:20 +00:00
|
|
|
## Description
|
2023-01-27 18:10:40 +00:00
|
|
|
|
2023-02-23 01:53:21 +00:00
|
|
|
```console
|
2023-09-07 21:28:22 +00:00
|
|
|
- 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
|
|
|
|
2023-09-07 21:28:22 +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
|
2023-09-07 21:28:22 +00:00
|
|
|
machine:
|
2023-01-27 18:10:40 +00:00
|
|
|
|
2023-09-07 21:28:22 +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:
|
|
|
|
|
2023-09-07 21:28:22 +00:00
|
|
|
$ 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:
|
|
|
|
|
2023-09-07 21:28:22 +00:00
|
|
|
$ coder port-forward <workspace> --tcp 8080,9000:3000,9090-9092,10000-10002:10010-10012
|
2023-05-24 19:38:40 +00:00
|
|
|
|
|
|
|
- Port forward specifying the local address to bind to:
|
|
|
|
|
2023-09-07 21:28:22 +00:00
|
|
|
$ coder port-forward <workspace> --tcp 1.2.3.4:8080:8080
|
2023-01-27 18:10:40 +00:00
|
|
|
```
|
|
|
|
|
2023-03-23 22:42:20 +00:00
|
|
|
## Options
|
2023-01-27 18:10:40 +00:00
|
|
|
|
2023-03-23 22:42:20 +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
|
|
|
|
2023-03-23 22:42:20 +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.
|
2024-03-15 16:24:38 +00:00
|
|
|
|
|
|
|
### --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.
|