-
Notifications
You must be signed in to change notification settings - Fork 97
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
Use ThrottleGroup to throttle proxy throughput #46
Comments
Thanks. I hadn't thought of this before, but now that you mention it it seems obvious :) |
Hmm. Should uploads and downloads be independent throttle groups? Presumably yes since most internet connections (in the US at least) are faster down than up. Maybe like this? new hoxy.Proxy({
slow: {
up: { rate: 10000, latency: 30 },
down: { rate: 100000, latency: 20 },
}
}) |
I'm thinking maybe rather something like this: new hoxy.Proxy({
slow: {
// bottlenecks all throughput to this speed
rate: 10000,
// delays responses by a certain amount
latency: 30,
// bottlenecks all uploads to this speed
// overrides "rate" above
up: 10000,
// bottlenecks all downloads to this speed
// overrides "rate" above
down: 100000,
}
}) |
Published as 2.0.0. Let me know how it works. |
Awesome, thanks! |
I see. Would it be helpful to have |
That'd be perfect |
Added and published in v2.3.0. |
Me again with another feature request. :)
I'd like to implement a throttling feature in james (which is basically a frontend for hoxy) as mentioned here. But currently
request.slow
andresponse.slow
only throttle per request.What I would need is throttling on proxy level, something like
proxy.slowUpstream(rate)
andproxy.slowDownstream
.After looking into the source I found out that stream-throttle is used in hoxy which has a feature called
ThrottleGroup
. This might make it easy to implement slowing on proxy level.The text was updated successfully, but these errors were encountered: