nyxnor / tor-ctrl

Raw use of tor's controller
Other
5 stars 3 forks source link

should we use bash capabilities if socket is tcp type? #3

Closed nyxnor closed 2 years ago

nyxnor commented 2 years ago

https://www.andreafortuna.org/2021/03/06/some-useful-tips-about-dev-tcp/

exec 3<>/dev/tcp/127.0.0.1/9051
printf '%s\n%s\n' "PROTOCOLINFO" "QUIT" >&3
cat <&3

benefit is not depending on downloading nc, socat, telnet.

would need to check minimal bash version.

had some issues trying to implement in the current state of the script.

adrelanos commented 2 years ago

I guess it's good enough as is. More and more unix domain socket based anyhow. And nc isn't a bad dependency.

Before someone comes and makes a different feature request: "avoid bashisms and port to sh".

nyxnor commented 2 years ago

agree with both statements, having major networking tools available has been great enough and not connecting to unix sockets with bash is not good.