tags:

views:

24

answers:

2

I have never delt with proxies but now I have to. The program is a PHP parser that scraps several websites to retrieve need info. I just need to know how PHP programs work via proxies... how to make them work via proxies.

Thanks for any help!

+2  A: 

You can use curl with CURLOPT_PROXY Option.

http://www.php.net/manual/en/function.curl-setopt.php

Shubham
+1  A: 

http://php.net/stream_context_create

For example:

<?php
    $opts = array ( 'http' => array ( 'proxy' => 'tcp://proxy:8080', 'request_fulluri' => true ) ) ;
    $context = stream_context_create ( $opts ) ;
    $f = file_get_contents ( 'http://yoururl/', false, $context ) ;
Bergi