From 0744d001aa8470aaa53df28d32e5ceeb8af9bd70 Mon Sep 17 00:00:00 2001 From: Joe Kyo Date: Fri, 1 Sep 2017 10:04:45 +0100 Subject: [PATCH] proxy: add mention of RFC 1929 for SOCKS5 RFC 1929 describes the SOCKS5 username/password authentication method. The proxy package implements this method, but doesn't mention RFC 1929. This change adds mention of RFC 1929. Change-Id: I30487fb41c1baa16b6ee8a99210168a597e5cb65 Reviewed-on: https://go-review.googlesource.com/60870 Reviewed-by: Mikio Hara Reviewed-by: Avelino Run-TryBot: Mikio Hara TryBot-Result: Gobot Gobot --- proxy/socks5.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/socks5.go b/proxy/socks5.go index 2efec6e8..2d7978fe 100644 --- a/proxy/socks5.go +++ b/proxy/socks5.go @@ -12,7 +12,7 @@ import ( ) // SOCKS5 returns a Dialer that makes SOCKSv5 connections to the given address -// with an optional username and password. See RFC 1928. +// with an optional username and password. See RFC 1928 and 1929. func SOCKS5(network, addr string, auth *Auth, forward Dialer) (Dialer, error) { s := &socks5{ network: network, @@ -120,6 +120,7 @@ func (s *socks5) connect(conn net.Conn, target string) error { return errors.New("proxy: SOCKS5 proxy at " + s.addr + " requires authentication") } + // See RFC 1929 if buf[1] == socks5AuthPassword { buf = buf[:0] buf = append(buf, 1 /* password protocol version */)