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

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

No files matched your search

+1 -1
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{
+5 -1
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)
}