Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Connect to site via proxy?

    Hi there, I've been searching for a way to connect to websites using proxies, but I've yet to find anything that works.


    I want to be able to connect via a proxy that uses user/password authentication. Whether be socks5 or a http proxy running on port 8080.

    So what the script would do is connect to lets say www.google.com on socks5 ip of x.x.x.x on port 1080 with username socksuser and password sockspass.


    Is this possible?


    Any help appreciated

  • #2
    New to the CF scene
    Join Date
    Sep 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK, so the following works:

    Code:
    <?php
    $params = array
    (
    	'http' => array
    	(
    		'method' => 'GET',
    		'header'  => 'Proxy-Authorization: Basic ' . base64_encode(USERNAME . ':' . PASSWORD) . "\r\n\r\n",
    		'proxy' => 'tcp://74.xx.61.xxx:6xx99',
    		'request_fulluri' => true,
    	)
    );
    $context = stream_context_create($params);
    echo file_get_contents('http://ipchicken.com', null, $context);
    
    
    ?>
    The only thing is I cannot get it to work with ssl/https. I've tried SSL context, but I am still very confused.


    Any ideas?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •