Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy my curl connect_time is always equal to 0?
    primarykey
    data
    text
    <p>I'm trying to test some SOCKS proxy, and when trying to get the "ping" time of this proxy, I'm looking for the variable "connect_time". For HTTP and HTTPS proxy, this seems to working fine, but not for SOCKS (SOCKS4 or SOCKS5) proxy where the connect_time is always equal to 0 (or almost...) !</p> <pre><code>{ "url":"XXX", "content_type":"text/html", "http_code":200, "header_size":178, "request_size":379, "filetime":-1, "ssl_verify_result":0, "redirect_count":0, "total_time":4.738683, "namelookup_time":0.000021, "connect_time":0.000023, "pretransfer_time":0.000104, "size_upload":140, "size_download":51275, "speed_download":10820, "speed_upload":29, "download_content_length":-1, "upload_content_length":140, "starttransfer_time":0.000149, "redirect_time":0, "certinfo":{ }, "redirect_url":"" } </code></pre> <p>Here is a piece of my code :</p> <pre><code>$options = array( CURLOPT_PROXY =&gt; $proxy-&gt;ip.':'.$proxy-&gt;port, CURLOPT_TIMEOUT =&gt; 30, CURLOPT_CONNECTTIMEOUT =&gt; 30, CURLOPT_HEADER =&gt; false, CURLOPT_RETURNTRANSFER =&gt; true, CURLOPT_HTTPHEADER =&gt; array('Expect:'), CURLOPT_SSL_VERIFYHOST =&gt; false, CURLOPT_SSL_VERIFYPEER =&gt; false, CURLOPT_VERBOSE =&gt; FALSE, CURLOPT_USERAGENT =&gt; 'XXX', ); if ($proxy-&gt;type == 'https') curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); elseif ($proxy-&gt;type == 'socks4') curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4); elseif ($proxy-&gt;type == 'socks5') curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); </code></pre> <p>When trying to ping (with <code>ping</code>...) this proxy from my computer, I've a ping time of about 50ms...</p> <p>Is there a bug with curl or php ? Do you know can I retrieve the correct ping time ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload