Skip to content

Commit

Permalink
Fix inactive client reaping
Browse files Browse the repository at this point in the history
wss.clients is a Set rather than an Array after ws 2.x
websockets/ws#934
  • Loading branch information
nickbrowne committed Jan 28, 2025
1 parent 958ea58 commit 1277b56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/websocket.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ exports.attach = (server, createAgent, options) ->
# event, the client would have already established a new connection by the time
# the server terminates it from it's side.
setInterval ->
for client in wss.clients
for client in Array.from(wss.clients)
client.terminate() if !client.isAlive
client.isAlive = false
, CLIENT_TIMEOUT

0 comments on commit 1277b56

Please sign in to comment.