Simulate a 3G mobile connection to test how your web app loads under slow conditions before shipping.
Add 200ms of latency and 5% packet loss to all traffic on your dev machine to reproduce flaky network bugs.
Limit bandwidth to a specific port to test how your API client handles slow or stalled responses.
Run comcast --stop after testing to instantly restore normal network behavior without rebooting.
Requires root or sudo on Linux to modify iptables and tc rules.
Comcast is a command-line tool for deliberately degrading your network connection in controlled ways so you can test how your software behaves under poor conditions. The name is a joke referencing the ISP, not an affiliation with it. The idea is that network failures are not always dramatic outages, more often they are slow connections, occasional dropped packets, or added latency, and these subtle problems are worth testing for. The tool works by wrapping the network control utilities that already exist on your operating system. On Linux it uses iptables and tc, which are built-in tools for managing network traffic rules. On macOS and BSD systems it uses ipfw or pfctl, depending on the OS version. Comcast just provides a simpler command to configure those tools without having to write the commands by hand. You run it from the terminal, passing flags for the conditions you want to simulate. You can set added latency in milliseconds, cap the bandwidth in kilobits per second, and specify a percentage of packets to randomly drop. You can also narrow the conditions to specific IP addresses, protocols (TCP, UDP, ICMP), or port numbers, so only traffic to a particular service is affected. Running comcast --stop removes the rules and restores normal network behavior. The README includes a reference table of real-world network profiles with suggested values for conditions like 3G mobile, DSL, dial-up, WiFi, and even Starlink, so you can replicate recognizable scenarios rather than guessing at numbers. The project is written in Go and installable with a single go install command. For users who prefer not to run a wrapper script, the README also shows the underlying iptables and ipfw commands directly, so you can run them yourself.
← tylertreat on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.