Allow support for a LimitListener
Note: for support questions, please use our gitter channel or stackoverflow. This repository's issues are reserved for feature requests and bug reports.
-
**I'm submitting a ... **
- [ ] bug report
- [x] feature request
- [ ] support request => Please do not submit support request here, see note at the top of this template.
-
Do you want to request a feature or report a bug? Feature
-
What is the current behavior? No limit of the server listener connections
-
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
-
What is the expected behavior? I Propose to add a limit listener that will restrict the amount of active connections in the server
-
What is the motivation / use case for changing the behavior?
-
Please tell us about your environment:
-
Library version: v7.3.4
-
Operating System: [Darwin Kernel Version 10.2.0 | Microsoft Windows [Version 10.0.10240]]
-
System Information: [Core i7-7740X 16gb Ram]
-
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc) I've taken the inspiration from https://github.com/tylerb/graceful/blob/master/limit_listen.go
wher you can wrap the net.Listener struct to accept a limit so we have a bounded number of active connections per server.
Are you able to implement it with test and coverage?
I will work on this weekend
I would like to also enhance the ticket scope by providing options for:
- Limiting the Server connections in a global way
- Limiting the Server connections from a particular client.ip, request.host or request.header.X-Header
- Expose options from a config file
- On connection limit, we should respond with https://httpstatuses.com/429
- Middleware support.
I like it. I'm looking forward to testing it.
@theodesp any update?