|
@ -9,7 +9,7 @@ URL=http://127.0.0.1/file |
|
|
|
|
|
|
|
|
mkdir -p tmp |
|
|
mkdir -p tmp |
|
|
|
|
|
|
|
|
type tc > /dev/null && ( |
|
|
type tc 2> /dev/null && ( |
|
|
tc qdisc add dev $DEV root handle 1: prio |
|
|
tc qdisc add dev $DEV root handle 1: prio |
|
|
tc qdisc add dev $DEV parent 1:3 handle 30: netem delay $DELAY |
|
|
tc qdisc add dev $DEV parent 1:3 handle 30: netem delay $DELAY |
|
|
tc filter add dev $DEV parent 1:0 protocol ip u32 match ip dport $PORT 0xffff flowid 1:3 |
|
|
tc filter add dev $DEV parent 1:0 protocol ip u32 match ip dport $PORT 0xffff flowid 1:3 |
|
@ -25,13 +25,13 @@ SERVER=$! |
|
|
|
|
|
|
|
|
sleep 3 |
|
|
sleep 3 |
|
|
|
|
|
|
|
|
curl -o tmp/expected $URL |
|
|
time curl -o tmp/expected $URL |
|
|
curl -o tmp/result --socks5-hostname 127.0.0.1:1081 $URL |
|
|
time curl -o tmp/result --socks5-hostname 127.0.0.1:1081 $URL |
|
|
|
|
|
|
|
|
kill $LOCAL |
|
|
kill $LOCAL |
|
|
kill $SERVER |
|
|
kill $SERVER |
|
|
|
|
|
|
|
|
type tc > /dev/null && tc qdisc del dev lo root |
|
|
type tc 2> /dev/null && tc qdisc del dev lo root |
|
|
|
|
|
|
|
|
sleep 2 |
|
|
sleep 2 |
|
|
|
|
|
|
|
|