Add support for Unix sockets for Web Service and DoH#1753
Add support for Unix sockets for Web Service and DoH#1753IngmarStein wants to merge 2 commits intoTechnitiumSoftware:masterfrom
Conversation
This adds support for listening on Unix domain sockets in addition to TCP ports for both the Web Service (HTTP/HTTPS) and DNS-over-HTTPS (DoH). Unix sockets are often used for these reasons: - Secure Local IPC: They allow secure, high-performance connections from a local reverse proxy (like Nginx or HAProxy) without exposing the service on local TCP ports, which could be accessible to other local users or processes. - Performance: They avoid the overhead of the TCP/IP networking stack (routing, packet encapsulation, etc.), leading to lower latency and higher throughput for proxy setups. - Security: Access to Unix sockets can be strictly controlled using standard file system permissions (chown/chmod), providing an additional layer of security over local TCP loopback binding. The configuration has been updated to support a single Unix socket path for HTTP and HTTPS variants of the Web UI and DoH services.
|
Thanks for the PR. Will review it soon. |
|
@ShreyasZare what's your position on this feature? If you're positive, I'll go ahead and resolve the merge conflicts with current HEAD. |
Thanks for asking. Yes, this is useful option to have. Just could not find enough time to include this in the latest release. Would be nice if you can resolve the conflicts. Another thing I had in mind regarding this is that unix socket for TLS will probably be not useful since reverse proxy setups tend to do TLS termination. So, having it for plain HTTP will be good I think unless you know some application that requires TLS support with unix sockets. |
|
Alright, thanks for the feedback, I'll resolve the conflicts then.
Most reverse proxies (at least Caddy, Nginx, Pomerium) these days allow TLS also for their backend / upstream connections and also over UDS. For example: Caddy: Nginx: HAproxy: TLS can help with HTTP/2 for when h2c is not available. I think having that option doesn't hurt. |
|
@ShreyasZare it's ready for another look |
|
Thanks for the changes. Will review them soon.
The reason I think TLS option wont be useful is that unix sockets used on local host and thus TLS on the same host may not add any value in terms of security. Additional option may confuse some users too. |
|
Some application support simultaneous dual-serving over TCP and UDS and once you enable TLS (for HTTPS), they also expect that over UDS. I think it's logically useful to decouple
|
This adds support for listening on Unix domain sockets in addition to TCP ports for both the Web Service (HTTP/HTTPS) and DNS-over-HTTPS (DoH).
Unix sockets are often used for these reasons:
The configuration has been updated to support a single Unix socket path for HTTP and HTTPS variants of the Web UI and DoH services.