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

放肆的年华 提交于 2020-03-01 10:41:19

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!