Why use Ngrok?
As a web developer, we sometimes need to temporarily deploy a local Web site to an extranet for people to experience evaluation or assist in debugging, and so on, and we usually do this:
- Find a Web server running on an external network
- The server has the environment which the website needs, otherwise builds itself
- Deploy a Web site to a server
- After debugging, remove the Web site from the server
Just want to show a friend of the site, to not so troublesome, tired feeling not love ╰ ('-′) ╯
After the Ngrok, the world is so beautiful.
- First register and download Ngrok, get a bunch of authorization codes
- Run the command
ngrok -authtoken 你的授权码 80
, 80 is the port of your local Web service, and then Ngrok will remember your authorization code and ngrok 80
it will be OK immediately.
- You'll get a list of URLs that will give you access to your local Web service.
How to use it? Step 1:download Ngrok
https://ngrok.com/
Step 2:unzip It
On Linux or OSX you can unzip Ngrok from a terminal with the following command. On Windows, just double click Ngrok.zip.
$ unzip /path/to/ngrok.zip
Step 3:run It!
Read the Usage Guide for documentation on how to use Ngrok. Try it out by running it from the command line:
$ ./ngrok -help
Here is the service I started myself. 3000 port to start the local service: you can see that Ngrok will produce a forwarding http://6cdecc48.ngrok.com-127.0.0.1:3000 We visit this URL, you can see Through the external network can see our intranet services.
Ngrok official website