loading...

The Happy World of ngrok

lssweatherhead profile image Laura Weatherhead ・2 min read

Current favourite tool: ngrok

  • Have you ever wanted to share something still in development with a product manager, project manager or even another developer just so they could give it a quick click through, maybe give you some pointers, nothing too intense?
  • Have you ever been working with a third-party service (Mailchimp, SendGrid, SparkPost, Twilio, Authy, the list goes on…) and want to use a webhook to channel data around on a dev site?
  • Have you ever been giving a dev talk and thought “it would be great if people could just access this site I’m running locally”, but you don’t want to deploy anything?

Ngrok is the answer. It’s a command line tool that gives access to your local server using a secure URL and an excellent debugging/inspection panel to boot.

It is the best thing. No, really. I am prone to occasional geeking-out on technology-fronts (a certain ramble about how finding the perfect monitor configuration could equate to finding true love springs to mind), but trust me on this one.

Reasons why you should love ngrok as much as I do:

  1. It’s free! (I mean, you can pay if you want custom subdomains etc, but for most development/testing needs the free version is where it’s at)
  2. It’s as easy as cmd ngrok http 80 and boom, you’re up and running
  3. But what if you’re running on IIS express? That’s super easy too: ngrok http -host-header="localhost:[port-number]" [port-number]
  4. The inspection panel is unexpectedly helpful, I’ve never felt so supported by a tool. I mean, I love Fiddler, but there’s just so much functionality I often feel like I’m shortchanging it a bit... (like someone built me a mansion and I’ve moved into the larder to live)

Just to be clear, I am in no way affiliated with ngrok or it’s devs, I am just excitable when it comes to speeding up my own dev processes!

Download it here: https://ngrok.com/download

Discussion

pic
Editor guide
Collapse
flexdinesh profile image
Dinesh Pandiyan

ngrok is my most favourite utility for web app development.

It helps a lot especially when you're developing serverless apps or apps that talk to other entities in the internet. All you gotta do is setup a local server and hook ngrok to your app and see how it works in the cloud.

I'll consider it to be one of the most underrated tools used today.

Collapse
k4ml profile image
Kamal Mustafa

In case you don't want to use a third party services, you can achieve (almost) similar setup with ssh reverse tunnel and tools like tcpproxy or caddy. I shared about it here - dev.to/k4ml/poor-man-ngrok-with-tc....

One thing missing is the request inspection, which I'm still thinking how to get it with existing tools, without having me to code the features myself ;)

Collapse
tobiassn profile image
Tobias SN

It’s not just for development. I once used it to play a game with a friend without setting up an online server. He had next to no lag whatsoever.

Collapse
lssweatherhead profile image
Collapse
sebastiandg7 profile image
Collapse
lssweatherhead profile image
Laura Weatherhead Author

Oooh, also looks awesome!

Collapse
poulad profile image
Poulad Ashrafpour

I wonder how ngrok is compared to localtunnel.

Local Tunnel works fine for me. It's an npm package and offers JS/Go API for automation.

There is one missing feature though. I can't change the local port number w/o creating another tunnel.

Collapse
vjnvisakh profile image
Visakh Vijayan

Yup it's really helpful for development mode. We test our APIs like this before passing it on for QA.

Collapse
c0il profile image
Vernet Loïc

Interesting, I will give a try. I am actually searching for a way to do https locally in a clean way.

Collapse
lynnewritescode profile image
Lynne Finnigan

Definitely need to try this at some point! 😊

Collapse
jamesmh profile image
James Hickey

Nice! Hadn't heard of ngrok before. Def. sounds useful for the reasons you mentioned 👌

Collapse
nickytonline profile image
Nick Taylor (he/him)

Such a great tool. Love it. Thanks for the post. Looking forward to your next post!

Collapse
lssweatherhead profile image
Collapse
mauvehed profile image
mauvehed

As a security professional, ngrok horrifies me.