Title: [Feature Request] Intercepting hardcoded localhost WebSockets for HMR (.NET Hot Reload / dotnet watch) · Issue #7976 · coder/code-server · GitHub
Open Graph Title: [Feature Request] Intercepting hardcoded localhost WebSockets for HMR (.NET Hot Reload / dotnet watch) · Issue #7976 · coder/code-server
X Title: [Feature Request] Intercepting hardcoded localhost WebSockets for HMR (.NET Hot Reload / dotnet watch) · Issue #7976 · coder/code-server
Description: What is your suggestion? Implement a client-side interceptor or dynamic proxy mechanism within code-server's browser context that can catch outbound WebSocket requests to localhost:
Open Graph Description: What is your suggestion? Implement a client-side interceptor or dynamic proxy mechanism within code-server's browser context that can catch outbound WebSocket requests to localhost:
X Description: What is your suggestion? Implement a client-side interceptor or dynamic proxy mechanism within code-server's browser context that can catch outbound WebSocket requests to localhost:<port>...
Opengraph URL: https://github.com/coder/code-server/issues/7976
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Feature Request] Intercepting hardcoded localhost WebSockets for HMR (.NET Hot Reload / dotnet watch)","articleBody":"## What is your suggestion?\nImplement a client-side interceptor or dynamic proxy mechanism within `code-server`'s browser context that can catch outbound WebSocket requests to `localhost:\u003cport>` and seamlessly route them through `code-server`'s built-in proxy layer back to the remote workspace.\n\n## Why do you want this feature?\nDevelopers relying on `code-server` for a pure browser-based development experience cannot use .NET's Hot Reload (`dotnet watch`). \n\nWhen running `dotnet watch`, the .NET SDK dynamically injects a script (`aspnetcore-browser-refresh.js`) into the DOM that attempts to establish an HMR WebSocket connection to a random, ephemeral port on `localhost` (e.g., `ws://localhost:40777`). \n\nBecause the browser executes this locally, it queries the user's physical machine rather than the remote `code-server` container. The connection drops, and Hot Reload fails:\n`Firefox can’t establish a connection to the server at ws://localhost:40777/`\n\n\u003cimg width=\"1494\" height=\"211\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/491dde0f-e1ba-40fa-8d8a-06f236462bbb\" />\n\n```\nFirefox can’t establish a connection to the server at ws://localhost:43067/. aspnetcore-browser-refresh.js:318:25\nWebSocket failed to connect. aspnetcore-browser-refresh.js:19:15\nFirefox can’t establish a connection to the server at wss://localhost:33935/. aspnetcore-browser-refresh.js:318:25\nWebSocket failed to connect. aspnetcore-browser-refresh.js:19:15\nUnable to establish a connection to the browser refresh server. aspnetcore-browser-refresh.js:23:13\n```\n\n## Are there any workarounds to get this functionality today?\nThere are no workarounds for a **pure browser** workflow (e.g., coding on an iPad or a locked-down laptop without CLI access).\n\n## Are you interested in submitting a PR for this?\nNo, I do not have the familiarity with the `code-server` networking/proxy codebase to implement this reliably.","author":{"url":"https://github.com/akhanalcs","@type":"Person","name":"akhanalcs"},"datePublished":"2026-09-01T12:46:21Z","url":"https://github.com/coder/code-server/issues/7976"}
| 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:1bdbe55b-d444-7e82-e311-890072c78e4c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C7BE:11D4F:EB65:12DCE:6B042ED9 |
| html-safe-nonce | a7fbf9609f0edbd22aeda2f3e3e015da3305e5f831eea8439de2aa36e4555e2f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0JFOjExRDRGOkVCNjU6MTJEQ0U6NkIwNDJFRDkiLCJ2aXNpdG9yX2lkIjoiNDE3NDQ3NjAwMDc4NDY2Nzc3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e9a4f25ddaa2d20a4639c87f125c46bef7dc0df2664f5f6dec59fd180a40917b |
| hovercard-subject-tag | issue:5311994638 |
| 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/7976/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d84e44b18e1a36ffff4ad0bc8642b422647f0948cdc9878866a1c72a45c5e735/coder/code-server/issues/7976 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d84e44b18e1a36ffff4ad0bc8642b422647f0948cdc9878866a1c72a45c5e735/coder/code-server/issues/7976 |
| og:image:alt | What is your suggestion? Implement a client-side interceptor or dynamic proxy mechanism within code-server's browser context that can catch outbound WebSocket requests to localhost: |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | akhanalcs |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| 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 | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width