On FreeBSD and OSX, you can use ipfw:
sudo ipfw pipe 1 config bw 50KBytes/s delay 100ms
sudo ipfw add 1 pipe 1 src-port 80
sudo ipfw add 2 pipe 1 dst-port 80
But don't forget to disable it! sudo ipfw delete 1
sudo ipfw delete 2