• Stars
    star
    114
  • Rank 298,043 (Top 7 %)
  • Language
    JavaScript
  • Created about 11 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Throttle HTTP/HTTPS/SOCKS proxy server

Throttle HTTP/HTTPS/SOCKS proxy server

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.

Installation and Usage

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.

macOS network preferences

The proxy supports “Automatic Proxy Configuration”. It’s the only way to set up SOCKS proxy on iOS.

iOS WiFi config iOS PAC settings

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.

Options

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

Docker

You can run proxy using Docker image

docker run -d -p 1080:1080 -p 3128:3128 mistakster/throttle-proxy

Advanced usage

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
});

History

2.3.0

2018-10-05

  • Added verbosity flag

2.2.0

2018-04-11

  • Fixed wrong in/out throttles

2.1.0

2018-04-08

  • Added proxy auto-config

2.0.0

2018-04-06

  • Rewrote it as a SOCKS-proxy to allow handle all kind of traffic
  • Implemented global speed limiter correctly

1.0.0

2018-04-04

  • Have frozen development of the HTTP proxy

0.8.0

2018-02-01

  • Added external proxy support

0.7.0

2016-03-01

  • Added --help option

0.6.0

2015-12-17

  • Added --delay option

0.5.0

2015-09-24

  • Implemented a hacky global speed limiter

0.4.2

2013-12-18

  • Made a cosmetic refactoring

0.4.1

2013-09-11

  • Fixed incorrect file mode

0.4.0

2013-08-27

  • Introduced outgoing throttle

0.3.0

2013-08-08

  • Added --skip option

0.2.1

2013-07-31

  • Fixed documentation

0.2.0

2013-04-24

  • Made a small refactoring

0.1.0

2013-04-22

  • Made initial release

Licence

MIT

More Repositories

1

pretty-header

Split a text into lines with almost equal width.
HTML
54
star
2

postcss-pipeline-webpack-plugin

A webpack plugin to process generated assets with PostCSS pipeline
JavaScript
49
star
3

bem-cn-lite

Lite version of the friendly BEM-style class name generator, which is great for React
JavaScript
23
star
4

kolobok

How to tell the story using JS? Easy!
JavaScript
15
star
5

app-skeleton

JavaScript
13
star
6

jquery-daterange

Add-on to jQuery UI Datepicker which allow user to select start and end date of range in two clicks
JavaScript
11
star
7

grunt-svg2string

Transforms a SVG file into a JavaScript string
JavaScript
9
star
8

fronttalks-webpack

A deep dive into webpack
HTML
6
star
9

sugared-dom

Sugared DOM: Better Than Templates
JavaScript
5
star
10

postcss-alter-color

A PostCSS plugin to replace one color with another color
JavaScript
3
star
11

fronttalks-bb

Some tests of the BackboneJS features and its plugins
JavaScript
3
star
12

test-code-splitting

A demo repository to show how we can extract particular modules into the chunks
JavaScript
3
star
13

rxjs-mongodb

JavaScript
2
star
14

jquery-noop

The smallest plugin ever
JavaScript
1
star
15

contract

"Programming by Contract" JavaScript framework
JavaScript
1
star
16

tiny-ci-server

It’s a tiny continuous integration development server.
JavaScript
1
star
17

countdown

A countdown timer on steroids
JavaScript
1
star
18

css-minsk-js-color-management

Case studies: Two color management plugins for PostCSS
HTML
1
star
19

frontendconf-2015

Пакуйте чемоданы. Грузите апельсины.
HTML
1
star
20

frontendconf-postcss-plugin

Материалы для мастер-класса на FrontendConf 2018
HTML
1
star
21

react-for-dummies

A quick talk to introduce common features of React and React Native
HTML
1
star