proxy: support registerable usage info

This commit is contained in:
nadoo committed 2022-02-15 21:34:55 +08:00
1 parent d05d71e591
commit cc63a59f1e
22 files changed
+383 -312

No files matched your search

+7 -5
View File
@@ -28,11 +28,6 @@ type Socks5 struct {
password string
}
func init() {
proxy.RegisterDialer("socks5", NewSocks5Dialer)
proxy.RegisterServer("socks5", NewSocks5Server)
}
// NewSocks5 returns a Proxy that makes SOCKS v5 connections to the given address.
// with an optional username and password. (RFC 1928)
func NewSocks5(s string, d proxy.Dialer, p proxy.Proxy) (*Socks5, error) {
@@ -56,3 +51,10 @@ func NewSocks5(s string, d proxy.Dialer, p proxy.Proxy) (*Socks5, error) {
return h, nil
}
func init() {
proxy.AddUsage("socks5", `
Socks5 scheme:
socks://[user:pass@]host:port
`)
}