One HTTP Request From Stardom: How Alan Shreve Built ngrok Using Go

February 19, 2016
Written by


Learning a new programming language is as fun as it is challenging. You’ve probably used all sorts of techniques to learn from quickstarts to cloning to banging your head against a manual. If I may butcher the English language – It’s frunstrating (fun + frustrating).

Alan Shreve wanted to learn a new programming language – Go. At the end of his foray into Go he had invented a development tool that tens of thousands of developers use today. This is the story of how Alan Shreve built ngrok.

A Day In The Life of An HTTP Request

I could go my whole life without ever hearing the words “an application error has occurred.” When Alan heard those words, he realized he was completely taking himself out of the development flow, just to make an HTTP request to Twilio.

“I realized I am starting an audio/signaling connection to a cellular tower and it’s being transmitted over the PSTN through multiple providers, into Twilio’s data center which is making an HTTP request to my tunnel services, and then sending it through to my local service. That’s a really, really expensive HTTP request.”

Now he can easily replay HTTP requests and avoid hearing those five words using the tool he built himself.

You give ngrok the port your app is running on, it gives you a hexadecimal address. You paste that address into your Twilio Request URL and you’re good to go. Let the app testing begin. ngrok lets Alan look at all the parameters of the HTTP request without having to press dial again.

It’s so easy that I can show you how to respond to a text using Twilio and ngrok in a few lines of code.

Twilio and ngrok in 5 lines of code

Create an XML file called ngrokmessage.xml with the following code:

<?xml version="1.0" encoding="UTF-8"?>
  <Message> Type whatever your heart desires here</Message>  

Fire up a server of your choice. Let’s say your server is rocking on port 8888.
cd to directory where you downloaded ngrok and enter in the following command:
./ngrok http 8888

Copy your ngrok forwarding url, head on over to and paste it into your Twilio number’s messaging request URL field. Add the file extension to the forwarding url so it reads like

http:// Your Ngrok Forwarding

Done. You can now text that number and receive the response that you wrote. You can see what I wrote by texting 703-997-7548

Now, back to the story.

ngrok Almost Didn’t Happen

Today over 40,000 developers use ngrok. It’s an incredibly handy tool to use when you’re developing an app. But, Alan almost didn’t build the app. He thought it had been done before and he was right. LocalTunnel was already widely used at the time. But, Alan’s desire to learn Go sent him on the path to creating ngrok.

The Go Community

“I actually built it to learn Go,” Alan admits. “I guess the third priority was to make web development easier.”

What was a third-tier priority is now a strong suit for ngrok. This didn’t happen by accident. Alan got feedback from developers using ngrok, asked fellow developers colleagues what they thought, and relied on the input of the Go community.

“ngrok’s success as a project is due in no small part to choosing Go as the implementation language,” said Alan.

Without that community, ngrok might not be where it is today, and your HTTP request might have a few more hoops to jump through before they make it to your local tunnel.

The SIGNAL Community

Alan’s story is a testament to the builder, and the importance of the developer community that surrounds those builders. SIGNAL is a celebration of that ethos, and that community. It wouldn’t be the same without you there. We hope you’ll join us for a conference that’s inspired by communications but defined by the community. Register here.