Git Product home page Git Product logo

iamlinhui / rpt Goto Github PK

View Code? Open in Web Editor NEW
64.0 64.0 22.0 27.22 MB

内网穿透&反向代理 (支持TCP上层协议,支持HTTP/HTTPS端口复用)

Home Page: https://holmes.cn

License: GNU General Public License v3.0

Java 93.69% Dockerfile 0.62% Inno Setup 1.44% HTML 3.14% CSS 1.12%
dockerfile frp gui http2 java javafx netty ngrok openssl protobuf proxy rdp reverse-proxy ssl tcp tunnel vnc websocket

rpt's Introduction

rpt

内网穿透工具

一个可用于内网穿透的工具,将局域网个人电脑、服务器映射到公网。

支持任何TCP上层协议,可用于远程桌面、访问内网网站、SSH访问、远程连接打印机、本地支付接口调试、微信小程序调试...

支持HTTP端口复用,可用于内网反向代理,共用服务端80/443端口。支持HTTP请求升级为WebSocket,HTTP2。

SSL双端验证,数据加密传输。

部署简单,提供桌面客户端。


快速体验 Quick Start

  • 启动服务端

java -jar rpt-server-*.jar -c server.yml

  • 启动客户端

java -jar rpt-client-*.jar -c client.yml

服务端配置server.yml

#服务端绑定IP
serverIp: 0.0.0.0
#服务端与客户端通讯端口
serverPort: 6167
#服务端暴露的HTTP重定向端口 为0则不开启 默认值0
httpPort: 80
#服务端暴露的HTTPS复用端口 为0则不开启 默认值0
httpsPort: 0
# 域名证书公钥(需替换) httpsPort为0时不生效 默认值server.crt
domainCert: server.crt
# 域名证书私钥(需替换) httpsPort为0时不生效 默认值pkcs8_server.key
domainKey: pkcs8_server.key
# 是否限制连接暴露端口的IP必须在当前地区国家 默认值false
ipFilter: true
#授权给客户端的秘钥
token:
  - clientKey: b0cc39c7-1b78-4ff6-9486-020399f569e9
    # 限制绑定端口范围 左右闭区间  默认值[1,65535]
    minPort: 4000
    maxPort: 8000
  - clientKey: 4befea7e-a61c-4979-b012-47659bab6f21
    minPort: 9000
    maxPort: 9999

客户端配置client.yml

#服务端IP
serverIp: 127.0.0.1
#服务端与客户端通讯端口
serverPort: 6167
#授权给客户端的秘钥
clientKey: b0cc39c7-1b78-4ff6-9486-020399f569e9

# remotePort与localPort映射配置
config:
  - # 传输协议类型 (TCP或者HTTP) 不填写默认就是TCP
    proxyType: TCP
    # 客户端连接目标IP
    localIp: 127.0.0.1
    # 客户端连接目标端口
    localPort: 3389
    # 服务暴露端口
    remotePort: 4389
    # 描述
    description: rdp

  - proxyType: TCP
    localIp: 127.0.0.1
    localPort: 6379
    remotePort: 7379
    description: redis

  - proxyType: HTTP
    localIp: 127.0.0.1
    localPort: 8080
    # 访问域名(*.domain.com 用二级域名指向 eg:test.domain.com)
    domain: test.domain.com
    # 访问资源时登录的账号和密码(账号:密码) 非必填
    token: admin:admin
    description: tomcat

GUI客户端

使用介绍

进阶部署

首先在jar包的当前目录,新建conf文件夹,并将相应的配置文件(client.yml或者server.yml)放进去

启动脚本start.sh

java -server -d64 -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Dnetworkaddress.cache.ttl=600 \
     -Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Duser.timezone=Asia/Shanghai -Duser.country=CN \
     -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Xbootclasspath/a:./conf \
     -jar rpt*.jar  > /dev/null 2>&1 & echo $! > pid.file &

关闭脚本stop.sh

kill $(cat pid.file)

Docker 镜像地址

https://hub.docker.com/r/promptness/rpt-client

更新IP库

https://dev.maxmind.com/geoip/geolite2-free-geolocation-data

https://github.com/Loyalsoldier/geoip/releases

https://github.com/Dreamacro/maxmind-geoip/releases

将下载的Country.mmdb放入server端的conf文件夹中

SSL证书申请

详细操作步骤看这里 OpenSSL申请证书

替换证书

如果需要替换证书则:

client端需要在conf文件夹里面放置client.crtpkcs8_client.keyca.crt

server端需要在conf文件夹里面放置server.crtpkcs8_server.keyca.crt

注册Windows服务

将rpt-client.jar注册Windows服务可开机自启动

