java socat_socat安装使用方法
socat,一個多功能的網絡工具,名字來源于SOcket CAT,是netcat的增強版,也就是netcat++(擴展了設計,并有新的實現)。
------------------------------------------------------------------------
0x01 安裝
# debian/ubuntu
apt-get installsocat
# centos/redhatyum install -y socat
0x02 通過源碼安裝
在centos或者redhat通過yum安裝后的socat,運行報錯:
E parseopts(): unknown option "tcpwrap"
這里是版本沒編譯進去tcpwrap,先卸載當前socat后,再進行源碼編譯安裝:
(目前最新版本是1.7.3.3)
yum install -y tcp_wrappers tcp_wrappers-devel readline-devel openssl-develyum install -y gccv=1.7.3.3
wget http://www.dest-unreach.org/socat/download/socat-${v}.tar.gz
tar zxvf socat-${v}.tar.gz
cd socat-${v}
./configuremake && make install
0x03 windows版socat
git clone https://github.com/StudioEtrange/socat-windows
(暫時不推薦用,存在各種問題)
0x04 fork EXEC
將一個使用標準輸入輸出的單進程程序變為一個使用fork方法的多進程服務
socat TCP4-LISTEN:2333,tcpwrap=script,reuseaddr,fork EXEC:"/usr/bin/env python2 -u pcat.py"
(其中TCP4-LISTEN可簡寫為tcp-l,而python -u表示輸出不緩存)
0x05 其他
socat的用途很多,可參見開頭列舉的文檔以及pdf,以后pcat有空再補充。
總結
以上是生活随笔為你收集整理的java socat_socat安装使用方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Jenkins教程(自动化部署)
- 下一篇: 近世代数——Part1 整数和等价关系