开发微信的网页授权时或者给顾客展示开发效果,总需要在访问你的本地开发机,俗称内网穿透,这时候 ngrok 就非常好用了。

这里不讲 ngrok 的原理,大家可以自行了解。

因为本人每次换开发环境都要自己复制一遍 ngrok 以及相关脚本,觉得挺麻烦的,于是开了一个仓库

https://github.com/HanSon/ngrok-script

clone 下来后直接跑脚本即可方便运行 ngrok

git clone https://github.com/HanSon/ngrok-script.git
cd ngrok-script
// if linux or mac
./ngrok.sh domain
// if windows
ngrok.bat domain

domain 是自己设置的域名前缀

例如 sh ngrok.sh hanson

file

这个项目其实没有任何技术含量,只是为了方便自己不再下载 ngrok写脚本这些繁琐的操作。

希望这个能方便到大家。

开发微信的网页授权时或者给顾客展示开发效果,总需要在访问你的本地开发机,俗称内网穿透,这时候 ngrok 就非常好用了。

这里不讲 ngrok 的原理,大家可以自行了解。

因为本人每次换开发环境都要自己复制一遍 ngrok 以及相关脚本,觉得挺麻烦的,于是开了一个仓库

https://github.com/HanSon/ngrok-script

clone 下来后直接跑脚本即可方便运行 ngrok

git clone https://github.com/HanSon/ngrok-script.git
cd ngrok-script
// if linux or mac
./ngrok.sh domain
// if windows
ngrok.bat domain

domain 是自己设置的域名前缀

例如 sh ngrok.sh hanson

file

这个项目其实没有任何技术含量,只是为了方便自己不再下载 ngrok写脚本这些繁琐的操作。

希望这个能方便到大家。