Simple Socket Server in Bash?

后端 未结 4 1689
挽巷
挽巷 2020-12-04 08:27

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:4

4条回答
  •  借酒劲吻你
    2020-12-04 08:48

    Adding an answer using ncat that @Freedom_Ben alluded to:

    ncat -k -l 127.0.0.1 4444
    

    and explanation of options from man ncat:

    -k, --keep-open            Accept multiple connections in listen mode
    -l, --listen               Bind and listen for incoming connections
    

提交回复
热议问题