You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seemes that express@4 and express@3 does not fire upgrade event when client WebSocket requests it. Here's the code. Let's first try to use std http module:
This works. Server logs upgrade event, client does not throw any errors. Now, let's replace http with express. Here's the analogous code with required adaptations:
The client is the same. This code does not work: server does not fire event, and client throws handshake error.
I'm trying to integrate express with ws module. It can use express instance and relies on upgrade event. I've logged through its code, and looks like error somewhere on express side. Or maybe I don't understand express API properly. Anyway, I'm looking for help.
The text was updated successfully, but these errors were encountered:
It seemes that express@4 and express@3 does not fire
upgrade
event when client WebSocket requests it. Here's the code. Let's first try to use stdhttp
module:On client:
This works. Server logs
upgrade
event, client does not throw any errors. Now, let's replacehttp
withexpress
. Here's the analogous code with required adaptations:The client is the same. This code does not work: server does not fire event, and client throws handshake error.
I'm trying to integrate express with ws module. It can use express instance and relies on
upgrade
event. I've logged through its code, and looks like error somewhere on express side. Or maybe I don't understand express API properly. Anyway, I'm looking for help.The text was updated successfully, but these errors were encountered: