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

 

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2021-12-10
  • 2021-10-30
  • 2021-09-19
  • 2022-12-23
  • 2022-01-17
猜你喜欢
  • 2022-01-07
  • 2022-02-21
  • 2021-12-14
  • 2021-12-12
  • 2021-11-10
  • 2021-10-03
相关资源
相似解决方案