ngrok基本使用
Ngrok 是一个反向代理软件,启动后会在公共服务器和本地客户端之间建立一个通道,并由公共服务器分配一个唯一的域名给这个通道。在 Homestead 中运行 Ngrok 之后,通过公共服务器分配的域名就可以在公网访问到 Homestead 中的站点,从而让支付宝和微信支付的服务器直接将回调数据发送到对应的回调接口。
一、Unzip to install
On Linux or Mac OS X you can unzip ngrok from a terminal with the following command. On Windows, just double click ngrok.zip to extract it.
|
|
二、Connect your account
Running this command will add your authtoken to the default ngrok.yml
configuration file. This will grant you access to more features and longer session times. Running tunnels will be listed on the status page of the dashboard.
|
|
三、Fire it up
Read the documentation on how to use ngrok. Try it out by running it from the command line:
|
|
To start a HTTP tunnel forwarding to your local port 80, run this next:
|
|
Next, check out some tutorials
We’ve written tutorials to guide you through common use cases like developing on chatbots, setting up SSH access to IoT devices or testing on mobile devices.