Use ngrok to penetrate the intranet to obtain a domain name

https://ngrok.com/

 

1 : Why do you need to fill in the url connected to the WeChat server when using ngrok
to develop WeChat? This url must be an external domain name, that is to say, we need to develop on the ip server corresponding to this external domain name, but there is no way to do it locally Development and debugging , so use ngrok to obtain an external domain name. This external domain name actually accesses the local host , so fill in the external domain name into the external network url required by WeChat to develop and debug locally. 2 : Download ngrok ngrok - secure introspectable tunnels to localhost windows version 3 : register ngrok to get the custom domain name behind your auth token must have this token 4: open cmd cd to the directory where ngrok.exe is located, execute ngrok 80 to give you the local



   

127.0.0.1:80 Allocate a domain name that can be accessed from the external network. For example , http://1f1b1c.ngrok.com , which means accessing http://1f1b1c.ngrok.com from the external network means accessing your local 127.0.0.1:80 . Of course, If you execute ngrok 8080 , it is to assign a domain name to access 127.0.0.1:8080 5: The domain name assigned above is temporary, and the domain name may change next time you turn on the computer. We need a fixed domain name to map to port 80 of this machine. So first log in and execute ngrok -authtoken XUsFLvG4hgb8ukjvML8YBXX 80 Here is the token you gave you when you registered , and then ngrok -subdomain myapp 80 so that you can access 127.0 of this machine all the way through http://myapp.ngrok.com . 0.1:80 . Of course, if you want to access port 8080 , then change the 80 above to 8080
 


 

6
: Do not close the cmd window . After closing the provided domain name, you will not be able to access it. If you want to view the transfer http information provided by ngrok for you, visit http://localhost :4040/ 7 : You must pay attention to the development of WeChat because it is done by ngrok . For security reasons, the transfer cannot pass WeChat's default statement libxml_disable_entity_loader(true); so comment it out and wait for it to be officially deployed to the server before uncommenting

Specific commands may vary slightly from version to version.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326233976&siteId=291194637