websockets / ws

Simple to use, blazing fast and thoroughly tested WebSocket client and server for Node.js
MIT License
21.34k stars 2.3k forks source link

WebSocket Ping-Pong Timeout and Connection Closure Failure #2207

Closed kartikgupta2607 closed 3 months ago

kartikgupta2607 commented 3 months ago

Is there an existing issue for this?

Description

Our custom wrapper module built on top of ws handles connection events (ping, pong, errors, message, close) on both server and client sides.

Normal workflow involves:

Observed Issue:

Failure in Connection Closure:

Additional Request

Please let me know if you require additional details.

ws version

8.12.1

Node.js Version

Server (18.12.1), Client (14.18.1)

System

No response

Expected result

No response

Actual result

No response

Attachments

No response

netizen-ais commented 3 months ago

The failed pings should indicate network problems in either side, so the "closing handshake" can't complete (as it implies packets between both endpoints)

lpinca commented 3 months ago

Is there a way to identify if a connection is stuck on either the server or client side?

You can capture the traffic with something like tcpdump or Wireshark.

lpinca commented 3 months ago

I'm closing this as answered.