http-shutdown icon indicating copy to clipboard operation
http-shutdown copied to clipboard

compatible with a Web Socket Server?

Open DetweilerRyan opened this issue 9 years ago • 3 comments

Although, I have not confirmed this with any tests, It seems to me that the shutdown method would prematurely close sockets on an http server used as the backend for a WebSocket server. It seems to me that the sockets that pass through the 'connection' event and never pass through the 'request' event because they are used in the WebSocket server will always be seen as idle and will be destroyed on shutdown even if the sockets are still being used by the WebSocket server.

DetweilerRyan avatar Aug 11 '16 19:08 DetweilerRyan

Yeah, I've never tried with a WS but I'd assume what you have that it probably doesn't work correctly.

thedillonb avatar Aug 11 '16 19:08 thedillonb

I ended up having to write something to handle WebSockets: https://github.com/MitMaro/node-server-shutdown

MitMaro avatar Dec 14 '16 15:12 MitMaro

Shouldn't a websocket be regarded similar to a keep-alive? Thus should not accept traffic post the close call?

karlpokus avatar Dec 11 '19 12:12 karlpokus