Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
OS/Web Information
- Web Browser: Brave
- Local OS: Windows 11
- Remote OS: Ubuntu 22.04
- Remote Architecture: amd64
code-server --version
: 4.11.0
Steps to Reproduce
- run code-server --proxy-domain example.com
- run a web service e.g fastapi. on port 8000
- reload browser tab for code-server
Expected
Code server in browser should reload quickly
INFO Creating a socket (...) was successful after 250 ms
This step in the browser console completes ~250ms if code server started without proxy domain.
Actual
Blank screen in browser while code server reloads
INFO Creating a socket (...) was successful after 112877 ms
This step takes much longer than usual.
During this time, the web service is running at 8000.example.com and responsive.
Logs
The following error is seen:
[14:49:04] TypeError: res.writeHead is not a function
at ProxyServer.<anonymous> (/usr/lib/code-server/out/node/proxy.js:11:9)
at ProxyServer.emit (/usr/lib/code-server/node_modules/eventemitter3/index.js:204:33)
at ClientRequest.onOutgoingError (/usr/lib/code-server/node_modules/http-proxy/lib/http-proxy/passes/ws-incoming.js:157:16)
at ClientRequest.emit (node:events:513:28)
at Socket.socketErrorListener (node:_http_client:494:9)
at Socket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Screenshot/Video
No response
Does this issue happen in VS Code or GitHub Codespaces?
- I cannot reproduce this in VS Code.
- I cannot reproduce this in GitHub Codespaces.
Are you accessing code-server over HTTPS?
- I am using HTTPS.
Notes
No response