add socks5 support

This commit is contained in:
ccreater
2022-05-07 23:46:22 +08:00
parent df527adda9
commit d774023da7
15 changed files with 100 additions and 22 deletions
+2 -2
View File
@@ -10,7 +10,6 @@ import (
"golang.org/x/text/encoding/simplifiedchinese"
"io"
"io/ioutil"
"net"
"net/http"
"net/url"
"regexp"
@@ -218,7 +217,8 @@ func GetProtocol(host string, Timeout int64) (protocol string) {
return
}
conn, err := tls.DialWithDialer(&net.Dialer{Timeout: time.Duration(Timeout) * time.Second}, "tcp", host, &tls.Config{InsecureSkipVerify: true})
socksconn, err := common.WrapperTcpWithTimeout("tcp", host, time.Duration(Timeout) * time.Second)
conn := tls.Client(socksconn, &tls.Config{InsecureSkipVerify: true})
defer func() {
if conn != nil {
conn.Close()