metarhia / jstp

Fast RPC for browser and Node.js based on TCP, WebSocket, and MDSF
https://metarhia.github.io/jstp
Other
142 stars 10 forks source link

ws,server: avoid forwarding 'clientError' event #392

Closed belochub closed 5 years ago

belochub commented 5 years ago

Avoid forwarding 'clientError' event on the WebSocket server as an 'error' event. That behavior was causing server crashes and could possibly lead to hanging HTTP connections.

aqrln commented 5 years ago

Do I understand it correctly that the only way to get clientError in our case is to receive a malformed WebSocket handshake (i.e., which is not a valid HTTP request)?

belochub commented 5 years ago

@aqrln, probably yes, I am not sure if that's the only way to get this event, though I still don't think that it is entirely correct to forward server's 'clientError' event as an 'error' event since it possibly leads to server crashes.

belochub commented 5 years ago

Landed in https://github.com/metarhia/jstp/commit/f2a756403a7ec9dea0ddf9672cc08b3a788b7a71.