I see it is possible to bind to a localAddress before connecting to a TCP server.
Is there a reason for not supporting the same functionality with unix stream sockets?
I may be misunderstanding you but I don't see how that would work.
The idea is that you bind clients to named sockets so the server can discern them with getpeername().
I don't know if that'll work with unix sockets. With names pipes (windows) it definitely doesn't...
With unix sockets it does work. For example, you can do
$ socat /tmp/local_socket UNIX-CONNECT:/tmp/remote_socket
If I had to implement it as a separate module, any module I can look at to have some inspiration?
@santigimeno Try node-unix-dgram. Ping me on IRC if you have questions.
As to the feature request, I'm afraid we won't be able to implement it.
For the sake of completeness: