Using the Tropo Web API behind a firewall with Tunnlr

February 24th, 2010 by Jason Goecke

Many times we find ourselves sitting behind networks without the ability to open a TCP port to hack on our web services. This may be at a coffee shop, a corporate network or that guest network you just connected to at your developer meetup. We have a solution for that.

In steps Tunnlr, a great little service by the folks at ElevatedRails. With Tunnlr, you are able to create a reverse SSH tunnel to a port on your computer. While they do have a plug-in for Ruby on Rails, this may be used to redirect traffic to any application running on a port. In this example I will walk you through how to do this using another Ruby web framework, Sinatra.

The first step is to sign-up for a Tunnlr account. You may select a single plan for USD$5 per month, but you get a 90-day free trial with no credit card required at sign-up. Once you have signed-up and verified your account, they will then provide you with a URL to use to access your tunnel. You will also need to provide them with your public SSH key in your account.

Tunnlr

Once you have this setup, then you need to create the tunnel from your computer. I created a shell script that I may run each time I want to have a tunnel.

create_tunnel.sh

Then, fire up your tunnel in a terminal window. Terminal — ssh — 80×24

Now that the hard part is over, write a Sinatra (or any others) app using our Tropo-WebAPI-Ruby gem and run it on the port you specified in your shell script above.

tunnlr_sample.rb

Thats it, now your Tropo WebAPI app is ready to run behind any firewall. Now you may demonstrate Tropo at that next developer meetup!

Related posts:

  1. WebAPI Tips & Tricks
  2. Ruby on Rails Example for Tropo Web API without port forwarding!
  3. Send a Fax with your Voice!
  4. New tropo-webapi-ruby Gem Released
  5. How-To: Sending an SMS using WebAPI

Tags: , , , , , , , , ,

4 Tweets

3 Responses to “Using the Tropo Web API behind a firewall with Tunnlr”

Leave a Reply

Please note: By submitting a comment you agree to comply with our Comment Policy. We welcome all comments, positive or negative, but do reserve the right to remove all or part of blog comments that do not comply with our policy.

Additionally, the first time you leave a comment on this blog, it will be held for moderation. After that first comment has been approved, future comments will be posted without delay.

Additional comments powered by BackType