Menu

socks5 ?

Help
Anonymous
2016-05-12
2016-12-05
  • Anonymous

    Anonymous - 2016-05-12

    Hi! I see it's possible to use a proxy, but.. my proxy works through socks5, it's possible to implement or use it ? thanks!! :)

     
  • Anonymous

    Anonymous - 2016-11-20

    Is it possible?

     
  • James Shaver

    James Shaver - 2016-11-22
     
    • Anonymous

      Anonymous - 2016-11-28

      Thanks for your reply but it seems this proxy it's only http proxy. I read that Socks5 proxy are not directly provided by PHP but implementable with some libraries. So a modification of the PHPCrawl is needed to implement socks5 proxy

       
  • Anonymous

    Anonymous - 2016-11-28

    since cURL 7.21.7, you can use CURLOPT_PROXY and specify the SOCKS protocol:
    $crawler->setProxy("socks5://x.x.x.x", 1080);

     
    • Anonymous

      Anonymous - 2016-12-05

      Thanks a lot!

       
    • Anonymous

      Anonymous - 2017-07-12

      This don't run for me, i have curl 7.47 but if i try this into my code raise me this error : Unable to connect to proxy 'socks5://127.0.0.1' on port '1080'.

       

      Last edit: Anonymous 2017-07-12
    • Anonymous

      Anonymous - 2017-08-04

      The crawler don't use curl, the function setProxy recall this function: stream_socket_client($this->proxy["proxy_host"].":".$this->proxy["proxy_port"], $error_code, $error_str,$this->socketConnectTimeout, STREAM_CLIENT_CONNECT);
      i try to exec this with socks5 but the error is: “unable to connect to socks5://127.0.0.1:1080 (Unable to find the socket transport "socks5" - did you forget to enable it when you configured PHP?)”

       
  • James Shaver

    James Shaver - 2017-07-12

    Have you tried hitting the proxy outside of phpcrawl?

    $url = "https://google.com";
    $proxy = "127.0.0.1:1080";
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,$url);
    curl_setopt($ch, CURLOPT_PROXY, $proxy);
    curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_exec($ch);
    curl_close($ch);
    
     
  • Anonymous

    Anonymous - 2017-07-12

    yes in this way i can hit the proxy but how can i pass it to the crawler?

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.