Giter VIP home page Giter VIP logo

frpjs's Introduction

frpjs

一个用于内网穿透的工具,将拥有公共ip的服务器的数据转发到内网,协议支持tcp + udp。

重造轮子的原因

  • fatedier/frp的udp支持有问题,在使用vpn的时候,导致只有一个可以有效连接。
  • 另外,这类纯粹的io需求,正适合用node来实现,简单易懂。

如何使用

支持docker以及nodejs两种方式。

服务端

配置

参考:server.js

module.exports = {
    port: 7666,                 //接收客户端
}

docker方式

docker run --restart=always --network host -d -v ${PWD}/server.js:/app/config/server.js --name frps banknight/frp server

nodejs方式

node ./index.js server

客户端

配置

参考:client.js

module.exports = {
    ip: "127.0.0.1",                        //公网服务器ip
    port: 7666,                             //公网服务器端口
    proxy: {                                //代理
        test_udp: {                         //代理名称,不可以出现重名
            type: "udp",                    //协议类型,目前只支持tcp 和 udp
            remote_port: 1888,              //公网服务器的转发端口
            local_port: 1889,               //转发到的内网服务器端口
            local_ip: "192.168.31.2",       //转发到的内网服务器地址
        },
        test_tcp: {
            type: "tcp",
            remote_port: 1888,
            local_port: 1889,
            local_ip: "192.168.31.2",
        }
    }
}

docker方式

docker run --restart=always --network host -d -v ${PWD}/client.js:/app/config/client.js --name frpc banknight/frp client

nodejs方式

node ./index.js client

参考项目

fatedier/frp

frpjs's People

Contributors

banknight avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.