zirias@
Developer
I think I finished my new tool, the one that caused me to ask about O_NONBLOCK behavior with Unix sockets recently
Although the usecase is very specific, I'll still announce it here just in case anyone could need something similar.
What it does is pretty simple: It provides access to a Unix socket on a remote machine. For that, you have to run two instances of it, on both machines. One will act as a client to a Unix socket, one will provide a Unix socket and listen on it. The instances are connected via a single TCP connection, and it's your choice in which direction this connection is made. In case the TCP server instance is the Unix socket client instance, you can have multiple instances on different machines acting as Unix socket servers and connect all to this instance, to provide the same Unix socket to multiple machines. For obvious reasons, this isn't possible when the TCP connection is made in the opposite direction.
Code:
Features:

In this first version, there's neither TLS nor any form of authentication. The simple reason is: I don't need it, I use this over a VPN. So, here's also a question: Would anyone have a usecase for such a tool using a public network, IOW, would it make sense to add TLS and authentication?

What it does is pretty simple: It provides access to a Unix socket on a remote machine. For that, you have to run two instances of it, on both machines. One will act as a client to a Unix socket, one will provide a Unix socket and listen on it. The instances are connected via a single TCP connection, and it's your choice in which direction this connection is made. In case the TCP server instance is the Unix socket client instance, you can have multiple instances on different machines acting as Unix socket servers and connect all to this instance, to provide the same Unix socket to multiple machines. For obvious reasons, this isn't possible when the TCP connection is made in the opposite direction.
Code:
Features:
- All Unix socket connections between two instances are tunneled through a single TCP connection
- You can specify owner uid/gid and mode of a socket you're providing
- When started as root, it will run as the given socket owner (drop privileges)
- Idle TCP connections are "pinged" from time to time and disconnected if unresponsive
- The TCP client end will try to re-establish a lost connection from time to time
- Should work on any modern POSIX system, confirmed on FreeBSD and Linux
- In particular, it needs pselect() and the netdb functions getaddrinfo() and getnameinfo()
- Won't work on Windows as it uses some POSIX functions that don't exist there and also expects Unix semantics for local sockets (e.g. that they can be unlink()ed)

In this first version, there's neither TLS nor any form of authentication. The simple reason is: I don't need it, I use this over a VPN. So, here's also a question: Would anyone have a usecase for such a tool using a public network, IOW, would it make sense to add TLS and authentication?