Back in November, I <a href="http://blog.reybango.com/2014/11/03/a-new-way-to-test-internet-explorer-on-os-x-ios-and-android/">wrote about RemoteIE</a> which is a tool we created to allow developers on non-Windows OSes to test Internet Explorer 11. It uses Microsoft's RemoteApp virtualization software to create a virtualized IE11 without the need to install a VM. The tool has been a hit and developers have been sending us a lot of requests to expand it out to other versions of IE.

One of the big limitations, though, is the fact that you can't access resources or sites locally hosted on your development machine. This is a cumbersome limitation and narrows the usability of the tool for testing. It's been nagging at me for awhile that we couldn't use this in this fashion but this past week I found a solution that I wanted to share.

<h2>ngrok - Secure Tunnels to localhost</h2>

Enter <a href="https://ngrok.com/">ngrok</a>, a very cool, lightweight tool that creates a secure tunnel on your local machine along with a public URL you can use for browsing your local site. 

<a href="https://ngrok.com/"><img src="http://reybango.com/images/ngrok.png" width="1200" height="800" class="alignleft" /></a>

When ngrok is running, it listens on the same port that you're local web server is running on and proxies external requests to your local machine. This was the secret sauce I was looking for to allow RemoteIE to be able to test local sites on my Macbook.

Getting it to work was simple. ngrok comes as an archived download and extracting it gives you the actual app. You need to decide where to place it. In my case, I moved it to <em>/usr/local/bin</em> which is where I prefer to keep my non-OS executables. You can place it anywhere as long as it's available in your path or your symlink it.

From there, it's a simple step to get it to listen to your web server. Say you're running your local web server on port 8080. In terminal, you'd type in: 

<em>ngrok http 8080</em>

which starts ngrok listening on port 8080 and creating the secure tunnel:

<img src="http://reybango.com/images/ngrok-terminal.png" width="657" height="264" class="alignleft" />

It also creates two sets of publicly available URLs that map to your local web server:

Forwarding http://5057493e.ngrok.io -> localhost:8080
Forwarding https://5057493e.ngrok.io -> localhost:8080

These are unique URLs that created each time you restart ngrok making it easy to share these out for one-time testing sessions across a team.


