Skip to content
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

Maximum Concurrent Connection on Primus Server #779

Open
jmalkan opened this issue Apr 1, 2022 · 2 comments
Open

Maximum Concurrent Connection on Primus Server #779

jmalkan opened this issue Apr 1, 2022 · 2 comments

Comments

@jmalkan
Copy link

jmalkan commented Apr 1, 2022

Version: 8.0.5

Environment:

  • Operating system: Lenix
  • Browser: All
  • Node.js: 14.17.6

This is more of a discussion or query.

I would like to know if there is a way to configure Primus Server to set a Max Limit for Concurrent Connection?

@lpinca
Copy link
Member

lpinca commented Apr 2, 2022

You can do this with a custom middleware. When a client connects, check the value of primus.connected. If the value is above the threshold, then close the connection. You might find the authorization middleware useful as a reference.

@jmalkan
Copy link
Author

jmalkan commented Apr 4, 2022

Thanks for the suggestion. I was hoping Primus could be configured to achieve this. I'll try the middleware route.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants