[Javascript] Forward image via http with ajax

Terry Riegel riegel at clearimageonline.com
Sat Feb 3 06:52:31 CST 2007


John,

Your understanding of the problem I am attempting to solve is missing  
some pieces. The main one is your assumption that the browser  
computer is sitting on the WAN, it is not it is on the LAN. See my  
inline comments below.

You may have been looking at the details of my code and come to that  
conclusion. I am just testing on a server so the URL's might lead you  
to believe the setup is different then outlined here.

Terry


On Feb 3, 2007, at 6:56 AM, John Warner wrote:

> How can you contact the cgi script on the server on the camera behind
> NAT from the Internet? Example:
>
> Camera 192.168.1.75
> Router 192.168.1.1 (LAN) 205.162.25.26 (WAN)
>
> What call does the browser on the Internet make to get to the camera
> without port forwarding?

The browser is not on the internet (WAN), it is on the same network  
(LAN) as the camera

Camera 192.168.1.75
Browser 192.168.1.76
Router 192.168.1.1 (LAN) 205.162.25.26 (WAN)
Server 205.162.25.27 (WAN)

So it really isn't a network issue as the browser can communicate  
with camera (it can pull the image) and it can communicate with the  
server (it can push stuff to it). The browser is the tool I am trying  
to use to take the picture and place it on the server.

> Mind this isn't so much a developer question as
> a networking question. How would the browser making an HTTP request to
> 205.162.25.26 get to the cgi script on the camera with an IP of
> 192.168.1.75?

No that is not the issue. The computer is on the LAN, not the WAN.

> Have you considered a Web Service on the LAN, but this would need
> forwarding or the computer would need to be put in the DMZ.
>
> There is just no way to handle this otherwise, it isn't a programming
> issue so much as a networking problem if I read you correctly below. I
> don't think a Java applet pushed out to the clients would solve this
> without first addressing the network issue. But the platforms you
> mention below all have a JVM available though Palm's is obviously  
> rather
> limited. Note you mention AJAX for this, but does the Palm OS browser
> support JavaScript? I just don't see anyway you can handle this  
> without
> setting a 'server' out in the DMZ or port forward to it. Something  
> other
> then the router is going to have to be able to respond when a request
> comes in from WAN address. What platform is most common on this LAN
> behind the router, Windows?
>
> John Warner
>
>
>> -----Original Message-----
>> From: javascript-bounces at LaTech.edu
>> [mailto:javascript-bounces at LaTech.edu] On Behalf Of Terry Riegel
>> Sent: Friday, February 02, 2007 8:59 PM
>> To: [JavaScript List]
>> Subject: Re: [Javascript] Forward image via http with ajax
>>
>>
>> Mike,
>>
>> Thanks for your comments. After reading your comments I got the
>> feeling you may have missed my earlier post to Billy Reisinger. I
>> explained with a fair amount of detail what the bigger picture is.
>> That with my "more terse" comments below should help you understand
>> my requirements.
>>
>> Thanks,
>>
>> Terry
>>
>>
>>> You're talking about taking a single picture, not setting up a
>>> streaming video server, right?
>>
>> yes
>>
>>
>>> You absolutely cannot have the user pick the file they create with
>>> the camera?
>>
>> Absolutely do not want to even have a file on the computer,
>> just want
>> to get it from the camera to the web server w/o port forwarding (NAT
>> - Network Address Translation, this is how several computers can be
>> "on the internet" with just one router.), and with zero setup on the
>> client computer. The only requirement for the client machine is a
>> working web browser.
>>
>>> Can you use Java?  You might need a signed script to not bug the
>>> user with lowering their security.  A Java applet could be called
>>> from client-side javascript in your page.
>>
>> This is the only option I see meeting most of my requirements, but I
>> am generally averse to the idea.
>>
>>> Another option would be to compile an app for download that could
>>> use xmlhttp outside the browser (or FTP, Soap, whatever)
>>
>> Not really this would only work if I had control of the
>> computer that
>> would be doing the transfer, something I may or may not have control
>> of. It should work on a borrowed computer. Compiling usually means
>> you are limited to a particular platform, or platform(s), but it
>> would not be feasible to compile for
>> Windows/Linux/FreeBSD/Solaris/OS
>> X/Palm,... as all of these platforms have web browsers. And what
>> about the web browsers that run on platforms I didn't mention.
>>
>>> It sounded like you are trying to minimize complexity for the user,
>>> which typically means an increase in complexity for the
>> developer.  :)
>>
>> Yes, I am, yes it does.
>>
>>> Since they're already accepting the complexity of the camera hookup
>>> and software, you might be able to bundle a "does it all"
>>> application to manage it.
>>
>> Not true. They do nothing to connect to the camera, except
>> open their
>> web browser. This is an IP camera it doesn't connect to a computer,
>> it connects to an ethernet hub or router. As long as the browser can
>> display jpg images (even that isn't required) the application should
>> work.
>>
>>> Just curious, what do you mean "..without configuring a router to
>>> port forward"?
>>
>> google "port forward".
>>
>>
>>>> I am working with a IP camera that is able to display an image on
>>>> my  web browser (since my computer and the camera are on the same
>>>> network  intranet) I would like to push that image via javascript
>>>> up to my web  server (internet). This would allow me capture an
>>>> image without configuring a router to port forward.
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>




More information about the Javascript mailing list