Use pingser
to create client and server based on ICMP Protocol to send and receive custom message content.
source code: ./examples
Usage:
-
需要准备一台公网 IP 的 linux 主机运行server
-
修改 client.go 文件中
pingser.NewClient("xxx.xxx.xxx.xxx")
的xxx
地址 & 再本地运行 -
可选)禁用系统默认ping:
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all