You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
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
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
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
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
Be sure to replace `me@example.com` with your actual email.
At this point, you should be able to access code-server via
Expand DownExpand Up
@@ -292,7 +303,9 @@ redirect all HTTP requests to HTTPS.
> You can use [Let's Encrypt](https://letsencrypt.org/) to get a TLS certificate
> for free.
Note: if you set `proxy_set_header Host $host;` in your reverse proxy config, it will change the address displayed in the green section of code-server in the bottom left to show the correct address.
Note: if you set `proxy_set_header Host $host;` in your reverse proxy config, it
will change the address displayed in the green section of code-server in the
bottom left to show the correct address.
## Accessing web services
Expand DownExpand Up
@@ -378,14 +391,16 @@ PUBLIC_URL=/absproxy/3000 \
BROWSER=none yarn start
```
You should then be able to visit `https://my-code-server-address.io/absproxy/3000` to see your app exposed through
code-server!
You should then be able to visit
`https://my-code-server-address.io/absproxy/3000` to see your app exposed
through code-server.
> We highly recommend using the subdomain approach instead to avoid this class of issue.
### Proxying to a Vue app
Similar to the situation with React apps, you have to make a few modifications to proxy a Vue app.
Similar to the situation with React apps, you have to make a few modifications
to proxy a Vue app.
1. add `vue.config.js`
2. update the values to match this (you can use any free port):
Expand All
@@ -406,7 +421,8 @@ Read more about `publicPath` in the [Vue.js docs](https://cli.vuejs.org/config/#
### Proxying to an Angular app
In order to use code-server's built-in proxy with Angular, you need to make the following changes in your app:
In order to use code-server's built-in proxy with Angular, you need to make the
following changes in your app:
1. use `<base href="./.">` in `src/index.html`
2. add `--serve-path /absproxy/4200` to `ng serve` in your `package.json`
Expand All
@@ -415,7 +431,8 @@ For additional context, see [this GitHub Discussion](https://github.com/coder/co
### Proxying to a Svelte app
In order to use code-server's built-in proxy with Svelte, you need to make the following changes in your app:
In order to use code-server's built-in proxy with Svelte, you need to make the
following changes in your app:
1. Add `svelte.config.js` if you don't already have one
2. Update the values to match this (you can use any free port):
Expand All
@@ -436,9 +453,19 @@ For additional context, see [this Github Issue](https://github.com/sveltejs/kit/
### Prefixing `/absproxy/<port>` with a path
This is a case where you need to serve an application via `absproxy` as explained above while serving `codeserver` itself from a path other than the root in your domain.
This is a case where you need to serve an application via `absproxy` as
explained above while serving code-server itself from a path other than the root
in your domain.
For example: `http://my-code-server.com/user/123/workspace/my-app`. To achieve this result:
For example: `http://my-code-server.com/user/123/workspace/my-app`. To achieve
this result:
1. Start codeserver with the switch `--abs-proxy-base-path=/user/123/workspace`
1. Start code-server with the switch `--abs-proxy-base-path=/user/123/workspace`
2. Follow one of the instructions above for your framework.
### Preflight requests
By default, if you have auth enabled, code-server will authenticate all proxied
requests including preflight requests. This can cause issues because preflight
requests do not typically include credentials. To allow all preflight requests
through the proxy without authentication, use `--skip-auth-preflight`.
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.