Suppose you developed a website to show to others. You have it running on your laptop. What choices do you have?
You can setup a livemeeting: This is what we seem to do in most companies.
- That means you are going to show the demo. Unless you are going be physically there, they cannot access it.
- If the audience wants to try out the website, you need to hand over control.
After all, your goal is not just to demo the site by yourself, but to let others play with it.
Here is one alternative, using ngrok:
The beauty of this software is that it needs no installation. Just one executable. You can even carry it in a thumb drive! It is around 1.7MB zipped and 6MB sized executable.
The next step is to run it. Suppose I have a server running on port 8000. Here is the way I expose it to the world:
Now, what you can see is this: Your port 8000 is proxied through the open web under the name: http://65dc9ab7.ngrok.com
Before going there, here is how the website looks on the local page:
Notice that the host is localhost. If your friends try on their machine, they will not see these files.
Now, let us go to the http://65dc9ab7.ngrok.com that ngrok gave us from some other machine and see it:
Here are some other fun things to do:
Suppose your users are playing around on the site. You can see all their interactions from http://localhost:4040/
Let us see how that looks. I am going to access 1.html, 2.html and a1.html via the ngrok proxy.
That is, you get to see who is accessing your site, from where they are coming and what is happening. You can replay the entire web interaction too! This can be a simple, yet powerful debugging tool.
Now, let us look at other use cases.
Serving files from your machine
Suppose you have a bunch of files that you want to share with others. You can do the following:
- Install python (3.3.x will do nicely).
- Run the following command from the folder where you want to share the files from: python –m http.server. You can optionally specify the port number as well.
Logging into your machine from outside
Now, suppose you got a Unix machine behind the firewall and you want to be able to access it. Here is what you can do.
- Install shell in a box: https://code.google.com/p/shellinabox/
- Run the shell – by default on port 4200.
- Now, run ngrok to proxy 4200.
- Presto! Instant access from the internet to login to your Unix box.
Caution: Your acceptable user policies may vary. Please verify with your system admins to find out if you are allowed to run any of these programs.