GithubHelp home page GithubHelp logo

calibreapp / floodgate Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 1.0 372 KB

๐ŸŒŠ Cross-platform, configurable, and reliable bandwidth limiting.

Go 77.87% Shell 22.13%
proxy browser chrome cli golang calibre

floodgate's Introduction

Yarn

Cross-platform, configurable, and reliable bandwidth limiting.


Features

  • Cross-platform and self-contained. Floodgate is a single statically compiled binary with no external dependencies, and is released for macOS, Linux and Windows. Don't want to install Node, Python or anything else? Unzip and start using right away!
  • Real-world connection profiles. Floodgate ships with pre-defined connection profiles that Calibre uses as part of Test Profiles.

๐Ÿƒ Install

Floodgate is packaged as pre-compiled binaries that work on all major operating systems. There are no dependencies to install, it just works. Everywhere.

Operating system download
Mac OS Download
Linux Download
Windows Download

Unzip, copy the binary, and run!

Yarn

๐Ÿ–ฅ Usage

Usage of floodgate:
  -latency string
    	Latency to add to operations, in ms (required)
  -listen string
    	address to listen on, e.g 127.0.0.1:8000 (required)
  -rate string
    	rate to limit to, in kpbs (required)

Using floodgate with Google Chrome

If you wish to reliably limit the bandwidth available to Chrome or Chromium, you can do so by starting Chrome with the --proxy-server flag.

  1. Start floodgate ./floodgate
  2. Start Chrome:
google-chrome-canary --proxy-server="socks://localhost:8000" https://calibreapp.com
  1. The browser is now using a bandwidth limited connection.

๐Ÿค” FAQs

  • Why not use the network limiting feature in Google Chrome?

Because Chrome has many connection types (h2, h2 with server push, http, longpoll, SSE, etc) and it attempts to limit the connection on a per-tab basis, it is really difficult to reliably limit the connection speed for your site. Floodgate circumvents that by providing a proxy server that limits all traffic that it processes.

  • Can I use this with browsers that aren't Chrome?

Yes! Start floodgate and then configure your browser of choice to use a SOCKS5 proxy.

๐Ÿ’ƒ Want to contribute?

Great! Please submit an issue (but preferably, a pull request) with your ideas or fixes. We'll do our best to review and discuss.

floodgate's People

Contributors

benschwarz avatar lstoll avatar lstoll-sfdc avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

flipkick

floodgate's Issues

Make latency more accurate

Currently we're just adding a delay to read/writes, which won't really simulate network conditions. We probably need to have an extra layer that reads from the rate limited reader as fast as it can, then delays the traffic by latency, then finally writes it on a channel the Read() consumes from.

Connection profiles

Support parsing a file with this format and a specific profile name, as well as taking the param options directly.

[
  {
    "title": "GPRS",
    "download": 6400,
    "upload": 2560,
    "latency": 500
  },
  {
    "title": "Regular 2G",
    "download": 32000,
    "upload": 6400,
    "latency": 300
  },
  {
    "title": "Good 2G",
    "download": 57600,
    "upload": 19200,
    "latency": 150
  },
  {
    "title": "Regular 3G",
    "download": 96000,
    "upload": 32000,
    "latency": 100
  },
  {
    "title": "Good 3G",
    "download": 196608,
    "upload": 96000,
    "latency": 40
  },
  {
    "title": "Emerging Markets 3G",
    "download": 400000,
    "upload": 400000,
    "latency": 400
  },
  {
    "title": "Regular 4G",
    "download": 524288,
    "upload": 393216,
    "latency": 20
  },
  {
    "title": "DSL",
    "download": 262144,
    "upload": 131072,
    "latency": 5
  },
  {
    "title": "WiFi",
    "download": 3932160,
    "upload": 1966080,
    "latency": 2
  }
]

Testing

We should be able to pretty accurately test our assumptions about throughput limiting and latency additions, so let's do that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.