Update webtitle.go

This commit is contained in:
影舞者 2022-05-09 12:27:05 +08:00 committed by GitHub
parent 5bb7502ba3
commit 0b8c0ccc96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -232,6 +232,8 @@ func GetProtocol(host string, Timeout int64) (protocol string) {
conn.Close()
}
}()
conn.SetDeadline(time.Now().Add(time.Duration(Timeout) * time.Second))
err = conn.Handshake()
if err == nil || strings.Contains(err.Error(), "handshake failure") {
protocol = "https"
}