Title: [Bug]: /proxy/
Open Graph Title: [Bug]: /proxy/
X Title: [Bug]: /proxy/
Description: Is there an existing issue for this? I have searched the existing issues OS/Web Information Web Browser: not needed, reproduced with the unit tests Local OS: Windows 11 Remote OS: Windows 11 Remote Architecture: x64 code-server --version...
Open Graph Description: Is there an existing issue for this? I have searched the existing issues OS/Web Information Web Browser: not needed, reproduced with the unit tests Local OS: Windows 11 Remote OS: Windows 11 Remote...
X Description: Is there an existing issue for this? I have searched the existing issues OS/Web Information Web Browser: not needed, reproduced with the unit tests Local OS: Windows 11 Remote OS: Windows 11 Remote...
Opengraph URL: https://github.com/coder/code-server/issues/8122
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: /proxy/\u003cport>/ proxies every request to / on Windows","articleBody":"### Is there an existing issue for this?\n\n- [x] I have searched the existing issues\n\n### OS/Web Information\n\n- Web Browser: not needed, reproduced with the unit tests\n- Local OS: Windows 11\n- Remote OS: Windows 11\n- Remote Architecture: x64\n- `code-server --version`: `main` at 568a58f\n\n### Steps to Reproduce\n\n1. On Windows, install the dependencies (`npm ci` in the root and in `test/`).\n2. Run the proxy unit tests: `test/node_modules/.bin/jest --testRegex \"./test/unit/.*ts\" test/unit/node/proxy.test.ts`. They start code-server's HTTP server and send requests through `/proxy/\u003cport>/...` to a local server.\n\n### Expected\n\n`/proxy/\u003cport>/\u003cpath>` requests reach `\u003cpath>` on the local port, as they do on Linux and macOS, and all 19 tests pass.\n\n### Actual\n\n9 of the 19 tests fail, for example `should rewrite the base path`:\n\n```\nExpected: 200\nReceived: 404\n```\n\n`src/node/routes/pathProxy.ts` computes the base path that it strips from the request with:\n\n```ts\n;(req as any).base = req.path.split(path.sep).slice(0, 3).join(path.sep)\n```\n\n`path.sep` is `\\` on Windows, but URL paths always use `/`, so the split returns the whole path and the whole path becomes the base. A request for `/proxy/3000/hello` is then proxied to `/` on port 3000 (only the query string is kept), and a redirect from the proxied app to `/login` is rewritten to `/proxy/3000/hello/login`. Web socket requests through `/proxy/\u003cport>/` take the same path.\n\n### Logs\n\nNot applicable.\n\n### Screenshot/Video\n\n_No response_\n\n### Does this bug reproduce in native VS Code?\n\nThis cannot be tested in native VS Code\n\n### Does this bug reproduce in VS Code web?\n\nThis cannot be tested in VS Code web\n\n### Does this bug reproduce in GitHub Codespaces?\n\nThis cannot be tested in GitHub Codespaces\n\n### Are you accessing code-server over a secure context?\n\n- [ ] I am using a secure context.\n\n### Notes\n\nThe fix is to split the request path on `/`. I am opening a PR with the fix and a test.\n\nAI-assisted: found and reproduced with an AI coding agent; the tests above were run locally.\n","author":{"url":"https://github.com/adityajai119","@type":"Person","name":"adityajai119"},"datePublished":"2026-11-12T17:45:46Z","url":"https://github.com/coder/code-server/issues/8122"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:11390aaf-e9e4-b1a2-c165-cb460a11a2b4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 90D6:2F9718:2B02016:39B5162:6B01D4D4 |
| html-safe-nonce | 8ada3b067734723f29612de6bc8d96fe2c64cf032265dc91a098ee36ea8be51a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MEQ2OjJGOTcxODoyQjAyMDE2OjM5QjUxNjI6NkIwMUQ0RDQiLCJ2aXNpdG9yX2lkIjoiMTYzMDc4NjAwNTkxMTA2NTgxMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | eab072e5f52cb4e29538ca7d129a655eed567b598e777c34b54fff9d20eb57a6 |
| hovercard-subject-tag | issue:6355685465 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/code-server/8122/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e9f94db523cec6a2d65d78a037247d6c2f6753e16a8b5e3ed494e6746479ef84/coder/code-server/issues/8122 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e9f94db523cec6a2d65d78a037247d6c2f6753e16a8b5e3ed494e6746479ef84/coder/code-server/issues/8122 |
| og:image:alt | Is there an existing issue for this? I have searched the existing issues OS/Web Information Web Browser: not needed, reproduced with the unit tests Local OS: Windows 11 Remote OS: Windows 11 Remote... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | adityajai119 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/code-server git https://github.com/coder/code-server.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 172953845 |
| octolytics-dimension-repository_nwo | coder/code-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 172953845 |
| octolytics-dimension-repository_network_root_nwo | coder/code-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width