diff options
author | Matthew Holt <[email protected]> | 2019-09-13 11:24:07 -0600 |
---|---|---|
committer | Matthew Holt <[email protected]> | 2019-09-13 11:24:07 -0600 |
commit | 833d67446f14e88c2888db2c3796568fd00bae7a (patch) | |
tree | fa43dc94ace7e2d754d779027c34a017f6fcfd3f /admin.go | |
parent | d0c1756fc56dd43cee73ef7ccabb2276a5b26caf (diff) | |
download | caddy-833d67446f14e88c2888db2c3796568fd00bae7a.tar.gz caddy-833d67446f14e88c2888db2c3796568fd00bae7a.zip |
admin: Allow listening on unix socket (closes #2749)
Diffstat (limited to 'admin.go')
-rw-r--r-- | admin.go | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -81,7 +81,15 @@ func StartAdmin(initialConfigJSON []byte) error { } } - ln, err := net.Listen("tcp", adminConfig.Listen) + // extract a singular listener address + netw, listenAddrs, err := ParseNetworkAddress(adminConfig.Listen) + if err != nil { + return fmt.Errorf("parsing admin listener address: %v", err) + } + if len(listenAddrs) != 1 { + return fmt.Errorf("admin endpoint must have exactly one listener; cannot listen on %v", listenAddrs) + } + ln, err := net.Listen(netw, listenAddrs[0]) if err != nil { return err } |