什麼是ngrok
ngrok is a reverse proxy that creates a secure tunnel from a public endpoint to a locally running web service. ngrok captures and analyzes all traffic over the tunnel for later inspection and replay. ngrok是一個反向代理,可以從公網建立一個安全隧道到本地的web服務。ngrok 抓取和分析所有的經過資料,用于之後的檢查和重放。
更多的介紹可以去github和官網上查找 1 github 2 官網 3 下載下傳安裝 4 使用指南
這個工具在主流的系統上都可以使用
使用
下面是使用小記(win7)
當時下載下傳的時候不是很好下,百度網盤下載下傳
下載下傳之後解壓,然後執行
>ngrok.exe 80
然後出現了:
ngrok (Ctrl+C to quit)
Tunnel Status online
Version 1.7/1.7
Forwarding http://40984492.ngrok.com -> 127.0.0.1:80
Forwarding https://40984492.ngrok.com -> 127.0.0.1:80
Web Interface 127.0.0.1:4040
# Conn 0
Avg Conn Time 0.00ms
接着我們啟動一個web服務在80端口,然後通路http://40984492.ngrok.com 這個網址。 浏覽器彈出就是我們本地的web應用,有點像花生殼,嘿嘿。
127.0.0.1:4040這個位址是幹嘛的呢?通路下就知道了
這裡就是請求的監控界面,這裡可以看到每個請求的具體參數等等,對于調試非常友好。

小結
Ngrok是一個非常有用的工具,對于開發測試很友好, 當然它還有更多的功能,大家根據需要去看使用者手冊就好了。
本文出自 “orangleliu筆記本” 部落格,轉載請務必保留此出處http://blog.csdn.net/orangleliu/article/details/42551819
作者orangleliu 采用署名-非商業性使用-相同方式共享協定