Hello list,Currently curl, when used with --connect-timeout option, uses it as a global timeout for the whole connection set, decreasing the timeout for each IP address in half every connection attempt.
If several IP addresses from the top of DNS resolution are not working, the others (potentially working ones) just won't get enough timeout to establish the connection.
Take a look: $ dig +short proxy-ssl.antizapret.prostovpn.org | xargs echo51.77.61.44 51.38.124.100 51.89.143.227 46.105.53.114 51.77.61.42 141.95.37.139 46.105.53.157 46.105.53.63 51.77.61.38 51.15.64.69 46.105.53.150
$ curl --connect-timeout 5 https://proxy-ssl.antizapret.prostovpn.org --interface lo -v
* processing: https://proxy-ssl.antizapret.prostovpn.org * Trying 51.77.61.42:443... * ipv4 connect timeout after 2499ms, move on! * Trying 51.77.61.44:443... * ipv4 connect timeout after 1250ms, move on! * Trying 46.105.53.63:443... * ipv4 connect timeout after 624ms, move on! * Trying 51.15.64.69:443... * ipv4 connect timeout after 312ms, move on! * Trying 51.89.143.227:443... * ipv4 connect timeout after 155ms, move on! * Trying 46.105.53.150:443... * ipv4 connect timeout after 77ms, move on! * Trying 46.105.53.114:443... * ipv4 connect timeout after 38ms, move on! * Trying 46.105.53.157:443... * ipv4 connect timeout after 19ms, move on! * Trying 141.95.37.139:443... * ipv4 connect timeout after 9ms, move on! * Trying 51.38.124.100:443... * ipv4 connect timeout after 5ms, move on! * Trying 51.77.61.38:443... * ipv4 connect timeout after 4ms, move on!* Failed to connect to proxy-ssl.antizapret.prostovpn.org port 443 after 5000 ms: Timeout was reached
* Closing connectioncurl: (28) Failed to connect to proxy-ssl.antizapret.prostovpn.org port 443 after 5000 ms: Timeout was reached
This applies to both curl CLI and libcurl, --max-time / CURLOPT_TIMEOUT does not change the behavior of connection timeout.
Is there any way to change this behavior, to make connect-timeout to apply for each IP address individually?
Thanks.
OpenPGP_signature.asc
Description: OpenPGP digital signature
-- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users Etiquette: https://curl.se/mail/etiquette.html