Page 1 of 1

Proxy Authentication [Resolved]

Posted: Mon Jul 17, 2006 5:05 am
by thomas777neo
Hi All

I have a php script that runs on a server that connects through a proxy to access the net.

My problem is that I need to authenticate to the proxy server before I can do anything.

Here is a snippet of the code that fails due to the non-proxy authentication:

Code: Select all

$lines = file("http://www.xyz.co.za/incsms/sms_msgs.txt");
What can I do to have my script authenticate to the proxy server first?

Any help would be great. Thanks.

Edit:
I used this class found at

http://snoopy.sourceforge.net/

Just included the class, filled in the proxy settings. And it worked !!!

Thanks to anybody who started investigating the issue

Posted: Tue Jul 18, 2006 10:00 am
by eXpertPHP

Code: Select all

$vcontext = array('http' => array('proxy' => 'tcp://127.0.0.1:8080', 'request_fulluri' => true));
$resource = stream_context_create($vcontext);
$lines = file("http://www.xyz.co.za/incsms/sms_msgs.txt", false, $resource);