Ability for server to reject connection with custom reason
See original GitHub issueStory
As a server developer I want to reject connection with custom reason, based on connection params. e.g. user sends expected api version or app token, and I want to reject with “UpgradeNeeded” or “InvalidToken” reason.
Acceptance criteria
- server is able to reject user connection with custom reason (return string from
onConnect?.. Not sure about code, maybe also it worth return [number, string] for custom code). - client is able to handle it properly (already possible with
closedcallback).
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
What causes the 'Connection Refused' message?
3 main reasons: 1- Server is unable to receive the connection (performance related) 2- Firewall 3- Nothing is listening on the port.
Read more >What can be the reasons of connection refused errors?
The error means the OS of the listening socket recognized the inbound connection request but chose to intentionally reject it.
Read more >Reject with custom reason · Issue #352 · rabbitmq ...
As you can see here, basic.reject in AMQP doesn't support a parameter where you could set a reason.
Read more >How to Fix the SSH "Connection Refused" Error
Then we'll explain some common reasons your connection may be refused, including in PuTTY. Finally, we'll provide some troubleshooting tips.
Read more >Cross-Origin Resource Sharing (CORS) - MDN Web Docs
Cross-Origin Resource Sharing (CORS ) is an HTTP-header based mechanism that allows a server to indicate any origins (domain, scheme, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

🎉 This issue has been resolved in version 2.0.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
Of course! You can close the socket quite literally whenever you want. The client will behave accordingly.