diff --git a/README.md b/README.md index 6a31388..10c4198 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ we can set up local listeners as proxy servers, and forward requests to internet |Protocol | Listen/TCP | Listen/UDP | Forward/TCP | Forward/UDP | | :-: | :-: | :-: | :-: | :-: | Socks5 | √ | √ | √ | √ +Socks4 | | | √ | Http | √ | | √ | SS | √ | √ | √ | √ Redir | √ | | | @@ -125,6 +126,7 @@ glider 0.10.0 usage: Available Schemes: mixed: serve as a http/socks5 proxy on the same port. (default) ss: ss proxy + socks4: socks4 proxy socks5: socks5 proxy http: http proxy ssr: ssr proxy diff --git a/conf.go b/conf.go index b15be51..f03f9e0 100644 --- a/conf.go +++ b/conf.go @@ -114,6 +114,7 @@ func usage() { fmt.Fprintf(w, "Available Schemes:\n") fmt.Fprintf(w, " mixed: serve as a http/socks5 proxy on the same port. (default)\n") fmt.Fprintf(w, " ss: ss proxy\n") + fmt.Fprintf(w, " socks4: socks4 proxy\n") fmt.Fprintf(w, " socks5: socks5 proxy\n") fmt.Fprintf(w, " http: http proxy\n") fmt.Fprintf(w, " ssr: ssr proxy\n") diff --git a/proxy/socks4/socks4.go b/proxy/socks4/socks4.go index 3560344..3f311f4 100644 --- a/proxy/socks4/socks4.go +++ b/proxy/socks4/socks4.go @@ -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 }