fopen behind proxies
I'm need a little help. I've been playing around with fopen and I am having troubles blasting through my proxy. Here is the error message I get:
And here is the code I'm using to access the feed:
Thanks in advance.
Warning: fopen(http://www.audioscrobbler.com/rss/history.php?username=novasoy/) [function.fopen.html]: failed to open stream: Bad file descriptor in c:\inetpub\wwwroot\testing\scrobbler.php on line 23
could not open Audioscrobbler feedAnd here is the code I'm using to access the feed:
$opts = array(
'http'=>array(
'proxy'=>"http://proxy:8080"));
$context = stream_context_create($opts);
// Define the URL to user's Audioscrobbler XML/RDF feed
define("AUDIOSCROBBLER_RDF", "http://www.audioscrobbler.com/rss/history.php?username=novasoy/");
// Truncate (shorten) song titles?
define("TRUNCATE", TRUE);
define("TRUNCATE_LENGTH", 32);
// Try to open Audioscrobbler feed
if (!($fp = fopen(AUDIOSCROBBLER_RDF, "r", false, $context))) { die("could not open Audioscrobbler feed"); }
/*if (!($fp = fget_proxy(AUDIOSCROBBLER_RDF))) { die("could not open Audioscrobbler feed"); }*/
$rdf_content = @get_file_contents(AUDIOSCROBBLER_RDF);
if(!$rdf_content) die("unable to open feed");
/*** and then it continues with parsing the feed ****/Thanks in advance.
