实践Ngrok

Ngrok Spend more time programming. One command for an instant, secure URL to your localhost server through any NAT or firewal

get started

第一步:下载解压

第二步(可选):注册绑定authtoken【非注册用户,每次session有效期8个小时

1
$ ./ngrok authtoken <YOUR_AUTH_TOKEN>

第三步:运行

1
2
3
4
5
6
7
8
9
10
11
12
13
$ ./ngrok http 8080
ngrok by @inconshreveable                                                                                         (Ctrl+C to quit)
                                                                                                                                  
Session Status                online                                                                                              
Account                       Angi WANG (Plan: Free)                                                                              
Version                       2.2.8                                                                                               
Region                        United States (us)                                                                                  
Web Interface                 http://127.0.0.1:4040                                                                               
Forwarding                    http://1ea2da3a.ngrok.io -> localhost:8080                                                          
Forwarding                    https://1ea2da3a.ngrok.io -> localhost:8080                                                         
                                                                                                                                  
Connections                   ttl     opn     rt1     rt5     p50     p90                                                         
                              0       0       0.00    0.00    0.00    0.00 

ngrok inspect

ngrok inspect (http://127.0.0.1:4040),是ngrok自带的web管控台,可以查看状态和请求信息。

命令

1
2
$ ./ngrok help
$ ./ngrok help http

参考

ngrok中文网