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

Support for Throttling #9

Open
kdzwinel opened this issue Nov 20, 2015 · 5 comments
Open

Support for Throttling #9

kdzwinel opened this issue Nov 20, 2015 · 5 comments

Comments

@kdzwinel
Copy link
Owner

IMO doing a simple setTimeout on the proxy server should work just fine for most cases.

@MichielDeMey
Copy link

Won't that only emulate high latency?
Throttling is rather for restricting bandwidth, I believe.

@kdzwinel
Copy link
Owner Author

@MichielDeMey thanks for input! You are right - setTimeout will only emulate latency. I'm not sure how to correctly emulate bandwidth at this point, but I'd guess that it should be throttled somewhere around here (traffic-interceptor.js):

    res.write = function(chunk) {
        _write.apply(res, arguments);

We can split each received data chunk into multiple smaller ones.

@samccone
Copy link
Collaborator

@kdzwinel
Copy link
Owner Author

Note: to show the network throttling panel back again revert c002175 .

@jessetan
Copy link

You can use something like https://github.com/tjgq/node-stream-throttle (which uses https://github.com/jhurliman/node-rate-limiter) to throttle a stream.

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

No branches or pull requests

4 participants