Просмотр исходного кода

go.net/proxy: fix SOCSK5 user/pass auth.

The code was using the SOCKS version number (5) where it should have been using the username/password protocol version number (1).

With this change, username/password authentication actually works.

R=golang-dev
CC=golang-dev
https://golang.org/cl/10134044
Adam Langley 12 лет назад
Родитель
Сommit
f013f1fe6d
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      proxy/socks5.go

+ 1 - 1
proxy/socks5.go

@@ -118,7 +118,7 @@ func (s *socks5) Dial(network, addr string) (net.Conn, error) {
 
 	if buf[1] == socks5AuthPassword {
 		buf = buf[:0]
-		buf = append(buf, socks5Version)
+		buf = append(buf, 1 /* password protocol version */)
 		buf = append(buf, uint8(len(s.user)))
 		buf = append(buf, s.user...)
 		buf = append(buf, uint8(len(s.password)))