Sometimes you need to reduce network bandwidth in development environment. The simplest way to do this is setup a proxy server and route all network traffic to it.
Throttle proxy v2 deals with all kind of traffic without issues.
I recommend installing throttle-proxy globally. You can do so using npm:
$ npm install -g throttle-proxy
After that, you can run throttle-proxy like this:
$ throttle-proxy
And the last step is set SOCKS proxy server in the network preferences. See an example of macOS preference panel below. Actually, there are similar settings in Windows and Linux as well.
The proxy supports “Automatic Proxy Configuration”. It’s the only way to set up SOCKS proxy on iOS.
Open the following panel
Settings -> WiFi -> HTTP Proxy
select “Automatic” and enter your proxy address (IP or domain name) in URL field as per screenshots above.
Run throttle-proxy --help
to see the following overview of the options:
Usage: throttle-proxy [options]
Options:
-p, --port <n> incoming port number (default: 1080)
-s, --incoming-speed <n> max incoming speed (Bps) (default: 100000)
--outgoing-speed <n> max outgoing speed (Bps) (default: 100000)
-d, --delay <n> delay response by time in ms (default: 0)
--pac-port <n> PAC-server port number (default: 3128)
-V, --version output the version number
-h, --help output usage information
You can run proxy using Docker image
docker run -d -p 1080:1080 -p 3128:3128 mistakster/throttle-proxy
Proxy server can be used as a regular Node.js module:
const proxy = require('throttle-proxy');
proxy({
port: 1080,
incomingSpeed: 100000,
outgoingSpeed: 100000,
delay: 0
});
2018-10-05
- Added verbosity flag
2018-04-11
- Fixed wrong in/out throttles
2018-04-08
- Added proxy auto-config
2018-04-06
- Rewrote it as a SOCKS-proxy to allow handle all kind of traffic
- Implemented global speed limiter correctly
2018-04-04
- Have frozen development of the HTTP proxy
2018-02-01
- Added external proxy support
2016-03-01
- Added
--help
option
2015-12-17
- Added
--delay
option
2015-09-24
- Implemented a hacky global speed limiter
2013-12-18
- Made a cosmetic refactoring
2013-09-11
- Fixed incorrect file mode
2013-08-27
- Introduced outgoing throttle
2013-08-08
- Added
--skip
option
2013-07-31
- Fixed documentation
2013-04-24
- Made a small refactoring
2013-04-22
- Made initial release
MIT