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

+13
View File
@@ -133,3 +133,16 @@ func (d *Direct) IFaceIPs() (ips []net.IP) {
}
return
}
func init() {
AddUsage("direct", `
Direct scheme:
direct://
Only needed when you want to load balance multiple interfaces directly:
glider -verbose -listen :8443 -forward direct://#interface=eth0 -forward direct://#interface=eth1 -strategy rr
Or you can use the high availability mode:
glider -verbose -listen :8443 -forward direct://#interface=eth0&priority=100 -forward direct://#interface=eth1&priority=200 -strategy ha
`)
}
+7
View File
@@ -37,3 +37,10 @@ func (s *Reject) Dial(network, addr string) (net.Conn, error) {
func (s *Reject) DialUDP(network, addr string) (net.PacketConn, error) {
return nil, errors.New("REJECT")
}
func init() {
proxy.AddUsage("reject", `
Reject scheme:
reject://
`)
}
+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