Easier proxy browser testing with localtunnel

Ivan Nikolić
Trikoder
Published in
2 min readApr 25, 2014

--

How do you test your local projects in browsers such as Opera Mini? In this post we will show one method we use in Trikoder to do that.

We’ve already talked about cross-platform local testing of projects and this works as advertised for standard browsers. But what about proxy browsers such as Opera Mini?

First of all, what are proxy browsers? You can read detailed description on Wikipedia, but basically they send web page content to one of proxy servers and those same servers return highly compressed output suitable for low-powered devices and slow internet connections, tipically found on feature phones. This type of web browsing is very popular in third-world countries and even in places with high-bandwidth internet because it allows users to have more lightweight experience without high bandwidth cost.

So, we can already see one problem with testing your local content on these types of browsers, and that is proxy server access to your machine. Since your machine is usually not available to public, proxy servers can’t access any content.

One of the most convenient ways to get around that restriction is creating tunnels to your machine, which is well known to seasoned developers. What I’m about to show here is similar to that method, but with more accessible interface for beginners and those not well versed in advanced networking concepts.

Localtunnel is a simple service which allows you to “tunnel” your “local” project to outside world for easier testing. It’s written in JavaScript and runs on Node. If your project is not Node specific, most of the time you would use it via command line and installed as global Node package. This is also the method we will show in this post.

When you install it, usage is pretty simple.

lt --port 80 --local-host example.loc --subdomain example

What this line of command does is it tunnels port 80 (standard http port) and your virtual host “example.loc” to subdomain “example.localtunnel.me”. Simple as that. This is the most basic example, and one you would use most of the time.

Now, if you visit this tunneled URL in Opera Mini browser, you would see content rendered from your local instance of project. Response speed from proxy server depends on your internet connection, so longer times are expected if you are not on high-bandwidth internet connection.

Do you have any other method with which you test your projects in proxy browsers? If so, share with us in the comments!

Thank you for reading. Please comment, like or share it with your friends and we hope to see you soon.

Would you like to join us? Check out the open positions at our Careers page.

Trikoder provides high-class software development. We analyse, strategize, design, code and develop complex web systems.

--

--