Question

Is there a configuration/setting for the Wowza server that must be correct to allow HTTP Authentication?

According to How to get realtime connection counts from Wowza Media Server, I should be able to get some XML information that I need. If I go to the url from a browser, it prompts for username/password, and I get the data, but if I try to accomplish it from PHP it fails no matter what method I use:

HTTP request failed! HTTP/1.0 401 Unauthorized

Method #1:

$data = file_get_contents('http://admin:password@123.123.123.123:8086/connectioncounts');

Method #2:

$handle = fopen('http://admin:password@123.123.123.123:8086/connectioncounts', "r") 

Method #3:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, http://123.123.123.123:8086/connectioncounts);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "admin:password");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$output = curl_exec($ch);
Was it helpful?

Solution

Try change CURLAUTH_BASIC to CURLAUTH_ANY

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top