I'd like to know if it is possible to write a bit of javascript in a web page to know if the web-page is being hosted remotely or not.
Suppose I go and modify the hosts file and I write 127.0.0.1 www.myexample.com
then I can run locally a webserver and display my test.html page
http://www.myexample.com/test.html
The question is: "can I figure out that I am running locally...?' alternatively can I resolve the www.myexample.com into its address (but I think that's more complicated)