general: change NextDialer func

This commit is contained in:
nadoo 2018-03-24 22:37:22 +08:00
parent e4be140711
commit 6cf3070d7d
4 changed files with 5 additions and 6 deletions

View File

@ -25,8 +25,7 @@ type HTTP struct {
password string password string
xff bool // X-Forwarded-For xff bool // X-Forwarded-For
xsi bool // X-Server-IP xsi bool // X-Server-IP
selfip string
selfip string
} }
// NewHTTP returns a http proxy. // NewHTTP returns a http proxy.
@ -213,7 +212,7 @@ func (s *HTTP) servHTTPS(method, requestURI, proto string, c net.Conn) {
func (s *HTTP) Addr() string { return s.addr } func (s *HTTP) Addr() string { return s.addr }
// NextDialer returns the next dialer // NextDialer returns the next dialer
func (s *HTTP) NextDialer(dstAddr string) Dialer { return s.dialer } func (s *HTTP) NextDialer(dstAddr string) Dialer { return s.dialer.NextDialer(dstAddr) }
// Dial connects to the address addr on the network net via the proxy. // Dial connects to the address addr on the network net via the proxy.
func (s *HTTP) Dial(network, addr string) (net.Conn, error) { func (s *HTTP) Dial(network, addr string) (net.Conn, error) {

View File

@ -20,8 +20,8 @@ var httpMethods = [...][]byte{
// MixedProxy struct // MixedProxy struct
type MixedProxy struct { type MixedProxy struct {
dialer Dialer dialer Dialer
addr string addr string
http *HTTP http *HTTP
socks5 *SOCKS5 socks5 *SOCKS5
} }

View File

@ -219,7 +219,7 @@ func (s *SOCKS5) ListenAndServeUDP() {
func (s *SOCKS5) Addr() string { return s.addr } func (s *SOCKS5) Addr() string { return s.addr }
// NextDialer returns the next dialer // NextDialer returns the next dialer
func (s *SOCKS5) NextDialer(dstAddr string) Dialer { return s.dialer } func (s *SOCKS5) NextDialer(dstAddr string) Dialer { return s.dialer.NextDialer(dstAddr) }
// Dial connects to the address addr on the network net via the SOCKS5 proxy. // Dial connects to the address addr on the network net via the SOCKS5 proxy.
func (s *SOCKS5) Dial(network, addr string) (net.Conn, error) { func (s *SOCKS5) Dial(network, addr string) (net.Conn, error) {

2
ss.go
View File

@ -204,7 +204,7 @@ func ListCipher() string {
func (s *SS) Addr() string { return s.addr } func (s *SS) Addr() string { return s.addr }
// NextDialer returns the next dialer // NextDialer returns the next dialer
func (s *SS) NextDialer(dstAddr string) Dialer { return s.dialer } func (s *SS) NextDialer(dstAddr string) Dialer { return s.dialer.NextDialer(dstAddr) }
// Dial connects to the address addr on the network net via the proxy. // Dial connects to the address addr on the network net via the proxy.
func (s *SS) Dial(network, addr string) (net.Conn, error) { func (s *SS) Dial(network, addr string) (net.Conn, error) {