question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability for server to reject connection with custom reason

See original GitHub issue

Story

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 closed callback).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
enisdenjocommented, Nov 20, 2020

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

1reaction
enisdenjocommented, Nov 18, 2020

Of course! You can close the socket quite literally whenever you want. The client will behave accordingly.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found