This commit is contained in:
Dmitry Chepurovskiy 2018-02-08 19:02:35 +00:00 committed by GitHub
commit 7b2518da70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,15 +43,18 @@ type TCPProxy struct {
// Get returns the TCPServer to use
func (p *TCPProxy) Get(host string) *TCPServer {
if p.ServerList == nil {
glog.V(4).Infof("using default proxy")
return p.Default
}
for _, s := range p.ServerList {
if s.Hostname == host {
glog.V(4).Infof("using non-default proxy")
return s
}
}
glog.V(4).Infof("using default proxy")
return p.Default
}