mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 06:03:48 +03:00
admin: Allow listening on unix socket (closes #2749)
This commit is contained in:
parent
d0c1756fc5
commit
833d67446f
1 changed files with 9 additions and 1 deletions
10
admin.go
10
admin.go
|
@ -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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue