npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

throttle-proxy

v2.3.1

Published

Throttle HTTP/HTTPS/SOCKS proxy server

Downloads

59

Readme

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