Feature request: Make it possible to listen on a Unix Domain Socket
Fabianexe opened this issue · comments
Fabianexe commented
At the moment, it is only possible to listen to a TCP port.
However, it would be very handy if a domain socket could be used instead.
Especially in multi-service situations, it would make many things easier.
For example, if you run multiple services in the headless mode, you must know many ports without any semantics to it.
If it would be possible to give a Unix Domain Socket, instead, you could have the socket named by the service name. Something like /tmp/service_x_debug.sock
or so.
Unix Domain Sockets are easy to use in Go. In the end, you must change:
listener, err = net.Listen("tcp", addr)
to
listener, err = net.Listen("unix", path)
I would propose:
- a new command line option like
--unix
could be used as an alternative to--listen
or - the possibility of giving
--listen
a connection string-like format, something likeunix:path
.
Fabianexe commented
thanks for the quick implementation!