2023-02-12 10:33:53 +08:00

18 lines
981 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

原理分析 内网穿透的实现过程主要分三步
1、启动服务端这时服务端监听了两个端口1600116002可根据启动参数修改
一个用来接收客户端请求16001端口
一个用来接收访客代理16002端口
2、启动客户端客户端访问服务端提供的16001端口建立连接server-client通道
3、访客访问代理接口16002端口服务端监听到之后创建访客ID然后通过server-client通道向客户端发送指令客户端接收指令后连接到真实服务端口8080可根据启动参数修改连接真实服务成功后客户端会重新向服务端建立一条连接访客-server通道服务端把访客和该通道进行绑定
这三步最终形成了(访客-代理-客户端-真实服务)完整的通道。
启动服务端 java -jar cc-server.jar 16001 16002
启动客户端 java -jar cc-client.jar 127.0.0.1 16001 8080