From 6f3ba344c1f8413a463dc6274f24ef00bf47e534 Mon Sep 17 00:00:00 2001 From: Alexander Hunt Date: Sun, 21 Jun 2026 17:11:32 -0700 Subject: Adding option to bind via unix socket --- args/args.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'args') diff --git a/args/args.go b/args/args.go index 6c79fe9..a488929 100644 --- a/args/args.go +++ b/args/args.go @@ -17,6 +17,11 @@ type Arguments struct { Port int Server bool + // Socket, when set, makes the HTTP server listen on this unix socket path + // instead of the TCP Port — handy behind a reverse proxy. Port is ignored + // when Socket is set. + Socket string + // Dns runs the authoritative DNS server for the LAN. DnsZone is the suffix // it owns (e.g. penguins.lan); queries outside it are forwarded to // DnsResolvers (empty = no forwarding, since the LAN has no outside @@ -51,6 +56,7 @@ func GetArgs() (*Arguments, error) { port := flag.Int("port", 8080, "Port to listen on") server := flag.Bool("server", false, "Run the HTTP server") + socket := flag.String("socket", "", "Serve HTTP on this unix socket instead of the TCP port") dns := flag.Bool("dns", false, "Run the authoritative DNS server") dnsPort := flag.Int("dns-port", 8053, "Port for the DNS server to listen on") @@ -74,6 +80,7 @@ func GetArgs() (*Arguments, error) { Scheduler: *scheduler, Port: *port, Server: *server, + Socket: *socket, Dns: *dns, DnsPort: *dnsPort, DnsResolvers: resolvers, -- cgit v1.3