During the development process, you often encounter the need to publish your local project to the Internet. Because it is in an Intranet environment that the Internet users cannot access, it is troublesome to map ports, sometimes there is no way to perform port ing. At this time, you can use ngrok to publish your project to the Internet.
First download ngrok:
Https://ngrok.com/
Download and obtain an ngrok executable file,
Simplest use:
ngrok 80
In this way, port 80 of the local machine is mapped to the Internet,
Access by other users:
Http://7912fb1b.ngrok.com
Is it easy to access the local project?
Ngrok also has some other functions that can map the TCP protocol:
ngrok -proto=tcp 22
In this way, port 22 of the local machine is mapped to the Internet. However, these functions require logon,
You can register a user in ngrok and then give you a code. You can use the code assigned by ngrok to run these functions once.
ngrok -authtoken 7PZNNsT-qJHAPl-uVcuE 80
The-authtoken parameter is not required for next use.
ngrok 80
You can.
Use ngrok to publish a local Intranet project to the Internet