alternative for netcat utility

前端 未结 5 2398
庸人自扰
庸人自扰 2021-02-20 07:09

Is there any alternative for netcat utility? I want to run docker API and netcat utility is not installed on client system. docker command example - echo -e \"GET /info HTTP/1.0

5条回答
  •  臣服心动
    2021-02-20 07:30

    According to this,

    (exec 3<>/dev/tcp/url/port; cat >&3; cat <&3; exec 3<&-)
    

    can replace nc/netcat. It should work in any bash based terminal.

    Example:

    printf "Hello World!" | (exec 3<>/dev/tcp/termbin.com/9999; cat >&3; cat <&3; exec 3<&-)

    returns a link.

提交回复
热议问题