WebSocket connections timing out - TCP_OVERWIN errors in Network Flow Logs
wilo1
PROOP

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_OVERWIN errors
  • Socket disconnects with ping timeout and transport close on 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.

$20 Bounty

4 Replies

Railway
BOT

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


Try deploying in a different region (eg, US East).


wilo1
PROOP

15 days ago

I tried that. It did not resolve it.


wilo1

I tried that. It did not resolve it.

wilo1
PROOP

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_OVERWIN errors
  • Socket disconnects with transport close on ALL clients including mobile on different networks
  • server.keepAliveTimeout = 60000 and pingInterval: 10000 are 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.


tnewaz84
FREE

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.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...