This seems like a simple question, but I just can't seem to wrap my head around it...

I have a simple html page. All that html page does is looks to see whether a browser cookie is present, and if it is, it will write a message that says "Found the cookie".

In order for this html page to work, it needs to be opened in a browser using a url that uses a specific domain "mytestsite.org" in the path in order to work. So I want to be able to open that page in a browser using a url like "www.mytestsite.org/mytestpage.html". Easy enough...

When I use this test page locally, I just deploy it to a local JBoss server, then make a mapping in my "hosts" file (I'm on Windows XP), that maps my local IP to "local.mytestsite.org". This tricks the browser into thinking that it is actually getting the page from "mytestsite.org", when it is actually being served by my local JBoss server.

I want to give this html file to another person who is going to use it on their pc. However, they don't have any sort of http server installed, so the little host mapping trick won't work. I don't want to make them go through the trouble of installing a server just to get this test page to work. Additionally, I can't physically put this file on "mytestsite.org".

Any thoughts on how I could open this page through a "mytestsite.org" url through a browser, without actually having it deployed to a server?

  • You could try deploying to a "lite" HTTP server on your colleague's machine, or even IIS, with a similar trick.
    – user3463
    Jan 21 '11 at 21:14
  • That's a great suggestion. Can you recommend a very simple lite http server? Jan 21 '11 at 21:23
  • A light, embedded HTTP server shouldn't be the problem - you still need them to edit their HOSTS file. Jan 21 '11 at 21:32
  • @sinni800 has a good suggestion for the server and the hosts file.
    – user3463
    Jan 22 '11 at 1:09

You will need to supply a very small http server. Try Nginx. It's more of a high-speed server but it's still very compact. As for the hosts file I once created a small tool which edits the host file for you. You can add and remove entries! If you need it, I can translate it to English (it's German right now) and send it to you.

  • OK, marking as the correct answer. They key is hosting somewhere (lightweight http server on their machine, some public hosting service like google apps, your own pc if they have access to your server on the network) and have the user edit their hosts file on their own machine. Jan 24 '11 at 21:01
  • Yes, this is it :)
    – sinni800
    Jan 24 '11 at 22:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.