GithubHelp home page GithubHelp logo

crapify's Introduction

crapify

Build Status

crapify is a proxy for simulating slow, spotty, HTTP connections. It allows you to vary:

  • the upload and download speed of requests.
  • the maximum number of concurrent outbound HTTP connections.
  • the number of bytes dropped during transfers.

Contribute to Crapify on GitHub

Usage

  • npm install crapify -g
  • crapify start --port=5000 --speed=3000 --concurrency=2, where:
    • port is the port crapify should start on.
    • speed is the connection speed in bytes/second.
    • concurrency is the number of concurrent outbound connections allowed.
    • drop-frequency is how often bytes should be dropped (byte count % drop frequency).

Examples

usage with npm

npm config set proxy http://127.0.0.1:5000

usage with curl

curl -v --proxy http://127.0.0.1:5000 https://www.google.com

usage with OSX

  1. Go to system preferences.
  2. Click on Network.
  3. Click on Advanced.
  4. Click on Proxies.
  5. Enable an http, and an https proxy, with 127.0.0.1, and :5000, respectively.

If you like crapify, you may also like...

  • tylertreat/Comcast, a Go frontend that simulates terrible network connections by directly modifying settings for your network interfaces.

crapify's People

Contributors

bcoe avatar gr0uch avatar kahwee avatar mmalecki avatar stuartpb avatar waldyrious avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

crapify's Issues

Clarify drop-frequency usage

In the README it's unclear how to properly utilize drop-frequency. For example it's listed as

drop-frequency how often should bytes be dropped? (byte count % drop frequency).

However how does one interpret "byte count % drop frequency"? Does

crapify start --port=5000 --speed=3000 --concurrency=2 --drop-frequency=4 % 20

mean that since frequency is a number of some repeating thing per time unit does the above translate to drop 4 bytes every 20 seconds, or drop 4% of bytes per 20 milliseconds, any conceivable combination therein, or something else entirely?

Furthermore it might help to also include drop-frequency in the Usage section of the README as well such as:

>crapify start --port=5000 --speed=3000 --concurrency=2 --drop-frequency=4 % 20

Docker image

Nice project! An official docker image would be very useful.

Simulate packet loss

I've given this some thought and I don't think that dropping bytes is a useful feature, as it does not simulate real world poor network conditions. If a packet is not received, another attempt to send it occurs, since TCP is supposed to be a guaranteed reliable delivery, with all bytes sent and in the correct order.

What really should happen is that there is a chance that a entire packet may be lost. It has to pretend to send a packet and then retransmit with the actual payload.

At the very least, dropping bytes should be a deprecated or removed feature. It seems to be highly problematic, especially if for example I am downloading a JS file and there are bytes missing, code won't execute or fuck up in unpredictable ways.

Perhaps I can attempt a PR on this.

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.