connect to an external site on internet through a proxy

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
asj123
Forum Newbie
Posts: 2
Joined: Thu Mar 03, 2005 4:25 am

connect to an external site on internet through a proxy

Post by asj123 »

I am trying to connect through a proxy from intranet to a site on internet.
How is proxy support for for eks. fopen(). It seems like there is no support for this in this function.

Alternativelly, is there other function that supports connection through a proxy (requesting a xml file).

Or does anyone know a way to just configure such forwarding in Apache or php.ini?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

just use http://www.php.net/curl. this will save you a lot of time...
asj123
Forum Newbie
Posts: 2
Joined: Thu Mar 03, 2005 4:25 am

Is there any way of setting this up in php.ini

Post by asj123 »

Thanks for fast response. My problem is that the curl will require too much recoding of an application that already exists (uses fopen to request the remote xml). I was hoping there was a way to use fopen with proxy. Or if possible just configure the php.ini to farward some requests from intranet to internet (Someone gave me a tip here, but didn't know how..).

I need a faster solution. I don't have much time to fix this..

Thanks again :?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

you could start reading the manual.... as there is a solution posted in the comments....

http://www.php.net/fopen
Post Reply