Bind broker
tedunangst.com
tedunangst.com
See discussion here: https://news.ycombinator.com/item?id=14712576
Or acept() incoming connections, and then pass the connection's file descriptor.
This is a good point.
> Plus the read/write overhead.
The author's code uses OpenBSD's `SO_SPLICE` for zero-copy socket data transfers.
http://man.openbsd.org/OpenBSD-5.4/setsockopt.2
Edit: apparently `SO_SPLICE` can't splice IP sockets onto unix domain sockets yet, so the presented code is kind of wishful thinking. It sounds like this is in the works though.
Wouldn't really work for Internet accessible IPv4 addresses, but IPv6 would be fine.
There's also http://cyberelk.net/tim/software/portreserve/ for when ports are really needed (not as elegant as the solution under discussion, though, as it just holds a port by binding to it until the rightful owner/service comes along).
- CAP_NET_BIND_SERVICE - Assigned to an executable, doesn't work for scripts, etc.
- Workarounds like authbind (https://en.wikipedia.org/wiki/Authbind)
- Then, as of kernel version 4.11, you can set where the non-privileged ports start, like "sysctl net.ipv4.ip_unprivileged_port_start=0" Somewhat helpful in that you could have them start above things like sshd (22), but below port 80. Still not great for multi-tenant, etc, though.