connect/proxy: don't start public listener if 0 port
This commit is contained in:
parent
3e8ea58585
commit
b88023c607
|
@ -60,11 +60,15 @@ func (p *Proxy) Serve() error {
|
|||
p.logger.Printf("[DEBUG] leaf: %s roots: %s", leaf.URIs[0], bytes.Join(tcfg.RootCAs.Subjects(), []byte(",")))
|
||||
}()
|
||||
|
||||
newCfg.PublicListener.applyDefaults()
|
||||
l := NewPublicListener(p.service, newCfg.PublicListener, p.logger)
|
||||
err = p.startListener("public listener", l)
|
||||
if err != nil {
|
||||
return err
|
||||
// Only start a listener if we have a port set. This allows
|
||||
// the configuration to disable our public listener.
|
||||
if newCfg.PublicListener.BindPort != 0 {
|
||||
newCfg.PublicListener.applyDefaults()
|
||||
l := NewPublicListener(p.service, newCfg.PublicListener, p.logger)
|
||||
err = p.startListener("public listener", l)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue