How to make your local website accessible to people all over the world? ——Uses and cases of HTTP penetration for intranet breakdown


Preface

For most programmers, once the website has been developed and tested, we need to test the website online, but without our own server, without our own domain name, and without public IP, this becomes a problem. Today, Bailu will bring you a small tutorial. We use the method of intranet breakdown, use the background and penetration tools of third-party platforms, and set the callback address to visit our local website anywhere in the world.

Insert picture description here


1. Introduction to intranet penetration and third-party platform tools

1. Intranet penetration

Intranet penetration , that is, NAT penetration, NAT penetration is to make data packets with a specific source IP address and source port number not be shielded by the NAT device and routed to the intranet host correctly.

The intranet penetration tool can map a public domain name to the local localhost domain name.

Insert picture description here
For more knowledge and principles of intranet penetration, please move forward-" Intranet penetration ", so I won't go into details here.

2. Third-party platform tools-Dingding Developer Tools

The third-party tool we use here is "Dingding", which is implemented using the developer tools of the Dingding open platform.

Click on the intranet penetration tool of Dingding Developer Platform to learn more. For details on the content and precautions of the tool, click on the previous link to view. We follow the instructions to go to Github to download related tools.

Insert picture description here

2. Start the intranet penetration tool

1. Command and configuration introduction

cmd to enter the command interface, cd to open the desktop, and then open your local computer. The operation of my device is as follows:

Insert picture description here
Then start the tool and execute the command ding -config=./ding.cfg -subdomain=域名前缀 端口. Here, your domain name and operating port are configured according to your actual needs. Generally, the default port developed by Tomcat is 8080. Here I use port 80, and the domain name prefix is ​​bailucool , The configuration is as follows:

Insert picture description here
Then click Enter.

2. View the mapping information

At this time, we can see that the http://bailucool.vaiwan.com just configured has been mapped to 127.0.0.1:80, which is our local.

Insert picture description here

Three, test

1. Remote access to local site resources

After the configuration is complete, we need to test the mapping. Let's start the port, which is the port 80 that I just configured. If you use the default configuration of the Tomcat server to start, you can start the default port 8080 of Tomcat. We use this domain name http://bailucool.vaiwan.com to access our local resources. After the page is loaded, we check the information in the address bar and find that there is no problem.

Insert picture description here
There is no problem loading other pages.

Insert picture description here

At this time, it also shows that our configuration is without any problems. Now, the whole world can access your local resources through this address , and you can perform a simulated online test!
Insert picture description here

2. Check the site data request situation, we can see that the status codes are all normal.

Insert picture description here

2. Close

To close the site, we only need to close 127.0.0.1:80 locally (close the Tomcat server). Then close the command interface.


to sum up

This article introduces how to access local site resources from anywhere in the world through the "intranet breakdown" method. On the one hand, it solves the trouble of not having a public domain name and IP cannot be tested online, on the other hand, it also Give you a new way to share your local site resources anytime, anywhere.

Insert picture description here


I am Bailu, a programmer who works tirelessly. Hope this article can be of benefit to you, welcome everyone's one-click three-connection! If you have any other questions, suggestions or supplements, you can leave a message at the bottom of the article, thank you for your support!
More information WeChat search public accountWDeerCode code circle

Guess you like

Origin blog.csdn.net/qq_22695001/article/details/109149561