tls: fixed a bug in tls which may lose proxy addr

This commit is contained in:
nadoo committed 2019-09-20 13:58:53 +08:00
1 parent 4cb9ea2bdc
commit 6604bfe8a7
2 files changed
+3 -1

No files matched your search

+1 -1
View File
@@ -29,7 +29,7 @@ import (
_ "github.com/nadoo/glider/proxy/ws"
)
var version = "0.8.0"
var version = "0.8.2"
func main() {
// read configs
+2
View File
@@ -43,6 +43,7 @@ func NewTLS(s string, d proxy.Dialer, p proxy.Proxy) (*TLS, error) {
}
addr := u.Host
colonPos := strings.LastIndex(addr, ":")
if colonPos == -1 {
colonPos = len(addr)
@@ -57,6 +58,7 @@ func NewTLS(s string, d proxy.Dialer, p proxy.Proxy) (*TLS, error) {
t := &TLS{
dialer: d,
proxy: p,
addr: addr,
serverName: serverName,
skipVerify: false,
certFile: certFile,