NGrok Secure Tunnel

NGrok Secure Tunnel

README

NGrok is a network application built to provide introspected tunnels to localhost. Basically it allow you to expose securely your local web server to the Internet and capture all traffic for detailed inspection and replay.

Features

Demo your latest code

NGrok creates a tunnel from the public Internet http://subdomain.ngrok.com to a port on your local machine. You can give this URL to anyone to allow them to try out a web site you’re developing without doing any deployment.

Understand HTTP services

NGrok captures all traffic through the tunnel. It displays information about the HTTP traffic for your inspection. Raw request/response bytes, parsed headers and form data, JSON/XML syntax checking and more are included.

Replay Requests

Developing services which consume webhooks can be challenging if the hooks are labor-intensive to generate. Use ngrok’s replay request feature to iterate quickly on a new feature without switching contexts to generate new requests.

NGrok Secure Tunnel 2

Free but with Enhancements on Signup

The NGrok tunneling service is provided free of charge with no signup required. However, there are several additional features of NGrok tunnel service that are only available after you sign up. And you can even get the source code of the project in the official NGrok GitHub.

  1. Secure Encrypted Tunneling. After you sign up, all tunnels are automatically available for access securely over SSL: curl https://myapp.ngrok.com

  2. Password Protected. Specify http auth credentials required to access your tunnel so only you can access it: ngrok -httpauth "user:password" 8080

  3. Custom Subdomains. Pick a custom subdomain so your application appears on https://myapp.ngrok.com instead of http://a1b2c3d4.ngrok.com: ngrok -subdomain myapp 8080

  4. Reserved Subdomains. Reserve subdomains for your own usage so that they are always available and never provisioned to another user.

  5. *Default tunnel configurations. Configure a tunnel name and auth credentials to use by default so you don’t have to type them each time you create a new tunnel.

  6. TCP & UDP Tunneling. NGrok supports tunnelling at the TCP and UDP layer so you can expose any type of networked service to the internet: ngrok -proto tcp 8080

Code

Here I will explain how to use NGrok to expose your projects in Rails or Laravel. But I’m not limiting the process to these projects, you can use the same commands, with the same procedure to obtain the same results.

Rails
# Terminal #1
$ rails new project --skip-bundle
$ cd ./project/
$ bundle install --local
$ rails server
  => Booting WEBrick
  => Rails 4.0.0 application starting in development on http://0.0.0.0:3000
  => Run 'rails server -h' for more startup options
  => Ctrl-C to shutdown server
# Terminal #2
$ ngrok 3000
  ngrok
  Tunnel Status..........: online
  Version................: 0.14/0.17
  Protocol...............: http
  Forwarding.............: http://78032aeb.ngrok.com -> 127.0.0.1:3000
  Web Interface..........: http://localhost:4040
  # Conn.................: 2
  Avg Conn Time..........: 876.24ms

NGrok Secure Tunnel 3

Laravel
# Terminal #1
$ composer.phar create-project laravel/laravel project --prefer-dist
$ cd ./project/public/
$ php -S 127.0.0.1:8080 # Don't use 'localhost'
# Terminal #2
$ ngrok 8080
  ngrok
  Tunnel Status..........: online
  Version................: 0.14/0.17
  Protocol...............: http
  Forwarding.............: http://78032aeb.ngrok.com -> 127.0.0.1:8080
  Web Interface..........: http://localhost:4040
  # Conn.................: 1
  Avg Conn Time..........: 2926.46ms

Credits

Introspected tunnels to localhost. I want to securely expose a local web server to the internet and capture all traffic for detailed inspection and replay. NGrok Official Website

Do you have a project idea? Let's make it together!