我socat 1.7.3.1-r0
在alpine 3.3
linux服务器上使用并运行以下命令:
socat -d -d -d PTY,link=/dev/ttyFOOBAR,echo=0,raw,unlink-close=0 TCP-LISTEN:7000,forever,reuseaddr
Run Code Online (Sandbox Code Playgroud)
Socat
将通过将数据从虚拟串行端口/dev/ttyFOOBAR
传递到客户端并通过TCP再次返回来监听客户端并创建双向通信.一旦客户端断开连接就socat
应该退出.
建立这样的连接时,socat会记录以下内容:
Run Code Online (Sandbox Code Playgroud)I socat by Gerhard Rieger - see www.dest-unreach.org I This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.openssl.org/) I This product includes software written by Tim Hudson (tjh@cryptsoft.com) I setting option "symbolic-link" to "/dev/ttyFOOBAR" I setting option "echo" to 0 I setting option "raw" I setting option "unlink-close" to 0 I openpty({5}, {6}, …