Suppress http authentication dialogs and use jquery to authenticate http digest to devices on different ports

Suppress http authentication dialogs and use jquery to authenticate http digest to devices on different ports

I have 7 IP cameras on a subnet with a Mac OS X 10.6.x Server. The server hosts the web page that displays mjpg feeds from the cameras.

The feeds are added by appending an image tag to the body of the document - example (not a functioning URL):

<img id="210_camera_mjpg" src="http://domain.com:8110/video2.mjpg" width="320" height="240" />

This is done for each camera, with its corresponding port number and id, of course.

As soon as this html is appended to the document, the camera's http authentication dialog comes up in the browser, and the digest credentials must be manually input.

Since the credentials are the same for all the network cameras, it would be nice if I could collect the credentials with a form on this page before any image tags are added and then use jquery to provide those credentials to the cameras *before* the http authentication dialogs come up, in other words, intercept the "requires authentication" header from the cameras and respond appropriately with jquery, resulting in a seamless one-time authentication. At the moment, the page requests the same credentials 7 times, once for each camera... 

I am imagining that I would have to use some jquery function that can specify headers- the ajax object? There are a few things I am uncertain about - although the WAN IP and domain of the network this is coming from is the same to the outside world, the actual devices serving the data are different and therefore have to broadcast their content on different ports. The server is at 8080, for instance, while each camera is on its own port - 8110, 8111, 8112 etc...

The cameras themselves have built in web servers and the settings I can adjust are limited. I can choose between no authentication, basic or digest. I need the mjpg feeds to be individually available so iPhones can log on and view the cameras individually, hence the digest http authentication... I cannot modify how the content is served or how the cameras process the authentication.

My quest should be relatively simple, but I appear to be missing a few crucial tidbits.

Can ajax(), get() or post() process requests on ports other than those the requesting page is communicating on?
Can I manipulate only the headers that pertain to authentication and then proceed to add the img tags? (I don't know how to get the mjpg stream data into a html object to properly display the data. Please straighten me out if there is a more appropriate way to display mjpg than an image tag!)
How do I properly pass the credentials to the server (camera) without compromising security? (Should I do the whole thing over https instead?) 

Any feedback will be much appreciated, clearly this is the first time I am attempting to do this and have quite a few gaps in knowledge.

Mantsa
    • Topic Participants

    • manca