Skip to content

Commit

Permalink
添加支持代理
Browse files Browse the repository at this point in the history
  • Loading branch information
sxmxta committed Dec 15, 2024
1 parent 61afd6a commit 92c78f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (d *dialer) DialWithProxy(protocol, addr, proxyURL string, timeout time.Dur
case "http":
c, err = proxy.HTTPDialer(proxyURL, timeout)(addr)
case "socks5", "socks5h":
c, err = proxy.Socks5Dialer(proxyURL, timeout)(addr)
c, err = proxy.Socks5Dialer(proxyURL)(addr)
default:
return nil, fmt.Errorf("unsupported proxy protocol: %s", proxyURL)
}
Expand Down
6 changes: 2 additions & 4 deletions proxy/socks5.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package proxy

import (
"golang.org/x/net/proxy"
"net"
"net/url"
"time"

"golang.org/x/net/proxy"
)

func Socks5Dialer(proxyAddr string, timeout time.Duration) DialFunc {
func Socks5Dialer(proxyAddr string) DialFunc {
var (
u *url.URL
err error
Expand Down

0 comments on commit 92c78f6

Please sign in to comment.