美文网首页我爱编程
内网穿透(基于node模块的localtunnel)

内网穿透(基于node模块的localtunnel)

作者: Gukson666 | 来源:发表于2018-04-10 14:59 被阅读0次

    一、首先用了localtunnel。基于node.js,npm安装,优点,简单易用。缺点,巨大的缺陷,及其不稳定。

    下面是使用方法:
    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

    相关文章

      网友评论

        本文标题:内网穿透(基于node模块的localtunnel)

        本文链接:https://www.haomeiwen.com/subject/lwqfcftx.html