sozu icon indicating copy to clipboard operation
sozu copied to clipboard

Support backends listening on UNIX domain sockets

Open KellerFuchs opened this issue 8 years ago • 3 comments

UNIX sockets are pretty commonly used for backend services which run on the same server, especially when security is a concern, as they make it easy not to give the backend network access and control which services/users may connect to the backend.

As for #151, I would happily contribute the code for this, assuming it is OK and assuming I manage to find my way around the codebase. :)

KellerFuchs avatar Apr 13 '17 19:04 KellerFuchs

this is doable, but requires changes in a lot of parts of the system.

Backend instances are defined here: https://github.com/sozu-proxy/sozu/blob/master/lib/src/messages.rs#L42 This would probably become an enum and require changes in the other crates as well, to support the new option in configuration.

The part of the code handling connection to the backend is here: https://github.com/sozu-proxy/sozu/blob/d7b2dbe39143cfcc32d9b64b7e59631262dcb013/lib/src/network/mod.rs#L186-L252 You can use mio-uds to add Unix socket support.

To sum up, it's doable, but you'll spend a lot more time on updating the configuration code than on actual network code. I'll ask that you wait a bit for me to finish #144, since I'm changing a lot of parts of the configuration handling code.

Geal avatar Apr 16 '17 08:04 Geal

Sure, thanks.

KellerFuchs avatar Apr 17 '17 04:04 KellerFuchs

Please also support Linux abstract namespace socket (which is like Unix domain socket but doesn't create a file in filesystem).

hongquan avatar Jan 18 '20 02:01 hongquan