localtunnel内网服务器暴露至公网


摘自@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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM