Bash 中的简单套接字服务器? [英] Simple Socket Server in Bash?

查看:23
本文介绍了Bash 中的简单套接字服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以快速绑定到 TCP 端口/IP 地址并简单地将所有信息打印到 STDOUT?我有一个简单的调试解决方案,可以将内容写入 127.0.0.1:4444,我希望能够简单地从 bash 绑定一个端口并打印遇到的所有内容.有没有简单的方法可以做到这一点?

Is there a way to quickly bind to a TCP port/ip address and simply print out all information to STDOUT? I have a simple debugging solution which writes things to 127.0.0.1:4444 and I'd like to be able to simply bind up a port from bash and print everything that comes across. Is there an easy way to do this?

推荐答案

$ nc -k -l 4444 > filename.out

nc(1)

这篇关于Bash 中的简单套接字服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