Using Sunny-Ngrok for intranet penetration


Why use Sunny-Ngrok?

Provide free intranet penetration service, and the free server supports binding custom domain names
. Manage intranet servers and intranet web for demonstrations.
Rapidly develop WeChat programs and debug third-party payment platforms.
Local WEB and external network access, local development of WeChat, and TCP port forwarding
. A new FRP server has been added to the site, which implements https and udp forwarding based on FRP.
No configuration is required. After downloading the client, you can directly use a command to allow the external network to access your intranet, which is no longer a distance away!

To put it simply: you can directly access local projects from the external network. Various debugging will be more convenient during development, and there is no need to go through the trouble of the server when testing functions.

1. Enter the Ngrok official website , first register an account and log in:

There is no need to say more about registering and logging in here.

Insert image description here

After successfully logging in, click 1. Tunnel Management, 2. Open Tunnel, 3. Select the purchased server (just choose a free one, but the access speed may be very slow) on the page.

Insert image description here

After selecting the server, you need to fill in 4 necessary information:

  1. Tunnel protocol: For example, the commonly used http and https, generally just choose http. https needs to be bound to a domain name and SSL certificate.
  2. Tunnel Name: Give the tunnel a name
  3. Prefixed domain name: For example, www.xxx.com, this www is the prefixed domain name. Equivalent to setting a prefix for the domain name
  4. Local port: Determine the local service port that needs to be mapped, such as tomcat's 8080

Insert image description here

After the order is successful, go to the tunnel management and you can see all the information we just filled in, which means the tunnel purchase is successful.
There is some information here that is very important (will be used soon)

  1. Tunnel id: This id is needed to open the Sunny-Ngrok client locally for mapping.
  2. Complimentary domain name: After successful mapping, the address for accessing local services from the external network

Insert image description here

2. Download Sunny-Ngrok client (there are different system versions)

Click to download the Sunny-Ngrok client under the tunnel management just now. It is also available for download on the official Ngrok official website .

Insert image description here

This demonstration uses win10, so download the win10 version (choose whether it corresponds to 32 or 64)

Insert image description here

Find the downloaded client compressed package, 1. Find a place to decompress it. 2. Enter the windows_amd64 folder 3. Select Sunny-Ngrok startup tool.bat to open

Insert image description here

After opening the client, fill in the tunnel id

Insert image description here

Interface after successful connection: After success, you can directly enter the domain name given by Ngrok to directly access local services from the external network (it will be inaccessible after it is closed)

Insert image description here

3. Write a SpringBoot project for testing

You can use SpringBoot + thymeleaf to write an access path and success page for testing

Controller:

@Controller
public class testController {
    
    

    @RequestMapping(path = "/ngrok")
    public String test() {
    
    
        return "ngrok";
    }
    
}

yaml file:

Insert image description here

Success page:

Insert image description here

4. Access local services from the external network

Start the SpringBoot project

Insert image description here

Enter Ngrok's gifted domain name in the browser to directly access the local service interface from the external network.
Note: This domain name is the domain name given by Ngrok after the tunnel is opened. It has been mentioned before.
Note: The local Ngrok client cannot be used when using intranet penetration. closed

Insert image description here

Guess you like

Origin blog.csdn.net/weixin_45377770/article/details/109841211