I have web cam, and for access to web cam is requiring Http Authentication. I tried hard, but I didn't find working solution. Idea was to do something like this, to do Automating HTTP Authentication:
Code: Select all
$sAuth = base64_encode("webcam:webcam");
$sHTTP = "GET /cgi-bin/video.jpg HTTP/1.1\r\n
Accept: image/jpeg\r\n
Connection: close\r\n
Host: 192.168.1.10\r\n";
$hSocket = fsockopen("192.168.1.10", 80);
fputs($hSocket, $sHTTP.$sAuth."\r\n");
fclose($hSocket);http://www.informit.com/articles/articl ... 55423&rl=1
Server(Web cam) is just returning HTTP/1.0 200 OK, but when I try to click to view image, immediately is again asking for authorization.
Nothing is working. Does anybody know easy way in PHP how to sort out problem Automating HTTP Authentication?