I need some advice.
My situation is this:
I have a router with OpenWrt(Linux distribution) installed and a web server configured in it. This router act as a client in a local network.
I have created a simple web page on the Internet that enable the login to the openwrt web server.while I have to check whether the user, who request to login and the router are located in the same local network before I redirect the user. I have the IP of the router in the local network, which is always being updated remotely.
I tried to do something like this:
(The only way that worked so far for me..)
Image im = Image();
im.src = "http://" + ip + "/some_image.png";
return (im.width>0 || im.height>0 )
Is there any way that I can read some text file from the router instead ??
I tried loading a text file from the router into an iframe and then extracting the text value with JS from that iframe but for security reasons the browser does not allow it.
As far as I know the only way to read a text file would be using ajax,
but that is also disabled since the request is for another domain.
By the way, for some reason my solution does not always work.
Sometimes my function returns false, even when the image was loaded successfully in the remote page.(into a div for example)
side language can reach to computer inside a home network when the only data available is the local IP address.
Any help would be appreciated!