Refactor dialer

This commit is contained in:
世界 2022-07-01 13:30:04 +08:00
parent 719a27fc42
commit e85528b42f
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
3 changed files with 16 additions and 18 deletions

View file

@ -24,13 +24,13 @@ const (
type Client struct {
version Version
dialer N.ContextDialer
dialer N.Dialer
serverAddr M.Socksaddr
username string
password string
}
func NewClient(dialer N.ContextDialer, serverAddr M.Socksaddr, version Version, username string, password string) *Client {
func NewClient(dialer N.Dialer, serverAddr M.Socksaddr, version Version, username string, password string) *Client {
return &Client{
version: version,
dialer: dialer,
@ -40,7 +40,7 @@ func NewClient(dialer N.ContextDialer, serverAddr M.Socksaddr, version Version,
}
}
func NewClientFromURL(dialer N.ContextDialer, rawURL string) (*Client, error) {
func NewClientFromURL(dialer N.Dialer, rawURL string) (*Client, error) {
var client Client
if !strings.Contains(rawURL, "://") {
rawURL = "socks://" + rawURL