Share your local server

When working with the UI of an application I often find myself having my rails server running and switching back and forward between my IDE and the browser. Let's say you want you peer to view the application during a Pair Programming session and actively follow your work and/or try out the app on a different browser, on a mobile device, etc. She/He can most certainly fire up his own server and pull down the latest code from your shared repository as you push it up. Yeah, sure...

I found a better solution in a free service called ProxyLocal. What it does is it proxies your local web-server and make it publicly available over the internet. You'll get a temporary uri that can be used to access your local server. Usage is dead simple and I can tell you that I have found it most useful in pairing sessions.


In your terminal window, run:

$ gem install proxylocal

Fire up your local server as you usually do:

$ rails s

Assuming that it runs on port 3000, you'll get a temporary uri by opening a new terminal tab/window and running:

$ proxylocal 3000 --host my-application
Local server on port 3000 is now publicly available via:

You can skip the --host option and let the gem generate a random 4 digit/letter code that will be part of the url as a subdomain, but I personally find it more convenient to set that myself.

Now you can share that uri with your peer or use it yourself on another devise.

Once you stop your locar server, you'll get an error: empty_response in the browser. Once you restart the server - the uri is valid again and the site goes back up.


It seems that google font are not being loaded. Let me know if you find other issues with this method.

comments powered by Disqus