15 days ago
My Node.js/Socket.io app has been experiencing WebSocket connection failures since May 6, 2026.
Symptoms:
/socket.io/HTTP requests time out at exactly 45 seconds returning 0 bytes- Network Flow Logs show repeated
TCP_OVERWINerrors - Socket disconnects with
ping timeoutandtransport closeon all clients - Affects all browsers and mobile devices on different networks
- Service is US West region
What I've tried:
- Multiple redeployments
- Removed pingTimeout configuration
- Reverted all code changes to known-good state
- Cleared all caches
The service was working perfectly until May 6, 2026 after multiple rapid redeploys during a debugging session.
4 Replies
15 days ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open Railway • 15 days ago
15 days ago
I tried that. It did not resolve it.
wilo1
I tried that. It did not resolve it.
15 days ago
I already moved to US East (Virginia) and the issue persists. The specific symptoms are:
/socket.io/HTTP requests timeout at exactly 45 seconds returning 0 bytes in HTTP logs- Network Flow Logs show repeated
TCP_OVERWINerrors - Socket disconnects with
transport closeon ALL clients including mobile on different networks server.keepAliveTimeout = 60000andpingInterval: 10000are set but issue persists
Can you tell me the exact idle timeout value configured on your proxy/load balancer for WebSocket connections? I need to set my pingInterval below that threshold.
15 days ago
### 1. Disable WebSocket Compression (Server-Side)
To prevent proxy-level windowing errors (such as TCP_OVERWIN), you need to explicitly disable the perMessageDeflate option in your Node.js server configuration.
```javascript
// Server-side (index.js / server.js)
const io = new Server(httpServer, {
cors: {
origin: "*",
},
// Critical fix for TCP_OVERWIN issues on Railway
perMessageDeflate: false
});
```
### 2. Force WebSocket Transport (Client-Side)
You can bypass the HTTP long-polling phase—which is prone to 0-byte hangs when the proxy desynchronizes—by forcing a direct WebSocket connection from the client.
```javascript
// Client-side
const socket = io("https://your-service.up.railway.app", {
transports: ["websocket"], // Skip polling entirely
upgrade: false
});
```
### 3. Verify Environment Stability
If the connection issues persist, review your environment configuration in the Railway Dashboard:
* TCP Proxy Configuration: Navigate to Railway Dashboard > Settings > Variables and ensure you haven't manually enabled a TCP Proxy if your application only requires standard HTTP.
* Sticky Sessions: If you are running multiple replicas, you must enable Sticky Sessions in your Railway service settings to maintain Socket.io state consistency across instances.