strategy: fixed a bug in haproxy which actually act as a rrproxy.

This commit is contained in:
nadoo 2017-07-31 19:29:43 +08:00
parent b3b06cbfa5
commit f8f6308e92
2 changed files with 6 additions and 2 deletions

2
ss.go
View File

@ -19,7 +19,7 @@ type ss struct {
func SSProxy(addr, method, pass string, upProxy Proxy) (Proxy, error) {
ciph, err := core.PickCipher(method, nil, pass)
if err != nil {
log.Fatal(err)
log.Fatalf("PickCipher for '%s', error: %s", method, err)
}
s := &ss{

View File

@ -75,7 +75,7 @@ func (p *rrProxy) Enabled() bool { return true }
func (p *rrProxy) SetEnable(enable bool) {}
func (p *rrProxy) Dial(network, addr string) (net.Conn, error) {
return p.NextProxy().Dial(network, addr)
return p.GetProxy(addr).Dial(network, addr)
}
// high availability proxy
@ -95,3 +95,7 @@ func (p *haProxy) GetProxy(dstAddr string) Proxy {
}
return proxy
}
func (p *haProxy) Dial(network, addr string) (net.Conn, error) {
return p.GetProxy(addr).Dial(network, addr)
}