socks4: add doc info and fix bug

This commit is contained in:
nadoo committed 2020-04-13 12:33:44 +08:00
1 parent fa3a7da859
commit d8b9e00025
3 files changed
+5 -3

No files matched your search

+2 -3
View File
@@ -32,8 +32,7 @@ func init() {
proxy.RegisterDialer("socks4", NewSocks4Dialer)
}
// NewSOCKS4 returns a Proxy that makes SOCKS v5 connections to the given address
// with an optional username and password. (RFC 1928)
// NewSOCKS4 returns a socks4 proxy.
func NewSOCKS4(s string, dialer proxy.Dialer) (*SOCKS4, error) {
u, err := url.Parse(s)
if err != nil {
@@ -161,5 +160,5 @@ func (s *SOCKS4) connect(conn net.Conn, target string) error {
err = errors.New("Socks connection request failed, unknown error")
}
return nil
return err
}