A tool commonly used to measure network latency is ping. The ping
tool relies on ICMP request and reply packets to measure round-trip delay for a remote host.
However, SOCKS5 or HTTP proxy protocols can only proxy TCP or UDP packets, so ping
commands based on ICMP protocol cannot be used to measure proxy latency.
To measure the latency of a SOCKS or HTTP proxy, you can use the tcping tool.
The following operations have been successfully tested on the ubuntu16.04 system.
Install tcping tool
sudo apt install tcptraceroute
sudo wget http://www.vdberg.org/~richard/tcpping -O /usr/bin/tcping
sudo chmod 755 /usr/bin/tcping
Start testing
Set the terminal to connect to the network through a proxy, and then start measuring the delay, such as measuring the delay to github.com.
sudo tcping github.com
Get the following response message.
traceroute to github.com (20.205.243.166), 255 hops max, 60 byte packets
seq 0: tcp response from 20.205.243.166 (20.205.243.166) <syn,ack> 46.350 ms
traceroute to github.com (20.205.243.166), 255 hops max, 60 byte packets
seq 1: tcp response from 20.205.243.166 (20.205.243.166) <syn,ack> 44.266 ms
traceroute to github.com (20.205.243.166), 255 hops max, 60 byte packets
seq 2: tcp response from 20.205.243.166 (20.205.243.166) <syn,ack> 45.475 ms
traceroute to github.com (20.205.243.166), 255 hops max, 60 byte packets
seq 3: tcp response from 20.205.243.166 (20.205.243.166) <syn,ack> 44.016 ms