微信開發 配置 Ngrok

2021-09-05 09:00:51 字數 1777 閱讀 9208

工欲善其事必先利其器

解壓到 /usr/local

tar -zxvf go1.8.3.linux-amd64.tar.gz -c /usr/local
新增環境變數

echo "export path=$path:/usr/local/go/bin" >> /etc/bashrc

source /etc/bashrc

首先我們設定 domain name,之後出現的所有 ngrok_domain 都需要替換成你自己的網域名稱

export ngrok_domain=your domain name
git clone
生成 rsa 檔案:

ngrok_domain="your domain name"

openssl genrsa -out base.key 2048

openssl req -new -x509 -nodes -key base.key -days 10000 -subj "/cn=$ngrok_domain" -out base.pem

openssl genrsa -out server.key 2048

openssl req -new -key server.key -subj "/cn=$ngrok_domain" -out server.csr

openssl x509 -req -in server.csr -ca base.pem -cakey base.key -cacreateserial -days 10000 -out server.crt

cp base.pem assets/client/tls/ngrokroot.crt

編譯:

make release-server release-client
編譯 mac 客戶端

goos=darwin goarch=amd64 make release-server release-client
編譯 windows 客戶端

goos=windows goarch=amd64 make release-client
bin/ngrokd -tlskey=server.key -tlscrt=server.crt -domain=$ngrok_domain -httpaddr=":8081" -httpsaddr=":8082"
監聽了 3 個埠:8081, 8082, 4443

其中 4443 是客戶端和服務端通訊用的

寫入配置檔案 ngrok.cfg

server_addr: ngrok_domain:4443

trust_host_root_certs: false

ngrok -subdomain wxtest -proto=http -config=ngrok.cfg 8600
表示從客戶端過來的請求**到本地的 8600 埠

如果出現下面的介面,表示連線成功

配置 nginx 檔案 ngrok.conf

server 

}

wxtest.ngrok_domain a 記錄指向伺服器 ip

耶~~~

(主要)

微信開發配置(Yii框架下的開發)

1 填寫伺服器配置 2 驗證伺服器位址的有效性 3 依據介面文件實現業務邏輯 首先需要配置以下資訊 填寫url注意一定要填寫外網能訪問的url,token填寫與你檔案中的token一致。沒有伺服器的小夥伴可以用反向 訪問ngrok.cc建立賬戶,或者申請阿里雲的免費伺服器來使用 ok,下面就是 了 ...

微信開發之ngrok內網穿透工具

最近發現了乙個神器,也是基於ngrok的,但他免費!沒聽錯,自定義網域名稱免費。官方管理平台 為 下面是使用方法 1 按提示註冊乙個使用者,然後登陸主頁面如下 這裡比較關鍵的是那個token,後面是要加入到配置檔案中的 2.配置系統預留的網域名稱字尾或者自定義網域名稱,如圖所示 這裡著重說一下自定義...

必看精貼 微信網頁分享開發,配置本地除錯

第二步 第六步 進行簽名,noncestr和timestamp都是自定義的隨機數,不用請求介面獲取的 第六步 寫個介面,返回簽名好的資料 需要返回以下資料 wx.config wx.ready function success function res cancel function res fai...