fixup! transports/meeklite: uTLS for ClientHello camouflage

Fix `getDialTLSAddr` to always return a integer port.  Thanks to dcf for
reporting the issue.
merge-requests/3/head
Yawning Angel 5 years ago
parent 5d41c674f0
commit f01e92dde7

@ -24,6 +24,7 @@ import (
"net"
"net/http"
"net/url"
"strconv"
"strings"
"sync"
@ -164,8 +165,9 @@ func getDialTLSAddr(u *url.URL) string {
if err == nil {
return net.JoinHostPort(host, port)
}
pInt, _ := net.LookupPort("tcp", u.Scheme)
return net.JoinHostPort(u.Host, u.Scheme)
return net.JoinHostPort(u.Host, strconv.Itoa(pInt))
}
func newRoundTripper(dialFn base.DialFunc, clientHelloID *utls.ClientHelloID) http.RoundTripper {

Loading…
Cancel
Save