All Projects → dwyl → learn-ngrok

dwyl / learn-ngrok

Licence: GPL-2.0 license
☁️ Learn how to use ngrok to share access to a Web App/Site running on your "localhost" with the world!

Programming Languages

HTML
75241 projects

Projects that are alternatives of or similar to learn-ngrok

Learn Elm Architecture In Javascript
🦄 Learn how to build web apps using the Elm Architecture in "vanilla" JavaScript (step-by-step TDD tutorial)!
Stars: ✭ 173 (+246%)
Mutual labels:  howto, beginner-friendly
Start Here
💡 A Quick-start Guide for People who want to dwyl ❤️ ✅
Stars: ✭ 1,392 (+2684%)
Mutual labels:  howto, beginner-friendly
Python-Guide-for-Beginners
A guide for Beginners in Python to refer
Stars: ✭ 47 (-6%)
Mutual labels:  beginner-friendly
foss-events
A simple website with a collection of open-source events happening across the globe. This is a beginner-friendly repository that helps you learn git and contribute to web projects. Happy Hacktober!
Stars: ✭ 123 (+146%)
Mutual labels:  beginner-friendly
express-facebook-messenger
Facebook Messenger Bot API utility
Stars: ✭ 20 (-60%)
Mutual labels:  ngrok
universal-hot-reload
Hot reload client and server webpack bundles for the ultimate development experience
Stars: ✭ 79 (+58%)
Mutual labels:  live-reload
SolderingTutorial
Complete soldering course for beginners and advanced.
Stars: ✭ 104 (+108%)
Mutual labels:  howto
messages
A python package designed to make sending messages easy and efficient!
Stars: ✭ 38 (-24%)
Mutual labels:  beginner-friendly
alexa-typescript-starter
This is a simple starter project for Alexa skills using Typescript.
Stars: ✭ 38 (-24%)
Mutual labels:  ngrok
Algorithms-Open-Source
We have a task for each skill level!!
Stars: ✭ 31 (-38%)
Mutual labels:  beginner-friendly
LiveReloadServer
A self-contained, local, cross-platform, static file Web Server with automatic Live Reloading, Markdown rendering and loose Razor Pages support.
Stars: ✭ 69 (+38%)
Mutual labels:  live-reload
live-reload-vanilla-website-template
Template to build a website without a front-end framework, including transpilation of ES6+ JavaScript and Sass support
Stars: ✭ 47 (-6%)
Mutual labels:  live-reload
node-docker
Guide for Writing Dockerfiles for Node.js Applications
Stars: ✭ 91 (+82%)
Mutual labels:  live-reload
Unity3D-Cars
A project built for a Renaissance Coders tutorial to introduce vehicle physics.
Stars: ✭ 60 (+20%)
Mutual labels:  beginner-friendly
dotfiles skeleton
robust and beginner friendly dotfile skeleton
Stars: ✭ 14 (-72%)
Mutual labels:  beginner-friendly
spacex-launch-data
uses the freely available SpacexAPI and basic HTML CSS and JS to give details of missions
Stars: ✭ 25 (-50%)
Mutual labels:  beginner-friendly
electron-angular-webpack
A simple kit for Electron, Angular 6 and Webpack 4 including a live reload system for Angular.
Stars: ✭ 62 (+24%)
Mutual labels:  live-reload
dku-kaggle-class
단국대 SW중심대학 2020년도 오픈소스SW설계 - 캐글뽀개기 수업 일정 및 강의자료
Stars: ✭ 48 (-4%)
Mutual labels:  beginner-friendly
Plasma-Donor-App
An open-source app that helps in connecting patients and plasma donors. This is a beginner-friendly repository that helps you learn the basics of android development, git, and GitHub. Happy Hacktober!
Stars: ✭ 58 (+16%)
Mutual labels:  beginner-friendly
learning-code-through-github-repos
This is a collection of GitHub repositories that you can use in your coding journey.
Stars: ✭ 82 (+64%)
Mutual labels:  beginner-friendly

Learn ngrok

☁️ Learn how to use ngrok so that you can share a Web App/Site running on your "localhost" with anyone online!

Why?

You are working on a Web App/Site on your localhost, but it's "not yet ready" to be "deployed"

Note: once you are ready to make your App/MVP "official", you should consider using Heroku as it does not require you to have your localhost running (and it has good logging, "monitoring", "free tier", etc.).
See: github.com/dwyl/learn-heroku

What?

The official description on the website https://ngrok.com/product is:

"ngrok exposes local servers behind NATs and firewalls to the public internet over secure tunnels."

