Our web application involves accessing a network camera stream, which is secured with a password for the 'root' account. When we try to connect to the camera through the web page, a login prompt appears.
We are in need of an automated authentication script or code, ideally in Javascript, to address this issue. We attempted to use XMLHttpObject.open(), as it prompts for both username and password; however, our current implementation is not functioning effectively:
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "POST", "http://192.168.16.140/video.mjpg", true, "root", "password");
xmlHttp.send( null );
In a previous project using a C application and libcurl to connect to the same camera, we successfully retrieved a screenshot using CURLOPT_USERPWD. We are seeking a similar solution in Javascript and hope to gain a better understanding of how the libcurl command operates.
We anticipate finding a resolution promptly, but if there happens to be a simple fix available via search engines, we may need to prove ourselves as adept Google ninjas after all.