-
Notifications
You must be signed in to change notification settings - Fork 6.3k
docs: add port-forwarding #5979
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
+24
−3
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
985212d
docs: add port-forwarding
jsjoeio a637e75
fixup: formatting
jsjoeio b2e683c
Update docs/guide.md
jsjoeio 077ad34
docs: clean up based on feedback
jsjoeio c10d0cb
docs: add relative paths paragraph
jsjoeio cdb2934
Remove dupe paragraph and fill paragraph
code-asher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
- [Accessing web services](#accessing-web-services) | ||
- [Using a subdomain](#using-a-subdomain) | ||
- [Using a subpath](#using-a-subpath) | ||
- [Using your own proxy](#using-your-own-proxy) | ||
- [Stripping `/proxy/<port>` from the request path](#stripping-proxyport-from-the-request-path) | ||
- [Proxying to create a React app](#proxying-to-create-a-react-app) | ||
- [Proxying to a Vue app](#proxying-to-a-vue-app) | ||
|
@@ -316,12 +317,32 @@ To set your domain, start code-server with the `--proxy-domain` flag: | |
code-server --proxy-domain <domain> | ||
``` | ||
|
||
Now you can browse to `<port>.<domain>`. Note that this uses the host header, so | ||
ensure your reverse proxy (if you're using one) forwards that information. | ||
For instance, if you have code-server exposed on `domain.tld` and a Python | ||
server running on port 8080 of the same machine code-server is running on, you | ||
could run code-server with `--proxy-domain domain.tld` and access the Python | ||
server via `8080.domain.tld`. | ||
|
||
Note that this uses the host header, so ensure your reverse proxy (if you're | ||
using one) forwards that information. | ||
|
||
### Using a subpath | ||
|
||
Simply browse to `/proxy/<port>/`. | ||
Simply browse to `/proxy/<port>/`. For instance, if you have code-server | ||
exposed on `domain.tld` and a Python server running on port 8080 of the same | ||
machine code-server is running on, you could access the Python server via | ||
`domain.tld/proxy/8000`. | ||
|
||
### Using your own proxy | ||
|
||
You can make extensions and the ports panel use your own proxy by setting | ||
`VSCODE_PROXY_URI`. For example if you set | ||
`VSCODE_PROXY_URI=https://{{port}}.kyle.dev` when an application is detected | ||
|
||
running on port 3000 of the same machine code-server is running on the ports | ||
panel will create a link to https://3000.kyle.dev instead of pointing to the | ||
built-in subpath-based proxy. | ||
|
||
Note: relative paths are also supported i.e. | ||
`VSCODE_PROXY_URI=./proxy/{{port}}` | ||
|
||
### Stripping `/proxy/<port>` from the request path | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.