uNetworking / uWebSockets.js

μWebSockets for Node.js back-ends :metal:
Apache License 2.0
7.85k stars 570 forks source link

How to have the "req" in open event in the V18 #442

Closed Inateno closed 3 years ago

Inateno commented 3 years ago

Hey guys,

We just updated all the stack and dependencies and just saw that breaking change. We were using the req parameter to use the getUrl and getQuery functions, mostly to retrieve the token passed.

Without token or valid token the socket client was disconnected.

How can we achieve the same in a different way?

Many thanks o/

Inateno commented 3 years ago

Oh I guess from this example we now have to use upgrade separately in the process. https://github.com/uNetworking/uWebSockets.js/blob/master/examples/Upgrade.js

I try and if it doesn't works I'll open the issue again. (sorry I looked a lot before posting the issue ahah, I always find solution right after posting).