Compare commits

...

2 Commits

Author SHA1 Message Date
Cyberes d6c916d019 fix incorrect config key 2024-08-12 20:12:25 -06:00
Cyberes 88b0a62272 fix incorrect increment 2024-08-12 20:08:15 -06:00
2 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ proxy_connect_timeout: 60
# How many times to retry a proxy connection. # How many times to retry a proxy connection.
# On each retry a new proxy will be chosen. # On each retry a new proxy will be chosen.
proxy_connect_retry: 3 proxy_connect_retries: 3
# Use `curl-impersonate` to pretend to be Chrome when testing proxies. # Use `curl-impersonate` to pretend to be Chrome when testing proxies.
proxy_check_impersonate_chrome: false proxy_check_impersonate_chrome: false

View File

@ -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 {