下载 winsw工具 ,将WinSW-x64.exe文件重命名为rpt-client.exe, 和rpt-client.jar放在同一个目录中, 在该目录中新建文件rpt-client.xml文件,写入如下内容

<service>
    <id>rpt-client</id>
    <name>rpt-client</name>
    <description>rpt-client</description>
    <executable>java</executable>
    <arguments>-server -d64 -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Dnetworkaddress.cache.ttl=600 -Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Duser.timezone=Asia/Shanghai -Duser.country=CN -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Xbootclasspath/a:./conf -jar rpt-client.jar
    </arguments>
</service>

执行rpt-client.exe install即可完成注册为Windows服务

其他

补充说明

rpt's People

Contributors

iamlinhui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rpt's Issues

bungecord how reverse proxy

how do I get the server (bushing) to start the first handshake? the server will be the first to connect to the BungeCord.
My goal of the experiment is to bypass the provider's NAT. (Address-)Restricted Cone NAT This type of NAT allows incoming transfers of the assigned source IP address, but allows the use of any source port. As a rule, an incoming rule of this type was previously created dynamically when the local host initiated an outgoing transfer to a remote server (for example, a minecraft server). in order for NAT to allow receiving packets from bungee, it is necessary that the server first starts connecting to BungeCord.
https://doc-kurento.readthedocs.io/en/6.14.0/knowledge/nat.html#address-restricted-cone-nat

服务端-客户端未知连接中断

开发环境调试没问题,打包后windows环境和虚拟机都发生错误,请教大佬。具体日志如下:

server日志:
2023-04-27 11:59:29.202|INFO |nioEventLoopGroup-2-1|cn.promptness.rpt.server.ServerApplication.lambda$start$0:77|服务端启动成功,本机绑定IP:0.0.0.0,服务端口:6167
2023-04-27 11:59:29.202|INFO |nioEventLoopGroup-4-1|cn.promptness.rpt.server.HttpApplication.lambda$start$0:59|服务端启动成功,本机绑定IP:0.0.0.0,Http端口:80
2023-04-27 11:59:29.267|INFO |nioEventLoopGroup-6-1|cn.promptness.rpt.server.HttpsApplication.lambda$start$0:65|服务端启动成功,本机绑定IP:0.0.0.0,Https端口:443
2023-04-27 11:59:42.437|INFO |nioEventLoopGroup-3-1|cn.promptness.rpt.server.handler.ServerHandler.channelInactive:59|服务端-客户端未知连接中断

client日志:
2023-04-27 11:40:35.371|INFO |nioEventLoopGroup-2-1|cn.promptness.rpt.client.ClientApplication|客户端开始连接服务端IP:10.127.6.215,服务端端口:6167
2023-04-27 11:40:35.475|INFO |nioEventLoopGroup-2-2|cn.promptness.rpt.client.handler.ClientHandler|客户端-服务端连接中断,10.127.6.215:6167

Program logic

I want to modify your program.
which code file is responsible for creating a tunnel between two machines?
which code file is responsible for proxying data into the tunnel?

Apache

Hello, I would like to make a plugin for the BungeeCord core so that I can buy hosting and not overpay a lot of money, since I need BungeeCord and the Tunnel, so I had a problem with imports, that is, org.apache.commons, etc. there are no these libraries and I can’t find them, I don’t know why, could you tell me how to find it?

有简单的使用手册吗老师

  - proxyType: HTTP
    localIp: 127.0.0.1
    localPort: 7080
    remotePort: 8081
    domain: localhost
    token: admin:admin
    description: tomcat

比如我本地tomacat配置的8081端口,server端起好后,client端增加如上配置,浏览器可以通过 http://127.0.0.1:7080/XXX 访问吗,或者我该如何配置呢

what libraries are needed?

I found out that the "Netty" library is needed.
Then I found out about jboss(the question is, where did you get it?)
You can give a list of the names of libraries that were used when creating the program?

端口由于某种原因没有突破

我的配置:
Client.yml:
serverIp: f2.russianodes.com
serverPort: 26048(第一个端口)

TCP时domain可不填写 HTTP时remotePort可不填写

config:

  • proxyType: TCP
    localIp: 192.168.0.154
    localPort: 25565
    remotePort: 25608(第二港口)
    description: minecraft server.

Server.yml:
#服务端绑定IP
serverIp: 0.0.0.0
#服务端与客户端通讯端口
serverPort: 26048(第一个端口)

在程序中:Lighttunnel 类似的配置工作.

Client logs:https://pastebin.com/ibQm8QTT
Server logs:https://pastebin.com/BQYftFHb
Server Java 18
Clinet java 8/17

Netty

What version of Netty are you using?

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.