randomsai Posted April 1, 2010 Share Posted April 1, 2010 i need to connect to a URL in my application, via a proxy connection. it also uses authentication. this is my code so far....does not work <?php $username = 'sastudents/807004261'; $password = '19880609'; $opts = array('http' => array('proxy' => 'HTTP://192.168.224.5:8080', 'request_fulluri' => true)); $context = stream_context_create(array( 'http' => array( 'header' => "Authorization: Basic " . base64_encode("$username:$password") ) )); $data = file_get_contents('http://www.google.com', false, $context); echo $data; ?> Can anyone help me or tell me what the problem is??? Link to comment https://forums.phpfreaks.com/topic/197274-connect-to-url-via-proxy/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.