[Feature Request] Intercepting hardcoded localhost WebSockets for HMR (.NET Hot Reload / dotnet watch)
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 35/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript
- 領域
- devtools, networking
研究方向
該 payload 沒有提到任何 code-server 檔案或測試。首先追蹤瀏覽器內容對輸出的 localhost WebSockets 的處理方式以及內建 Proxy 層,然後檢查注入的 aspnetcore-browser-refresh.js 如何使用暫時性的 ws/wss 連接埠。完成後應該是一個純瀏覽器的 dotnet watch 工作流程,其中 Hot Reload 會透過 code-server 連線,且不會發生 localhost 錯誤。
由索引模型根據 Issue 內容生成。
描述
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> and seamlessly route them through code-server's built-in proxy layer back to the remote workspace.
Why do you want this feature?
Developers relying on code-server for a pure browser-based development experience cannot use .NET's Hot Reload (dotnet watch).
When 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).
Because 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:
Firefox can’t establish a connection to the server at ws://localhost:40777/
Firefox can’t establish a connection to the server at ws://localhost:43067/. aspnetcore-browser-refresh.js:318:25
WebSocket failed to connect. aspnetcore-browser-refresh.js:19:15
Firefox can’t establish a connection to the server at wss://localhost:33935/. aspnetcore-browser-refresh.js:318:25
WebSocket failed to connect. aspnetcore-browser-refresh.js:19:15
Unable to establish a connection to the browser refresh server. aspnetcore-browser-refresh.js:23:13
Are there any workarounds to get this functionality today?
There are no workarounds for a pure browser workflow (e.g., coding on an iPad or a locked-down laptop without CLI access).
Are you interested in submitting a PR for this?
No, I do not have the familiarity with the code-server networking/proxy codebase to implement this reliably.
- 主要語言
- TypeScript
- 星號
- 79.4k
- 分支
- 6.9k
- 平均合併
- 2 天 13 小時
- 30 天內合併 PR
- 39
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
coder/code-server 的其他 Issue
-
security
難度 2/5 1-3 小時 新手友好度 74/100
coder/code-server#8013 · 3 則留言 ·
-
enhancement
難度 5/5 一週以上 新手友好度 35/100
coder/code-server#7962 · 3 則留言 ·
-
bug needs-investigation
難度 4/5 3-5 天 新手友好度 55/100
coder/code-server#7955 · 1 則留言 ·
-
enhancement
難度 5/5 一週以上 新手友好度 42/100
coder/code-server#7948 · 1 則留言 · 2 個 reaction ·
-
bug code-server needs-investigation
難度 4/5 3-5 天 新手友好度 48/100
coder/code-server#7938 · 3 則留言 · 2 個 reaction ·
查看 coder/code-server 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
-
area:tools bug good first issue help wanted priority:P2
難度 2/5 1-3 小時 新手友好度 90/100
TaewoooPark/Motifcode#14 ·
-
bug
難度 2/5 1-3 小時 新手友好度 84/100
newrelic-experimental/preflight#793 · 1 則留言 ·
-
bug 🐞
難度 2/5 1-3 小時 新手友好度 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
BasedHardware/omi#15320 ·