Skip to content

chore: docs: add port-forwarding options (CLI & ssh) #3394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/ides.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,10 @@ Connection and connect to your Coder workspace.](./ides/configuring-gateway.md)
## Web IDEs (Jupyter, code-server, JetBrains Projector)

Web IDEs (code-server, JetBrains Projector, VNC, etc.) are defined in the template. See [configuring IDEs](./ides/configuring-web-ides.md).

## Port Forwarding

Port Forwarding lets developers securely access processes on their Coder
workspace from a local machine. A common use case is testing front-end
applications in a browser at `http://localhost:<yourforwardedport>` See
[configuring Port Forwarding](./ides/configuring-port-forwarding.md).
34 changes: 34 additions & 0 deletions docs/ides/configuring-port-forwarding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Configuring Port Forwarding

There are two ways to forward ports:

- The Coder CLI port-forward command
- SSH

## The Coder CLI and port-forward

For example:

```console
coder port-forward mycoderworkspacename --tcp 8000:8000
```

For more examples, type `coder port-forward --help`

## SSH

Use the Coder CLI to first [configure SSH](../ides.md#ssh-configuration) on your
local machine. Then run `ssh`. For example:

```console
ssh -L 8000:localhost:8000 coder.mycoderworkspacename
```

## Accessing the forwarded port

After completing either Port Forwarding method, open a web browser on your local
machine to access the Coder workspace process.

```console
http://localhost:<yourforwardedport>
```