command/connect/proxy: -service-addr required for -listen

This commit is contained in:
Mitchell Hashimoto 2018-05-19 11:22:00 -07:00
parent 83f2509c6f
commit b1d709fc9f
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 6 additions and 0 deletions

View File

@ -226,6 +226,12 @@ func (c *cmd) configWatcher(client *api.Client) (proxyImpl.ConfigWatcher, error)
return nil, err
}
if c.serviceAddr == "" {
return nil, fmt.Errorf(
"-service-addr must be specified with -listen so the proxy " +
"knows the backend service address.")
}
listener.BindAddress = host
listener.BindPort = int(port)
listener.LocalServiceAddress = c.serviceAddr