|
14 | 14 | - [Accessing web services](#accessing-web-services)
|
15 | 15 | - [Using a subdomain](#using-a-subdomain)
|
16 | 16 | - [Using a subpath](#using-a-subpath)
|
| 17 | + - [Using your own proxy](#using-your-own-proxy) |
17 | 18 | - [Stripping `/proxy/<port>` from the request path](#stripping-proxyport-from-the-request-path)
|
18 | 19 | - [Proxying to create a React app](#proxying-to-create-a-react-app)
|
19 | 20 | - [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:
|
316 | 317 | code-server --proxy-domain <domain>
|
317 | 318 | ```
|
318 | 319 |
|
319 |
| -Now you can browse to `<port>.<domain>`. Note that this uses the host header, so |
320 |
| -ensure your reverse proxy (if you're using one) forwards that information. |
| 320 | +For instance, if you have code-server exposed on `domain.tld` and a Python |
| 321 | +server running on port 8080 of the same machine code-server is running on, you |
| 322 | +could run code-server with `--proxy-domain domain.tld` and access the Python |
| 323 | +server via `8080.domain.tld`. |
| 324 | + |
| 325 | +Note that this uses the host header, so ensure your reverse proxy (if you're |
| 326 | +using one) forwards that information. |
321 | 327 |
|
322 | 328 | ### Using a subpath
|
323 | 329 |
|
324 |
| -Simply browse to `/proxy/<port>/`. |
| 330 | +Simply browse to `/proxy/<port>/`. For instance, if you have code-server |
| 331 | +exposed on `domain.tld` and a Python server running on port 8080 of the same |
| 332 | +machine code-server is running on, you could access the Python server via |
| 333 | +`domain.tld/proxy/8000`. |
| 334 | + |
| 335 | +### Using your own proxy |
| 336 | + |
| 337 | +You can make extensions and the ports panel use your own proxy by setting |
| 338 | +`VSCODE_PROXY_URI`. For example if you set |
| 339 | +`VSCODE_PROXY_URI=https://{{port}}.kyle.dev` when an application is detected |
| 340 | +running on port 3000 of the same machine code-server is running on the ports |
| 341 | +panel will create a link to https://3000.kyle.dev instead of pointing to the |
| 342 | +built-in subpath-based proxy. |
| 343 | + |
| 344 | +Note: relative paths are also supported i.e. |
| 345 | +`VSCODE_PROXY_URI=./proxy/{{port}}` |
325 | 346 |
|
326 | 347 | ### Stripping `/proxy/<port>` from the request path
|
327 | 348 |
|
|
0 commit comments