From c171318778f837ba59fbaa933b8cdd4f5de55dc4 Mon Sep 17 00:00:00 2001 From: Mark Milligan Date: Sat, 6 Aug 2022 09:59:08 -0500 Subject: [PATCH 1/2] chore: docs: add port-forwarding options --- docs/ides.md | 7 +++++ docs/ides/configuring-port-forwarding.md | 34 ++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 docs/ides/configuring-port-forwarding.md diff --git a/docs/ides.md b/docs/ides.md index 9fd570db940be..59cfb970fae6c 100644 --- a/docs/ides.md +++ b/docs/ides.md @@ -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:` See +[configuring Port Forwarding](./ides/configuring-port-forwarding.md). diff --git a/docs/ides/configuring-port-forwarding.md b/docs/ides/configuring-port-forwarding.md new file mode 100644 index 0000000000000..497c431915af0 --- /dev/null +++ b/docs/ides/configuring-port-forwarding.md @@ -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: + +```hcl +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: + +```hcl +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. + +```hcl +http://localhost: +``` \ No newline at end of file From 2b7330be01bc9bca1af6d6b25035a7d0684e3226 Mon Sep 17 00:00:00 2001 From: Eric Paulsen Date: Sun, 7 Aug 2022 17:15:18 -0400 Subject: [PATCH 2/2] fix: code type --- docs/ides/configuring-port-forwarding.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/ides/configuring-port-forwarding.md b/docs/ides/configuring-port-forwarding.md index 497c431915af0..bda25b1f97554 100644 --- a/docs/ides/configuring-port-forwarding.md +++ b/docs/ides/configuring-port-forwarding.md @@ -9,7 +9,7 @@ There are two ways to forward ports: For example: -```hcl +```console coder port-forward mycoderworkspacename --tcp 8000:8000 ``` @@ -20,7 +20,7 @@ For more examples, type `coder port-forward --help` Use the Coder CLI to first [configure SSH](../ides.md#ssh-configuration) on your local machine. Then run `ssh`. For example: -```hcl +```console ssh -L 8000:localhost:8000 coder.mycoderworkspacename ``` @@ -29,6 +29,6 @@ ssh -L 8000:localhost:8000 coder.mycoderworkspacename After completing either Port Forwarding method, open a web browser on your local machine to access the Coder workspace process. -```hcl +```console http://localhost: -``` \ No newline at end of file +```