Skip to content

Instantly share code, notes, and snippets.

@edgesider
Last active December 18, 2018 09:33
Show Gist options
  • Save edgesider/2370a6b742c194788ed222dc58ac09e8 to your computer and use it in GitHub Desktop.
Save edgesider/2370a6b742c194788ed222dc58ac09e8 to your computer and use it in GitHub Desktop.
使用ncat端口转发
tail -f server_output | ncat -l -p 8888 --keep-open | ncat localhost 8000 >> server_output

这行命令可以将来自8888端口的数据转发到localhost:8000

Update

mkfifo fifo
cat fifo | ncat -l -p 8888 | pv | ncat localhost 8000 > fifo

使用pv命令显示流量

示意图 示意图

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment