Ngrok
环境
- 服务器:Ubuntu 18.04 LTS
- 本地开发环境:macOS
服务器安装 Ngrok
前提安装
sudo apt-get install build-essential mercurial git
下载 Ngrok 主程序
git clone https://github.com/tutumcloud/ngrok.git ngrok
生成证书
将 ngrok.example.com 改为您的域名
NGROK_DOMAIN=ngrok.example.com
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