Schwad Goes Tunneling

Late last year I participated in my first hackathon, with coding legends (in my mind) Tom Mclaughlin, Dan Berger and Michael Alexander. It was insane, and I would heartily recommend the Rails Rumble for those who can’t live in the bay area but still want to hack with their peers in rails.

Tom was our top expert on the devops side of the stack. I remember watching with pure fascination as he spun up “a tunnel” with ngrok, running our app on the web from his machine. I had never heard of such a thing before, it was beautiful, and he whizzed through it like it was a breeze.

(not scary)

Because of this experience, learning how to spin up my own tunnels had been on my to-do list for quite a while. I wanted to:

  1. Have more hands-on experience in server-side tech
  2. Expand my deployment options beyond heroku
  3. Marvel at the ability to make quick changes to toy apps on my machine and see them immediately exposed to the web.

Last weekend I attempted this.

First off, I did not care about a massively technical, scalable rails app, I just wanted to get something rocking and rolling to hook into a tunnel, so I opted for Rails Composer. This is a neat tool I heard of from Ruby Rogues that takes a few CLI queries from you and configures an app to that spec (think auth, db, basic stylesheets, testing, etc).

In action:

Easy peasy.

Next. Download NGROK from their site, try best to follow instructions.

Dude! That was easy! Maybe I *could* save time reading the instructions for IKEA furniture. (Don’t tell my girlfriend I said that.)

I was confused at first. And almost went down the path of learning some NGINX. *gulp*


I had some simple debugging before everything worked just right, but simply put, all I had to do was run my localhost in its own tab (I pick 7890 for literally no reason):

`rails s -p 7890`

Then run the ngrok command in a separate tab to the same port:

`ngrok http 7890`

And BOOM! Magic. Open your tunnel to view your page and as bonus you can open:


To view HTTP requests coming in on your tunnel. Check it (screenshot from while things were still broken)!

The app I hooked into it was Aristocrat Yields, which live-updates and ranks the S&P Aristocrat Stocks based on dividend yields. Something that’s pretty simple but handy enough I might keep it open on a server.

What next? Well, you see, I have this old disused windows machine, and I’ve always been meaning to dive into linux….. and it would make a perfect server in the house……….

UPDATE: NGROK tunnel now running on linux machine, check it out while it’s up here-

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.