|
|
@ -136,7 +136,7 @@ func (p *ForwardProxyCluster) proxyHttpConnect(w http.ResponseWriter, req *http.
|
|
|
|
for i := 0; i < config.GetConfig().ProxyConnectRetries; i++ { // Retry mechanic
|
|
|
|
for i := 0; i < config.GetConfig().ProxyConnectRetries; i++ { // Retry mechanic
|
|
|
|
resp, err := client.Do(proxyReq)
|
|
|
|
resp, err := client.Do(proxyReq)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
*errorMsg = fmt.Sprintf(`Failed to execute %s request to "%s" - attempt %d/%d - %s`, req.Method, req.URL.String(), i+1, config.GetConfig().ProxyConnectRetries+1, err)
|
|
|
|
*errorMsg = fmt.Sprintf(`Failed to execute %s request to "%s" - attempt %d/%d - %s`, req.Method, req.URL.String(), i+1, config.GetConfig().ProxyConnectRetries, err)
|
|
|
|
if i < config.GetConfig().ProxyConnectRetries-1 {
|
|
|
|
if i < config.GetConfig().ProxyConnectRetries-1 {
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -179,7 +179,7 @@ func (p *ForwardProxyCluster) proxyHttpsConnect(w http.ResponseWriter, req *http
|
|
|
|
// Start a connection to the downstream proxy server.
|
|
|
|
// Start a connection to the downstream proxy server.
|
|
|
|
proxyConn, err = net.DialTimeout("tcp", proxyHost, config.GetConfig().ProxyConnectTimeout)
|
|
|
|
proxyConn, err = net.DialTimeout("tcp", proxyHost, config.GetConfig().ProxyConnectTimeout)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
*errorMsg = fmt.Sprintf(`Failed to dial proxy %s - attempt %d/%d - %s`, proxyHost, i+1, config.GetConfig().ProxyConnectRetries+1, err)
|
|
|
|
*errorMsg = fmt.Sprintf(`Failed to dial proxy %s - attempt %d/%d - %s`, proxyHost, i+1, config.GetConfig().ProxyConnectRetries, err)
|
|
|
|
if i < config.GetConfig().ProxyConnectRetries-1 {
|
|
|
|
if i < config.GetConfig().ProxyConnectRetries-1 {
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|