3 ms·
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 ou
by walth 3y 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
```
- rhizome 3y agoDummynet 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!