On 4 February 2010 12:48, kranthi <kranthi...@gmail.com> wrote:
> Hi all,
>
> I want to run fsockopen etc behind a proxy.
> proxychains (http://proxychains.sourceforge.net/) may be helpful,
> unfortunately the support for that is pretty bad. Please inform me of other
> alternatives
>
> KK.
>

I used to use a proxy written in Python which provided the client NTLM
authentication to our ISA server for PHP.

So, PHP script talked to NTLM Authentication Proxy Server which talked
to ISA which talked to the outside world.

Worked fine.

The only thing I needed to do in PHP was setup a default context and
all my normal file_get_contents(),etc. which needed to communicate
through to the outside world worked fine.

Here is the code I used ...

// Define the default, system-wide context.
$r_default_context = stream_context_get_default
        (
        array
                (
                'http' => array
                        ( // All HTTP requests are passed through the local 
NTLM proxy
server on port 8080.
                        'proxy' => 'tcp://127.0.0.1:8080',
                        'request_fulluri' => True,
                        ),
                )
        );

// Though we said system wide, some extensions need a little coaxing.
libxml_set_streams_context($r_default_context);



So, set the proxy tcp address appropriately, put this code in a global
include file (maybe via the auto_prepend_file= ini file setting) and
see how you go.



-- 
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to