In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
What this article shares with you is about how to use Ngrok to map LAN services to the public network. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.
Ngrok, how to install, configure, and what scenarios you need to use ngrok. You may have encountered some situations before you have used Ngrok
You need to demonstrate to the customer the project you are working on, so you ask the developer to help you deploy an environment to demonstrate to the customer on your laptop with limited resources. The next time another colleague needs to demonstrate to a client, do the same thing again.
If you are a back-end service developer of mobile applications, form a remote team with the front-end developers of mobile applications. You need to help the front-end developer deploy an environment for testing on his network. Because front-end developers do not have a back-end technology stack, the cost of communication between you about the back-end test environment is extremely high.
All these problems can be solved as long as you have a fixed public network ip. The back-end service is exposed on the public network ip and can be accessed anywhere on the Internet. But we all know that the price of fixed public network ip is very expensive, depending on the bandwidth, the annual fee ranges from ten thousand yuan to hundreds of thousands of yuan. If it is only for demonstration, testing, and R & D environment and other network sharing issues, there is no need to apply for a fixed public network ip.
So is there any alternative? Of course, it is the protagonist of our article: Ngrok.
What is Ngrok?
Ngrok is an application developed by Alan Shreeve that allows developers to expose their local development services to Internet. It creates a network to the local development server and generates two random subdomains-one http and one https. With these generated domain names and addresses, you can access locally developed applications from anywhere through Internet, as long as the local service remains operational.
Second, how to use ngrok?
Using ngrok is very simple.
Setup and installation
Configure ngrok
Start the network service
1. Setup and installation
To start using ngrok, we must register an account ngrok with the website that provides the ngrok service. Register and go to the dashboard page. Download the correct software package according to your operating system.
For Windows: download zip and extract the executable file and run it. To allow ngrok commands to be accessed anywhere in the system, you can use the following methods
Move the executable file ngrok.exe to C:\ Windows\ system32\ ngrok.exe
Add environment variables (search for "Edit environment variables for your account" in the search bar next to the Windows logo = > double-click the path to "your user name" under "user variables" = > Click "New" = > add path C:\ Windows\ system32\ ngrok.exe = > Click OK.
For Mac / Linux:-, run the following command on the terminal.
Unzip / path/to/ngrok.zip
Move the ngrok file to the / usr/local/bin directory or add the path to .bashrc or .zshrc depending on the shell you use.
two。 Configure and verify ngrok
The next step is to use your ngrok account to verify the availability of the ngrok client you installed on the system.
Run the following command at the terminal / prompt:
Ngrok authtoken YOUR_AUTH_TOKEN
YOUR_AUTH_TOKEN is the token displayed on the dashboard. This saves the auth_token of your account to the .yml file on your local computer.
3. Start the network service
Enter the following command:
. / ngrok http 3000
This 3000 is the port number on which your local server is running, that is, the startup port of your local service. Use the command to start it according to your own situation.
By running this command, your terminal prompt should look like this. The figure above shows the randomly generated subdomain URL in which the application can be accessed, which can be accessed on the public network. In addition, you can access the dashboard of the 4040 local port service through a browser, where you can view all requests made through the generated subdomain.
The above is how to use Ngrok to map LAN services to the public network. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.