socat使用指南:1:概要說明

socat是一個網絡相關命令行工具,它名稱的來源SOcket CAT,功能類似於netcat,比netcat有一定程度的功能增強。這篇文章介紹一下socat的概要信息和安裝方法。

概要信息

socat的概要信息如下表所示:

項目 說明
官網 http://www.dest-unreach.org/socat
開源/閉源 開源
源碼管理地址 http://www.dest-unreach.org/socat/download/
License類別 Mozilla Public License 2.0
開發語言 C
操作系統支持 跨平臺,支持多種操作系統,比如Linux, Mac OS X, Windows等
當前穩定版本 1.7.3.4 (2020/01/05)

安裝方法

操作系統 安裝命令
CentOS/RHEL yum install socat
Ubuntu apt-get install socat
MacOS brew install socat

以MacOS安裝爲例,安裝日誌如下所示:

liumiaocn:~ liumiao$ brew install socat
Updating Homebrew...
^C
==> Downloading https://homebrew.bintray.com/bottles/socat-1.7.3.3_1.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/d5/d59da60bfab8d0c13ae081e6fcfc4c95148b4304b4ca373ec22e1a28272473de?__gda__=exp=15830178
######################################################################## 100.0%
==> Pouring socat-1.7.3.3_1.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/socat/1.7.3.3_1: 9 files, 658.1KB
==> `brew cleanup` has not been run in 30 days, running now...
Removing: /Users/liumiao/Library/Logs/Homebrew/brightness... (64B)
liumiaocn:~ liumiao$ 
liumiaocn:~ liumiao$ which socat
/usr/local/bin/socat
liumiaocn:~ liumiao$

版本確認

liumiaocn:~ liumiao$ socat -V |grep version
socat version 1.7.3.3 on Sep 29 2019 10:48:11
   running on Darwin version Darwin Kernel Version 19.2.0: Sat Nov  9 03:47:04 PST 2019; root:xnu-6153.61.1~20/RELEASE_X86_64, release 19.2.0, machine x86_64
liumiaocn:~ liumiao$ 

另外也可以使用源碼編譯的方法,從如下鏈接下載源碼然後configure; make; make install即可

參考內容

https://stuff.mit.edu/afs/sipb/machine/penguin-lust/src/socat-1.7.1.2/EXAMPLES
http://www.dest-unreach.org/socat/doc/socat.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章