kranthi117 Posted January 6, 2008 Share Posted January 6, 2008 i want to use a http proxy to connect to the internet via php <?php $context = stream_context_create( array('http'=> array('proxy'=>'http://proxy.example.com:5100') )); $contents = file_get_contents('http://www.somesite.com/pat/to/file', false, $context); ?> this is all what i need except that it gives the following error Unable to find the socket transport "http" - did you forget to enable it when you configured PHP? but i want to use a proxy every time i connect to the internet for example i want to use http://magpierss.sourceforge.net/ via a proxy moreover i want to use a socks proxy along with mail function to bypass my ISP's firewall which blocks port 25 Quote Link to comment https://forums.phpfreaks.com/topic/84696-php-and-proxy/ Share on other sites More sharing options...
kranthi117 Posted January 7, 2008 Author Share Posted January 7, 2008 ny solution??? Quote Link to comment https://forums.phpfreaks.com/topic/84696-php-and-proxy/#findComment-432595 Share on other sites More sharing options...
Ken2k7 Posted January 7, 2008 Share Posted January 7, 2008 I may be wrong here, but do you mean fopen("URL", "r", false $context); Then you need to fix your $context to be something like: $context = stream_context_create( array('http'=> array('method'=> "POST" 'header' => "SOME HEADER HERE")); It's like cURL, which I'm not an expert at. Quote Link to comment https://forums.phpfreaks.com/topic/84696-php-and-proxy/#findComment-432621 Share on other sites More sharing options...
kranthi117 Posted January 7, 2008 Author Share Posted January 7, 2008 well my problem is that i want to acess the internet through PHP(which is executed through apache on local computer) and php should connect to internet through a proxy server i need a configuration in php.ini(or some thing like that) which does the exact work of CURLOPT_PROXY in cURL Quote Link to comment https://forums.phpfreaks.com/topic/84696-php-and-proxy/#findComment-432624 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.