Socat端口转发
安装socat
# Centos
yum install socat
# Debian/Ubuntu
apt-get install socat
转发TCP
使用nohup
命令后台侦听本机20001端口,并连接远程主机korea.yovter.xyz:443
的TCP端口将日志输出到/root/socat.log
nohup socat TCP4-LISTEN:20001,reuseaddr,fork TCP4:korea.yovter.xyz:443 >> /root/socat.log 2>&1 &
转发UDP
使用nohup
命令后台侦听本机20001端口,并连接远程主机korea.yovter.xyz:443
的UDP端口将日志输出到/root/socat.log
nohup socat -T 600 UDP4-LISTEN:20001,reuseaddr,fork UDP4:korea.yovter.xyz:443 >> /root/socat.log 2>&1 &