In plain (beginner friendly) English:

ngrok is a small piece of software that lets you run a web application
on your local computer and (securely) share it with the world on a public address ("URL")
.

intro-image

Who?

Anyone working on a Web App/Site and needs a quick/easy way to show or test it without "deploying" it.
e.g: you are actively developing something and deploying it to Heroku would be too time consuming.

When?

When Should I Use ngrok?

A great use-case is when you are in "development mode", you have "live-reloading" enabled on your locahost and you want any changes you make on your to be reflected a mobile device without having to re-deploy.

Developing Somewhere with "Strict" Firewall Rules?

Often you will be on a network with strict firewall rules (blocked TCP ports) that do not allow you to share your app with your Mobile device! e.g: in Coffee Shops, Libraries or "Corporate" Networks.

In these cases ngrok is a great choice!

When Not to Use ngrok?

Avoid using ngrok when your app is being actively used by people. i.e: once your "MVP" is ready to be tested by "real users", deploy it somewhere that is not your localhost e.g: Heroku

How?

The official "getting started" guide is: https://dashboard.ngrok.com/get-started Is a good place to start, however we have "condensed" it down into just 4 steps!

1. Download & Install

First step on our quest is to download ngrok from the website: https://ngrok.com/download

Mac?

If you use a Mac computer (and "homebrew") there's an easy way; Run the following command in your terminal:

brew cask install ngrok

ngrok-installed

Once you have successfully downloaded and installed ngrok.

2. Connect Your ngrok "Account" to Your locahost

If you have not already authenticated with ngrok visit: https://dashboard.ngrok.com/user/login

We use our GitHub account to authenticate with ngrok because they only asks for basic access:

github-auth-ngrok

Once authenticated, you should see a "Dashboard": https://dashboard.ngrok.com/get-started

If you scroll down you will see a section entitled: "Connect your account" e.g:
connect-ngrok-account

Copy-pasge and run the command in your terminal
(including your unique authtoken, which you should not share BTW!)

./ngrok authtoken 56hth5o3bbkewDmHSZEHQ_39VJe8koVu

Don't worry, this example is not a "valid" token, it's just for demo purposes.

Trouble-shooting ...

if you see an error:

-bash: ./ngrok: No such file or directory

simply remove the ./ in front of the ngrok command: ngrok-not-found

Thanks to: https://stackoverflow.com/questions/30188582/ngrok-command-not-found/43492639

3. Run Your app

Now it's time to run your app on your localhost. Run which ever command you need (e.g: npm start or mix phx.server) to start your app.

Make a note of the TCP Port your app is running on for step 4 below.

Don't Have an App?

If you don't already have an "App" to try/test ngrok, you can simply "clone" this repository and try the "demo" App!

Copy-paste and run the following command:

git clone https://github.com/dwyl/learn-ngrok.git && cd learn-ngrok && npm install

(note: it take a few seconds for that command to run because it's installing the "live-server" dependency for running the app, be patient ...)

In your Terminal window you should see something like this:
npm-start

Once the command has run it will start the "app" and open it in your default web browser. e.g:
hello-world-in-browser

4. Start the ngrok "Tunnel"

Create the ngrok "tunnel" to your app by running the following command in a new terminal window (different from the one where your app is running):

./ngrok http 4000

or (on Mac OSX):

ngrok http 4000

you should now see something similar to this:
ngrok-tunnel-terminal

This confirms that the ngrok forwarding the given URL to your locahost on TCP Port 4000.

In our case the ngrok URL is https://f00ead01.ngrok.io but yours will be a different random string as the sub-domain.

5. Visit the ngrok URL in your Web Browser

Open your Web Browser and visit: https://f00ead01.ngrok.io voila

Voilà! Your App on the public Internet! (not that you had any doubt it would work ...)

To Quit ngrok simply use the Ctrl+C command.

Note: if you quit ngrok the URL of your app will change. That's why the URL in the GIF below is different from this one ... if you want a fixed URL, you will need to pay for it.

6. But Wait, There's More!

Open the ngrok "inspector" http://localhost:4040 a new tab or browser window:

ngrok-inspector

6.1 Make a Change in your App

If you make a simple change in your App, you should see it update in the browser! (the "demo" App has "live reloading" if yours does not, simple refresh the browser window.) e.g:
update-app-live-reload-gif

That's it!

Obviously ngrok has many more "advanced" features, we encourage you to read the docs if you need something specific: https://ngrok.com/docs

Any Questions?

If you have any questions, get "stuck" or want a more "advanced example", please open an issue: https://github.com/dwyl/learn-ngrok/issues

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].