-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make WebSocketServer#handleUpgrade()
callback optional
#1968
Conversation
If the upgrade is successful and the `callback` argument is not provided, then emit the `'connection'` event. Refs: #1966
I don't like this because the method behavior depends on the |
Works for me! 😃 This implementation is better but deeper. I as "external" contributor was striving for minimal code impact with my approach. |
https://github.com/websockets/ws/blob/5b87c5191ddbdae974f553fa841270b7919ae10c/test/handleupgrade-default-cb.test.js this is a test case I've forgotten in my firts commit in my PR. You can use it to test your implementation also |
It's already covered by this change Line 108 in bc73223
'connection' event is not emitted.
|
I will keep this open for a while to collect feedback. If no one will comment I will close it. |
If you publish new package version I can try update the TypeScript definitions at DefinitelyTyped |
What is the timeframe for this PR? |
See #1968 (comment). Let's wait a few more days. |
I'm closing this as per #1968 (comment). |
Closed but not merged? I'm not sure what's going on here! |
Yes, aside from yours, there seems to be no interest in getting this merged. |
If the upgrade is successful and the
callback
argument is notprovided, then emit the
'connection'
event.Refs: #1966