[工具]ngrok本地反向 Proxy
什麼是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是一個反向 Proxy,可以從公網建立一個安全隧道到本地的web服務。ngrok 抓取和分析所有的經過資料,用於之後的檢查和重放。
更多的介紹可以去github和官網上尋找 1 github 2 官網 3 下載安裝 4 使用指南
這個工具在主流的系統上都可以使用
使用
下面是使用小記(win7)
當時下載的時候不是很好下,百度網盤下載
下載之後解壓,然後執行
>ngrok.exe 80
然後出現了:
ngrok (Ctrl+C to quit)Tunnel Status onlineVersion 1.7/1.7Forwarding http://40984492.ngrok.com -> 127.0.0.1:80Forwarding https://40984492.ngrok.com -> 127.0.0.1:80Web Interface 127.0.0.1:4040# Conn 0Avg Conn Time 0.00ms
接著我們啟動一個web服務在80連接埠,然後訪問http://40984492.ngrok.com 這個網址。 瀏覽器彈出就是我們本地的web應用,有點像花生殼,嘿嘿。
127.0.0.1:4040這個地址是幹嘛的呢?訪問下就知道了
這裡就是請求的監控介面,這裡可以看到每個請求的具體參數等等,對於調試非常友好。
小結
Ngrok是一個非常有用的工具,對於開發測試很友好, 當然它還有更多的功能,大家根據需要去看使用者手冊就好了。