-
In the latest update the |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
It's not req.end it is res.end. So yes you can do res.end or res.close while checking headers in upgrade handler |
Beta Was this translation helpful? Give feedback.
-
Also it's not correct that you could immediately close the connection before. You only had ws and req so the http response had already been sent. There are examples for this https://github.com/uNetworking/uWebSockets.js/blob/master/examples/Upgrade.js |
Beta Was this translation helpful? Give feedback.
-
Oops, you are right there were a couple of mistakes in my question.
Now about the
is a little better, but it causes Is there a way for server to say "pls go away I don't want to connect with you" which is expected by the client? |
Beta Was this translation helpful? Give feedback.
-
I don't think so. That's something you have to handle on the client side. |
Beta Was this translation helpful? Give feedback.
-
If you want to send a code/reason and prevent the error you have to do it in the open handler with |
Beta Was this translation helpful? Give feedback.
It's not req.end it is res.end.
So yes you can do res.end or res.close while checking headers in upgrade handler