
Show HN: Crapify, a proxy for simulating slow, spotty HTTP connections - BenjaminCoe
https://www.npmjs.com/package/crapify
======
semi-extrinsic
Nice! There was a different tool in the same category, aptly named "Comcast",
featured on HN a few weeks ago:
[https://github.com/tylertreat/Comcast](https://github.com/tylertreat/Comcast)

~~~
tuananh
i thought u were being sarcastic but then you put the github's repo link
there. LOL

------
BenjaminCoe
At work we've been running into problems performing npm installs over a VPN.
I'm suspicious that it relates to executing too many concurrent HTTP requests.
This motivated me to create crapify, a tool which lets us experiment with
throttling connection speed and concurrency.

------
taf2
On OS X you can achieve something similar using ipfw

For example,

sudo ipfw pipe 1 config bw 500KByte/s

Limits all network on your box to 500kb/s

sudo ipfw add 1 pipe 1 src-port 443

To direct all traffic through port 443 through your slow pipe

sudo ipfw delete 1

When you are all done delete

~~~
JonnieCache
Don't the OSX devtools have a GUI for doing this? Can't remember what its
called, I don't have XCode installed these days, but I remember it being
pretty nifty.

EDIT: its called the Network Link Conditioner and apparently you install it
from within xcode now.

EDIT2: I have just learned that ipfw is gone in yosemite? How distressing. Did
they replace it with something?

~~~
apinstein
I have Network Link Conditioner installed on my Yosemite Mac OS X box and it
works fine (though it was installed prior to the Yose upgrade).

I learned about it here: [http://nshipster.com/network-link-
conditioner/](http://nshipster.com/network-link-conditioner/)

------
Spooky23
This is cool. If it could add random NATing between various VLANs and
occasionally not open firewall ports as configured, it would be a simulation
of my work environment!

------
hippich
For linux there is tool 'tc'

------
hrjet
A more complete version of this: [https://github.com/lightbody/browsermob-
proxy](https://github.com/lightbody/browsermob-proxy)

    
    
        * captures performance data in the HAR format.
        * blacklisting and whitelisting certain URL patterns
        * simulating various bandwidth and latency
        * remapping DNS lookups
        * flushing DNS caching
        * controlling DNS and request timeouts
        * automatic BASIC authorization
        * REST API

------
Rygu
If you simply need to test a website on a simulated slow connection, then
Chrome Devtools. For all other purposes, this looks great!

------
youngtaff
Why not use DummyNet, Clumsy or Network Link Conditioner (depending on your OS
of choice)?

If you really need a HTTP proxy there are tools like Charles (although the low
RTT to a proxy may change the nature of the testing)

~~~
BenjaminCoe
My main use-case is programmatically throttling the outbound concurrent
connections to a VPN. Writing a small proxy server in Node.js seemed like a
reasonable approach for this.

