chore: fixed typo and add some help info

This commit is contained in:
nadoo committed 2022-05-03 18:19:33 +08:00
1 parent 401efd621a
commit 846ca0b699
9 files changed
+80 -45

No files matched your search

+1 -4
View File
@@ -118,13 +118,10 @@ func (s *SOCKS4) connect(conn net.Conn, target string) error {
return err
}
port, err := strconv.Atoi(portStr)
port, err := strconv.ParseUint(portStr, 10, 16)
if err != nil {
return errors.New("[socks4] failed to parse port number: " + portStr)
}
if port < 1 || port > 0xffff {
return errors.New("[socks4] port number out of range: " + portStr)
}
const baseBufSize = 8 + 1 // 1 is the len(userid)
bufSize := baseBufSize