PDA

View Full Version : Do js files execute server side?



kmax1940
06-30-2006, 09:22 AM
I am working with an activex control for video.

I would like to be able to use a "local" ip address from my web server instead of a public one.... then have it execute server side...

because i am using apache to forward to local ip to the real public ip...

anyway, anyone know if js files execute server side? would a local ip work or would it have to be public ip?

djr33
06-30-2006, 09:27 AM
What's the IP actually being used for? Just with javascript/activeX?

I believe the browser will usually work with the real IP because that's just how it's configured. If you are accessing a local page, I'm not sure how that is treated.
If it's a page that is on the network, that might use the local IP.

Why?

As for the big question, no, Javascript is totally client side. Not sure if that does mean it will use the local IP, though.

kmax1940
06-30-2006, 09:32 AM
thanks... the ip is a public ip of a video server...

thats what i was afraid of... i dont think it will work with anything but a public ip because when the users views the page in the browser it is basically running from their computer.... not the web server....

i was hoping that the javascript would execute on the web server...
then i could use an ip local to the server...

then have apache forward that local ip out to the real video serv. ip.

so all the user would be able to browse to is a local address.

thanks for the quick reply and your help.

djr33
06-30-2006, 09:37 AM
You could use a serverside code, but that isn't live... it's only accessible when a page loads.

.jsp is a java server page... like php, but a bit more like javascript (though don't get java and javascript confused.)


Not really sure how to fix the problem.

Let's take a step back, though... what exactly is the "problem"? and is this the only solution?

kmax1940
06-30-2006, 09:40 AM
oh boy... well i wont get into the whole long thing...

the activex control has the ip of a video server in it.
would like to stop web users from being able to save source and run video from anywhere.... unless the page is on our web server....

so say... they could not save the source as a html page and run it from the desktop...

have work with proxypass, iptables etc to do this...
gotten close but no luck...

i was shooting in the dark that maybe js files would execute server side...
so i could actually include a local ip in the activex object...

then have the server forward that local to the real public ip in the background.

if it does not execute server side then i could never use a local ip in there... because it is executing from the users pc....

thanks again

djr33
06-30-2006, 10:01 AM
Well... yeah. If you can use a serverside language, go for it.

However, it will always be possible to get around the file protection. It usually does nothing. Sounds like you've got some advanced stuff, but by using activeX, you're already limiting it to IE 6 on PCs. Ouch.

Twey
06-30-2006, 12:02 PM
I see what you're saying. You have a streaming video server, and you want to periodically save clips of it then only allow the user access to those clips. That's the only way I can think of that you'll achieve this.