This commit is contained in:
ccreater 2022-05-08 02:19:41 +08:00
parent 6f15f835f0
commit 5c112e0ca8
1 changed files with 3 additions and 1 deletions

View File

@ -218,6 +218,9 @@ func GetProtocol(host string, Timeout int64) (protocol string) {
}
socksconn, err := common.WrapperTcpWithTimeout("tcp", host, time.Duration(Timeout) * time.Second)
if err != nil {
return
}
conn := tls.Client(socksconn, &tls.Config{InsecureSkipVerify: true})
defer func() {
if conn != nil {
@ -229,7 +232,6 @@ func GetProtocol(host string, Timeout int64) (protocol string) {
conn.Close()
}
}()
if err == nil || strings.Contains(err.Error(), "handshake failure") {
protocol = "https"
}