Skip to content

Commit ff483a4

Browse files
committed
feat: 计划TCP内网穿透功能
1 parent d317d93 commit ff483a4

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,32 @@ ReverseTcpProxy.create(Vertx.vertx(), "10.0.0.1", 8080)
3636
.start();
3737
```
3838

39+
## TCP内网穿透
40+
41+
```mermaid
42+
sequenceDiagram
43+
participant 用户 as 外部用户
44+
participant server as 服务端
45+
participant client as 客户端
46+
participant service as 内网服务(如Web服务)
47+
48+
client->>server: 1. 建立控制连接
49+
server-->>client: 2. 认证响应
50+
loop 心跳保持
51+
client->>server: 心跳包
52+
server-->>client: 心跳响应
53+
end
54+
55+
用户->>server: 3. 访问公网端口(HTTP请求)
56+
server->>client: 4. 通过隧道转发请求
57+
client->>service: 5. 请求内网服务
58+
service-->>client: 6. 服务响应
59+
client-->>server: 7. 返回隧道响应
60+
server-->>用户: 8. 返回最终结果
61+
```
62+
63+
64+
3965
## HTTP反向代理
4066

4167
实现HTTP反向代理,代理路由优先级如下
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package top.meethigher.proxy.tcp.tunnel;
2+
3+
/**
4+
* 背景:我近期买了个树莓派,但是又不想随身带着树莓派,因此希望可以公网访问。
5+
* 但是使用<a href="https://github.com/fatedier/frp">fatedier/frp</a>的过程中,不管在Windows还是Linux,都被扫出病毒了。
6+
* 而且这还是Golang自身的问题,参考<a href="https://go.dev/doc/faq#virus">Why does my virus-scanning software think my Go distribution or compiled binary is infected?</a>
7+
* 因此自己使用Java实现一套类似frp的工具,还是很有必要的。
8+
*
9+
* @author <a href="https://meethigher.top">chenchuancheng</a>
10+
* @since 2025/04/01 23:25
11+
*/
12+
public class ReverseTcpProxyTunnelClient {
13+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package top.meethigher.proxy.tcp.tunnel;
2+
3+
4+
/**
5+
* 背景:我近期买了个树莓派,但是又不想随身带着树莓派,因此希望可以公网访问。
6+
* 但是使用<a href="https://github.com/fatedier/frp">fatedier/frp</a>的过程中,不管在Windows还是Linux,都被扫出病毒了。
7+
* 而且这还是Golang自身的问题,参考<a href="https://go.dev/doc/faq#virus">Why does my virus-scanning software think my Go distribution or compiled binary is infected?</a>
8+
* 因此自己使用Java实现一套类似frp的工具,还是很有必要的。
9+
*
10+
* @author <a href="https://meethigher.top">chenchuancheng</a>
11+
* @since 2025/04/01 23:25
12+
*/
13+
public class ReverseTcpProxyTunnelServer {
14+
15+
16+
}

0 commit comments

Comments
 (0)