summaryrefslogtreecommitdiff
path: root/args/args.go
diff options
context:
space:
mode:
Diffstat (limited to 'args/args.go')
-rw-r--r--args/args.go7
1 files changed, 7 insertions, 0 deletions
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,