Created
November 29, 2019 08:30
-
-
Save travislee89/c15f67535ebde730167fc9f0673520e0 to your computer and use it in GitHub Desktop.
测试ss的速度。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
number=${1-1G} | |
method=${2-aes-256-gcm} | |
ss-tunnel -k test -m $method -l 58387 -L 127.0.0.1:58388 -s 127.0.0.1 -p 58389 & | |
ss_tunnel_pid=$! | |
ss-server -k test -m $method -s 127.0.0.1 -p 58389 & | |
ss_server_pid=$! | |
iperf3 -s -p 58388 & | |
iperf_pid=$! | |
sleep 1 | |
iperf3 -c 127.0.0.1 -p 58387 -n $number | |
# Wait for iperf server to receive all data. | |
# One second should be enough in most cases. | |
sleep 1 | |
kill $ss_tunnel_pid | |
kill $ss_server_pid | |
kill $iperf_pid | |
sleep 1 | |
echo "Test Finished" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment