|
|
@@ -126,16 +126,18 @@ func DialMeek(
|
|
|
// In this case, host is both what is dialed and what ends up in the HTTP Host header
|
|
|
host = fmt.Sprintf("%s:%d", serverEntry.IpAddress, serverEntry.MeekServerPort)
|
|
|
|
|
|
- // For unfronted meek, we let the http.Transport handle proxying, as the
|
|
|
- // target server hostname has to be in the HTTP request line. Also, in this
|
|
|
- // case, we don't require the proxy to support CONNECT and so we can work
|
|
|
- // throigh HTTP proxies that don't support it.
|
|
|
- url, err := url.Parse(fmt.Sprintf("http://%s", meekConfig.UpstreamHttpProxyAddress))
|
|
|
- if err != nil {
|
|
|
- return nil, ContextError(err)
|
|
|
+ if meekConfig.UpstreamHttpProxyAddress != "" {
|
|
|
+ // For unfronted meek, we let the http.Transport handle proxying, as the
|
|
|
+ // target server hostname has to be in the HTTP request line. Also, in this
|
|
|
+ // case, we don't require the proxy to support CONNECT and so we can work
|
|
|
+ // throigh HTTP proxies that don't support it.
|
|
|
+ url, err := url.Parse(fmt.Sprintf("http://%s", meekConfig.UpstreamHttpProxyAddress))
|
|
|
+ if err != nil {
|
|
|
+ return nil, ContextError(err)
|
|
|
+ }
|
|
|
+ proxyUrl = http.ProxyURL(url)
|
|
|
+ meekConfig.UpstreamHttpProxyAddress = ""
|
|
|
}
|
|
|
- proxyUrl = http.ProxyURL(url)
|
|
|
- meekConfig.UpstreamHttpProxyAddress = ""
|
|
|
|
|
|
dialer = NewTCPDialer(meekConfig)
|
|
|
}
|