master
fangdingjun 8 years ago
parent d6a97c0a75
commit 9c3def8cdb

@ -34,11 +34,11 @@ func (sc *Client) handShake() error {
} }
if buf[0] != socks5Version { if buf[0] != socks5Version {
return fmt.Errorf("error socks version %s", buf[0]) return fmt.Errorf("error socks version %d", buf[0])
} }
if buf[1] != 0x00 && buf[1] != 0x02 { if buf[1] != 0x00 && buf[1] != 0x02 {
return fmt.Errorf("server return with code %s", buf[1]) return fmt.Errorf("server return with code %d", buf[1])
} }
if buf[1] == 0x00 { if buf[1] == 0x00 {

@ -87,7 +87,7 @@ func (s4 *socks4Conn) processRequest() error {
// command only support connect // command only support connect
if buf[0] != cmdConnect { if buf[0] != cmdConnect {
return fmt.Errorf("error command %s", buf[0]) return fmt.Errorf("error command %d", buf[0])
} }
// get port // get port

@ -196,7 +196,7 @@ func (s5 *socks5Conn) processRequest() error {
// command only support connect // command only support connect
if buf[1] != cmdConnect { if buf[1] != cmdConnect {
return fmt.Errorf("unsupported command %s", buf[1]) return fmt.Errorf("unsupported command %d", buf[1])
} }
hlen := 0 // target address length hlen := 0 // target address length

Loading…
Cancel
Save