[ale] JavaScript and server address

Christopher Fowler cfowler at outpostsentinel.com
Tue Jun 5 10:06:03 EDT 2007


On Tue, 2007-06-05 at 09:59 -0500, Katherine Villyard wrote:
> If that doesn't do it, try having a server side scripting language
> (php, 
> whatever) generate the javascript and let the server include the IP 
> address as a variable in that generated script. 

I'm not sure how well that would work since the interface you are using
on the server all depends on where you are coming from.

Some of these servers could have well eth0, eth1, and pppN.  Depending
on where you are coming from the address could be different.

For example one of my customers has a server on the address of
192.168.0.40 on their internal network.  When I access the web interface
I use 192.168.3.100.  So getting the address of where the page came from
like a Java Applet may do it is the only way for this client program to
make a connection.  I guess server side could do a getsockname() on the
FD and would conclude that 192.168.3.100 is the correct address.  So
your suggestion may work when the address used to connect to the web
server could be from any list of addresses.






More information about the Ale mailing list