Search K
Appearance
Appearance
src_host: 源主机地址src_port: 源端口local_port: 本地端口local_host: 本地地址socat TCP4-LISTEN:${local_port},bind=${local_host},reuseaddr,fork TCP4:${src_host}:${src_port}reuseaddr表示可以重复使用本地端口fork表示创建新的进程来处理连接socat TCP4-LISTEN:15672,bind=192.168.1.252,reuseaddr,fork TCP4:192.168.1.247:15672ncat --sh-exec "ncat ${src_host} ${src_port}" -l ${local_port} --keep-open例如需要将当前局域网的192.168.172.131主机的80端口转发到本地的9876端口
ncat --sh-exec "ncat 192.168.172.131 80" -l 9876 --keep-open