微信公众号开发入门笔记 (一)--ngrok.exe内网转外网固定IP配置

背景

本地测试微信服务用。windows环境

官网下载

官网地址:https://ngrok.com/download
下载地址:https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-windows-amd64.zip

下载后解压到D盘

双击ngrok.exe,输入命令

ngrok.exe http 8080
ngrok by @inconshreveable                                       (Ctrl+C to quit)

Session Status                online
Session Expires               7 hours, 52 minutes
Version                       2.3.25
Region                        United States (us)
Web Interface                 http://127.0.0.1:4040
Forwarding                    http://8f4cc599.ngrok.io -> http://localhost:8080
Forwarding                    https://8f4cc599.ngrok.io -> http://localhost:8080

Connections                   ttl     opn     rt1     rt5     p50     p90
                              4       0       0.00    0.00    14.97   20.57

HTTP Requests
-------------

GET /                          200 OK

映射关系解释

http://8f4cc599.ngrok.io -> http://localhost:8080
代表可以通过 http://8f4cc599.ngrok.io访问内网的8080端口

测试

搭建web服务

方式多种多样,只要启动一个8080端口的web服务器就好
https://www.cnblogs.com/printN/p/6537903.html

通过外网访问内网服务

http://8f4cc599.ngrok.io 粘贴入浏览器
在这里插入图片描述

结语

这样就具备了微信测试的基本环境。

猜你喜欢

转载自blog.csdn.net/kouryoushine/article/details/89492708