摘自@scarlex
1.安裝
npm install -g localtunnel
2.運行
lt --port 8080
(your url is: http://xxxx.localtunnel.me ) 就實現了通過這個地址訪問本地服務器8080端口的項目了~
另!以上是國外項目 速度慢,搭建自己的localtunnel服務端
1 安裝
git clone git://github.com/defunctzombie/localtunnel-server.git
cd localtunnel-server
npm install
2 運行
bin/server --port 8080
3 另開item
lt --port 8080
(your url is: http://xxxx.localtunnel.me ) 就實現了通過這個地址訪問本地服務器8080端口的項目了~
4 解決用隨機字符串作為子域名,
lt --port 8080 --subdomain mysubdomain
(your url is: http://mysubdomain.localtunnel.me ) 就實現了通過這個地址訪問本地服務器8080端口的項目了~
另一種 zuul-ngrok 反向代理
1 官網下載安裝 https://ngrok.com/download
2 解壓 unzip ngrok....
3 在指定目錄 ./ngrok help 查看常用命令
ngrok -config ngrok.cfg -subdomain xxxx 80