caddy-ratelimit icon indicating copy to clipboard operation
caddy-ratelimit copied to clipboard

Possible to add MAX incoming connection from remote?

Open wazerstar opened this issue 2 years ago • 5 comments

Hi I'm using this with the rate limit and its fantastic, however I checked to see if I could find any relation to allowing max active connection from a client/remote and did not succeed.

Would this be something you would consider adding to this or any other project in caddy?

wazerstar avatar Apr 08 '22 23:04 wazerstar

Difficult to say. Connection pooling is handled by the standard library. (As discussed on your forum topic).

It'd probably be much easier (and more practical) to limit the max number of active requests.

I'd be open to a proposal for this feature. It wouldn't be time-based, so that's a little interesting in terms of RL logic.

mholt avatar Apr 11 '22 19:04 mholt

Difficult to say. Connection pooling is handled by the standard library. (As discussed on your forum topic).

It'd probably be much easier (and more practical) to limit the max number of active requests.

I'd be open to a proposal for this feature. It wouldn't be time-based, so that's a little interesting in terms of RL logic.

With this case in here, this would actually be to limit client/remote not to use up all limited connections to the unit, in this case 4.

So yeah would be very cool to get as a feature :)

wazerstar avatar Apr 11 '22 19:04 wazerstar

Ok; feel free to contribute then! Or anyone else who would like this. (Or I could be commissioned via sponsorship. I do have a backlog for a few weeks right now though.)

mholt avatar Apr 11 '22 19:04 mholt

Ok; feel free to contribute then! Or anyone else who would like this. (Or I could be commissioned via sponsorship. I do have a backlog for a few weeks right now though.)

Thanks what would commissioned typical be?

wazerstar avatar Apr 24 '22 18:04 wazerstar

@wazerstar Good question, that kind of depends on the project scope and requirements. Right now my understanding is that you need to limit the number of connections to 4 per client, but you don't care about counting requests; limiting connections instead of requests will be a little trickier and probably cost more. (I still think limiting requests will be more useful btw.)

If you email me with your specific technical requirements, matt at dyanim dotcom, I can give you an estimate. Sponsorship tiers are here: https://github.com/sponsors/mholt - and you can see that some tiers offer discounts on development work!

mholt avatar Apr 25 '22 16:04 mholt