Files
bun.sh/test/js
Claude Bot d493ce511f Fix WebSocket upgrade hanging - enable streaming for upgrade sockets
This fixes the WebSocket hanging issue where clients would never
receive the upgrade response from the server. The problem was that
upgrade sockets weren't configured for streaming, so writes to the
socket wouldn't actually send data.

Changes:
- Added socket[kEnableStreaming](true) before emitting "upgrade" event
- This enables handle.ondrain which allows socket writes to work properly
- Previously, socket.write() would return true but bytesWritten stayed 0

The fix matches the pattern used for CONNECT method (line 548) where
streaming is already enabled.

Added comprehensive test in http-websocket-upgrade.test.ts that:
- Creates an HTTP server with upgrade handler
- Sends WebSocket upgrade request
- Verifies client receives "101 Switching Protocols" response
- Test passes with fix, times out without fix

This resolves the code-server WebSocket hanging issue where the
WebSocket would connect but never send/receive messages.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 23:31:01 +00:00
..