Hacker News new | ask | show | jobs
by walth 890 days ago
You can do the same thing on Mac with built-in tools

``` # Setup pipe sudo dnctl pipe 1 config bw 1Kbit/s delay 800

# Setup matching pf rule echo "dummynet out proto tcp from any to 127.0.0.1 port 11211 pipe 1" | sudo pfctl -f -

# Turn on firewall sudo pfctl -e

# Test time nc -vz 127.0.0.1 11211 Connection to 127.0.0.1 port 11211 [tcp/*] succeeded! nc -vz 127.0.0.1 11211 0.01s user 0.00s system 0% cpu 1.333 total ```

1 comments

Dummynet and the rest of this functionality comes from FreeBSD, where it has existed for a long time. I was doing packet loss testing with it 15+ years ago. Works great!