websocket-proxy-http-request 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,377 +1,377 @@
1
- # WebSocket Proxy HTTP Request
2
-
3
- [![Node.js](https://img.shields.io/badge/Node.js-18+-green.svg)](https://nodejs.org/)
4
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.3+-blue.svg)](https://www.typescriptlang.org/)
5
- [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
- [![Status](https://img.shields.io/badge/Status-Production%20Ready-success.svg)](.)
7
-
8
- 通过WebSocket将外网HTTP流量转发到内网服务的高性能代理工具。
9
-
10
- ## ✨ 特性
11
-
12
- - 🚀 **高性能**: P99延迟30ms,RPS达629
13
- - 🔄 **自动重连**: 断线自动恢复,最多重试3次
14
- - 💓 **心跳保活**: 30秒心跳间隔,保持连接稳定
15
- - 🔐 **安全认证**: 支持Token认证(可选)
16
- - 📊 **完整日志**: 请求全链路可追踪
17
- - 🎯 **类型安全**: TypeScript完整类型定义
18
- - 🛠️ **易于部署**: 支持PM2和Docker
19
-
20
- ## 📖 快速开始
21
-
22
- ### 方式一:使用 npx(推荐)
23
-
24
- 无需安装,直接运行:
25
-
26
- ```bash
27
- # 1. 克隆项目
28
- git clone <repository-url>
29
- cd websocket-proxy-http-request
30
-
31
- # 2. 编译项目
32
- npm install
33
- npm run build
34
-
35
- # 3. 启动代理服务器(外网)
36
- npx ws-proxy-server
37
- # 或
38
- npx ws-proxy proxy-server
39
-
40
- # 4. 启动客户端代理(内网,新终端)
41
- npx ws-client-agent
42
- # 或
43
- npx ws-proxy client-agent
44
- ```
45
-
46
- ### 方式二:本地安装
47
-
48
- ```bash
49
- # 安装依赖
50
- npm install
51
-
52
- # 编译
53
- npm run build
54
- ```
55
-
56
- ### 配置
57
-
58
- 创建 `.env.proxy` (代理服务器):
59
- ```bash
60
- PROXY_PORT=8080
61
- WS_PORT=8081
62
- AUTH_ENABLED=false
63
- LOG_LEVEL=info
64
- ```
65
-
66
- 创建 `.env.client` (客户端):
67
- ```bash
68
- PROXY_WS_URL=ws://localhost:8081
69
- LOCAL_TARGET_HOST=localhost
70
- LOCAL_TARGET_PORT=3000
71
- CLIENT_ID=client-001
72
- ```
73
-
74
- ### 启动
75
-
76
- #### 使用 npx(推荐)
77
-
78
- ```bash
79
- # 启动代理服务器(外网机器)
80
- npx ws-proxy-server
81
- # 或使用子命令
82
- npx ws-proxy proxy-server
83
-
84
- # 启动客户端(内网机器,新终端)
85
- npx ws-client-agent
86
- # 或使用子命令
87
- npx ws-proxy client-agent
88
- ```
89
-
90
- #### 使用 npm scripts
91
-
92
- ```bash
93
- # 编译
94
- npm run build
95
-
96
- # 启动代理服务器(外网机器)
97
- npm run start:proxy
98
-
99
- # 启动客户端(内网机器)
100
- npm run start:client
101
- ```
102
-
103
- #### 直接运行
104
-
105
- ```bash
106
- # 编译
107
- npm run build
108
-
109
- # 启动代理服务器(外网机器)
110
- node dist/src/proxy-server.js
111
-
112
- # 启动客户端(内网机器)
113
- node dist/src/client-agent.js
114
- ```
115
-
116
- ### 测试
117
-
118
- 使用自定义动态装箱/拆箱方式发送请求:
119
-
120
- ```bash
121
- # GET请求示例(带查询参数)
122
- curl -X POST http://localhost:8080/proxy \
123
- -H "Content-Type: application/json" \
124
- -d '{
125
- "url": "http://localhost:9000/api/users",
126
- "method": "get",
127
- "params": {"name": "allen"}
128
- }'
129
-
130
- # POST请求示例
131
- curl -X POST http://localhost:8080/proxy \
132
- -H "Content-Type: application/json" \
133
- -d '{
134
- "url": "http://localhost:9000/api/users",
135
- "method": "post",
136
- "body": {"name": "allen", "age": 25}
137
- }'
138
-
139
- # 指定特定客户端(clientId路由)
140
- curl -X POST http://localhost:8080/proxy \
141
- -H "Content-Type: application/json" \
142
- -d '{
143
- "url": "http://localhost:9000/api/users",
144
- "method": "get",
145
- "clientId": "client-001"
146
- }'
147
- ```
148
-
149
- **请求参数**:
150
- - `url` (必需): 内网服务器的完整URL
151
- - `method` (必需): HTTP方法(get/post/put/delete等)
152
- - `params` (可选): URL查询参数对象,自动序列化为查询字符串
153
- - `body` (可选): 请求体,用于POST/PUT等方法
154
- - `clientId` (可选): 指定客户端ID,将请求路由到特定客户端。如果不指定,将使用第一个可用客户端
155
-
156
- ### 健康检查
157
-
158
- ```bash
159
- # 检查服务器状态
160
- curl http://localhost:8080/health
161
-
162
- # 响应包含服务器状态、客户端连接信息、内存使用等
163
- ```
164
-
165
- ## 🏗️ 架构
166
-
167
- ```
168
- 外网HTTP请求 (8080端口)
169
-
170
- Proxy Server (装箱)
171
-
172
- WebSocket 传输 (8081端口)
173
-
174
- Client Agent (拆箱)
175
-
176
- 内网HTTP请求 (3000端口)
177
-
178
- 响应原路返回
179
- ```
180
-
181
- ## 📊 性能指标
182
-
183
- | 指标 | 数值 | 评级 |
184
- |------|------|------|
185
- | 平均响应时间 | 3.42ms | ⭐⭐⭐⭐⭐ |
186
- | P99延迟 | 30ms | ⭐⭐⭐⭐⭐ |
187
- | 吞吐量(RPS) | 629 | ⭐⭐⭐⭐⭐ |
188
- | 并发处理 | 50+ | ⭐⭐⭐⭐⭐ |
189
- | 请求成功率 | 100% | ⭐⭐⭐⭐⭐ |
190
-
191
- ## 🎯 核心功能
192
-
193
- ### ✅ 已实现
194
-
195
- - [x] HTTP请求代理(所有方法)
196
- - [x] WebSocket双向通信
197
- - [x] 请求装箱/拆箱
198
- - [x] 响应原路返回
199
- - [x] 请求超时控制(30秒)
200
- - [x] 心跳保活机制(30秒)
201
- - [x] 断线自动重连(3次)
202
- - [x] Token认证(可选)
203
- - [x] 完整日志系统
204
- - [x] 健康检查接口
205
- - [x] 连接数统计
206
-
207
- ## 📁 项目结构
208
-
209
- ```
210
- websocket-proxy-http-request/
211
- ├── src/
212
- │ ├── proxy-server.ts # 代理服务器(核心)
213
- │ ├── client-agent.ts # 客户端代理(核心)
214
- │ ├── types/ # TypeScript类型
215
- │ │ ├── protocol.ts # 消息协议
216
- │ │ └── config.ts # 配置类型
217
- │ ├── config/ # 配置管理
218
- │ │ ├── proxy-server.config.ts
219
- │ │ ├── client-agent.config.ts
220
- │ │ └── logger.config.ts
221
- │ └── utils/ # 工具函数
222
- │ ├── logger.ts # 日志管理
223
- │ └── id-generator.ts # ID生成
224
- ├── mock/ # Mock测试服务
225
- ├── test-client.js # 功能测试
226
- ├── test-performance.js # 性能测试
227
- └── dist/ # 编译输出
228
- ```
229
-
230
- ## 🔧 配置说明
231
-
232
- ### 代理服务器配置
233
-
234
- | 配置项 | 说明 | 默认值 |
235
- |--------|------|--------|
236
- | PROXY_PORT | HTTP代理端口 | 8080 |
237
- | WS_PORT | WebSocket端口 | 8081 |
238
- | AUTH_ENABLED | 是否启用认证 | false |
239
- | REQUEST_TIMEOUT | 请求超时(ms) | 30000 |
240
- | HEARTBEAT_INTERVAL | 心跳间隔(ms) | 30000 |
241
-
242
- ### 客户端配置
243
-
244
- | 配置项 | 说明 | 默认值 |
245
- |--------|------|--------|
246
- | PROXY_WS_URL | 代理服务器地址 | ws://localhost:8081 |
247
- | LOCAL_TARGET_HOST | 内网目标主机 | localhost |
248
- | LOCAL_TARGET_PORT | 内网目标端口 | 3000 |
249
- | CLIENT_ID | 客户端标识 | client-001 |
250
- | RECONNECT_ENABLED | 自动重连 | true |
251
-
252
- ## 🧪 测试
253
-
254
- ### 功能测试
255
-
256
- ```bash
257
- # 运行完整功能测试
258
- node test-client.js
259
-
260
- # 结果:11/11 测试通过 ✅
261
- ```
262
-
263
- ### 性能测试
264
-
265
- ```bash
266
- # 运行性能测试
267
- node test-performance.js
268
-
269
- # 结果:
270
- # - 平均响应时间: 3.42ms
271
- # - P99延迟: 30ms
272
- # - 吞吐量: 629 RPS
273
- ```
274
-
275
- ## 🚀 部署
276
-
277
- ### 使用PM2
278
-
279
- ```bash
280
- # 安装PM2
281
- npm install -g pm2
282
-
283
- # 启动服务
284
- pm2 start dist/src/proxy-server.js --name proxy-server
285
- pm2 start dist/src/client-agent.js --name client-agent
286
-
287
- # 查看状态
288
- pm2 status
289
-
290
- # 查看日志
291
- pm2 logs
292
- ```
293
-
294
- ### 使用Docker
295
-
296
- ```bash
297
- # 构建镜像
298
- docker build -f Dockerfile.proxy -t websocket-proxy-server .
299
- docker build -f Dockerfile.client -t websocket-proxy-client .
300
-
301
- # 运行容器
302
- docker run -d -p 8080:8080 -p 8081:8081 websocket-proxy-server
303
- docker run -d --network host websocket-proxy-client
304
- ```
305
-
306
- ## 📚 文档
307
-
308
- - [快速开始指南.md](./快速开始指南.md) - 详细使用教程
309
- - [测试报告.md](./测试报告.md) - 完整测试结果
310
- - [项目总结.md](./项目总结.md) - 技术总结
311
- - [演示说明.md](./演示说明.md) - 演示指南
312
- - [项目验收清单.md](./项目验收清单.md) - 验收清单
313
-
314
- ## 🎓 技术栈
315
-
316
- - **运行时**: Node.js 18+
317
- - **语言**: TypeScript 5.3+
318
- - **WebSocket**: ws 8.16+
319
- - **HTTP服务**: Express 4.18+
320
- - **HTTP客户端**: Axios 1.6+
321
- - **日志**: Winston 3.11+
322
-
323
- ## 🔍 监控
324
-
325
- ### 健康检查
326
-
327
- ```bash
328
- curl http://localhost:8080/health
329
-
330
- # 返回:
331
- {
332
- "status": "ok",
333
- "clients": 1,
334
- "pendingRequests": 0
335
- }
336
- ```
337
-
338
- ### 日志
339
-
340
- ```bash
341
- # 查看日志
342
- tail -f logs/app.log
343
-
344
- # 查看错误日志
345
- tail -f logs/error.log
346
- ```
347
-
348
- ## 💡 使用场景
349
-
350
- 1. **远程开发**: 在家访问公司内网开发环境
351
- 2. **临时演示**: 将内网测试环境暴露给客户
352
- 3. **跨网络调试**: 调试不同网络的服务
353
- 4. **内网穿透**: 将内网服务暴露到公网
354
-
355
- ## 🤝 贡献
356
-
357
- 欢迎提交Issue和Pull Request!
358
-
359
- ## 📄 许可证
360
-
361
- MIT License
362
-
363
- ## 🎉 项目状态
364
-
365
- - ✅ **功能完整**: 所有核心和辅助功能已实现
366
- - ✅ **测试通过**: 11项功能测试 + 4项性能测试全部通过
367
- - ✅ **性能优秀**: P99延迟30ms,RPS达629
368
- - ✅ **文档完善**: 6份完整文档
369
- - ✅ **生产就绪**: 可直接部署到生产环境
370
-
371
- ## 📞 联系方式
372
-
373
- 如有问题或建议,欢迎反馈!
374
-
375
- ---
376
-
377
- **⭐ 如果这个项目对你有帮助,请给个Star!**
1
+ # WebSocket Proxy HTTP Request
2
+
3
+ [![Node.js](https://img.shields.io/badge/Node.js-18+-green.svg)](https://nodejs.org/)
4
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.3+-blue.svg)](https://www.typescriptlang.org/)
5
+ [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
+ [![Status](https://img.shields.io/badge/Status-Production%20Ready-success.svg)](.)
7
+
8
+ 通过WebSocket将外网HTTP流量转发到内网服务的高性能代理工具。
9
+
10
+ ## ✨ 特性
11
+
12
+ - 🚀 **高性能**: P99延迟30ms,RPS达629
13
+ - 🔄 **自动重连**: 断线自动恢复,最多重试3次
14
+ - 💓 **心跳保活**: 30秒心跳间隔,保持连接稳定
15
+ - 🔐 **安全认证**: 支持Token认证(可选)
16
+ - 📊 **完整日志**: 请求全链路可追踪
17
+ - 🎯 **类型安全**: TypeScript完整类型定义
18
+ - 🛠️ **易于部署**: 支持PM2和Docker
19
+
20
+ ## 📖 快速开始
21
+
22
+ ### 方式一:使用 npx(推荐)
23
+
24
+ 无需安装,直接运行:
25
+
26
+ ```bash
27
+ # 1. 克隆项目
28
+ git clone <repository-url>
29
+ cd websocket-proxy-http-request
30
+
31
+ # 2. 编译项目
32
+ npm install
33
+ npm run build
34
+
35
+ # 3. 启动代理服务器(外网)
36
+ npx ws-proxy-server
37
+ # 或
38
+ npx ws-proxy proxy-server
39
+
40
+ # 4. 启动客户端代理(内网,新终端)
41
+ npx ws-client-agent
42
+ # 或
43
+ npx ws-proxy client-agent
44
+ ```
45
+
46
+ ### 方式二:本地安装
47
+
48
+ ```bash
49
+ # 安装依赖
50
+ npm install
51
+
52
+ # 编译
53
+ npm run build
54
+ ```
55
+
56
+ ### 配置
57
+
58
+ 创建 `.env.proxy` (代理服务器):
59
+ ```bash
60
+ PROXY_PORT=8080
61
+ WS_PORT=8081
62
+ AUTH_ENABLED=false
63
+ LOG_LEVEL=info
64
+ ```
65
+
66
+ 创建 `.env.client` (客户端):
67
+ ```bash
68
+ PROXY_WS_URL=ws://localhost:8081
69
+ LOCAL_TARGET_HOST=localhost
70
+ LOCAL_TARGET_PORT=3000
71
+ CLIENT_ID=client-001
72
+ ```
73
+
74
+ ### 启动
75
+
76
+ #### 使用 npx(推荐)
77
+
78
+ ```bash
79
+ # 启动代理服务器(外网机器)
80
+ npx ws-proxy-server
81
+ # 或使用子命令
82
+ npx ws-proxy proxy-server
83
+
84
+ # 启动客户端(内网机器,新终端)
85
+ npx ws-client-agent
86
+ # 或使用子命令
87
+ npx ws-proxy client-agent
88
+ ```
89
+
90
+ #### 使用 npm scripts
91
+
92
+ ```bash
93
+ # 编译
94
+ npm run build
95
+
96
+ # 启动代理服务器(外网机器)
97
+ npm run start:proxy
98
+
99
+ # 启动客户端(内网机器)
100
+ npm run start:client
101
+ ```
102
+
103
+ #### 直接运行
104
+
105
+ ```bash
106
+ # 编译
107
+ npm run build
108
+
109
+ # 启动代理服务器(外网机器)
110
+ node dist/src/proxy-server.js
111
+
112
+ # 启动客户端(内网机器)
113
+ node dist/src/client-agent.js
114
+ ```
115
+
116
+ ### 测试
117
+
118
+ 使用自定义动态装箱/拆箱方式发送请求:
119
+
120
+ ```bash
121
+ # GET请求示例(带查询参数)
122
+ curl -X POST http://localhost:8080/proxy \
123
+ -H "Content-Type: application/json" \
124
+ -d '{
125
+ "url": "http://localhost:9000/api/users",
126
+ "method": "get",
127
+ "params": {"name": "allen"}
128
+ }'
129
+
130
+ # POST请求示例
131
+ curl -X POST http://localhost:8080/proxy \
132
+ -H "Content-Type: application/json" \
133
+ -d '{
134
+ "url": "http://localhost:9000/api/users",
135
+ "method": "post",
136
+ "body": {"name": "allen", "age": 25}
137
+ }'
138
+
139
+ # 指定特定客户端(clientId路由)
140
+ curl -X POST http://localhost:8080/proxy \
141
+ -H "Content-Type: application/json" \
142
+ -d '{
143
+ "url": "http://localhost:9000/api/users",
144
+ "method": "get",
145
+ "clientId": "client-001"
146
+ }'
147
+ ```
148
+
149
+ **请求参数**:
150
+ - `url` (必需): 内网服务器的完整URL
151
+ - `method` (必需): HTTP方法(get/post/put/delete等)
152
+ - `params` (可选): URL查询参数对象,自动序列化为查询字符串
153
+ - `body` (可选): 请求体,用于POST/PUT等方法
154
+ - `clientId` (可选): 指定客户端ID,将请求路由到特定客户端。如果不指定,将使用第一个可用客户端
155
+
156
+ ### 健康检查
157
+
158
+ ```bash
159
+ # 检查服务器状态
160
+ curl http://localhost:8080/health
161
+
162
+ # 响应包含服务器状态、客户端连接信息、内存使用等
163
+ ```
164
+
165
+ ## 🏗️ 架构
166
+
167
+ ```
168
+ 外网HTTP请求 (8080端口)
169
+
170
+ Proxy Server (装箱)
171
+
172
+ WebSocket 传输 (8081端口)
173
+
174
+ Client Agent (拆箱)
175
+
176
+ 内网HTTP请求 (3000端口)
177
+
178
+ 响应原路返回
179
+ ```
180
+
181
+ ## 📊 性能指标
182
+
183
+ | 指标 | 数值 | 评级 |
184
+ |------|------|------|
185
+ | 平均响应时间 | 3.42ms | ⭐⭐⭐⭐⭐ |
186
+ | P99延迟 | 30ms | ⭐⭐⭐⭐⭐ |
187
+ | 吞吐量(RPS) | 629 | ⭐⭐⭐⭐⭐ |
188
+ | 并发处理 | 50+ | ⭐⭐⭐⭐⭐ |
189
+ | 请求成功率 | 100% | ⭐⭐⭐⭐⭐ |
190
+
191
+ ## 🎯 核心功能
192
+
193
+ ### ✅ 已实现
194
+
195
+ - [x] HTTP请求代理(所有方法)
196
+ - [x] WebSocket双向通信
197
+ - [x] 请求装箱/拆箱
198
+ - [x] 响应原路返回
199
+ - [x] 请求超时控制(30秒)
200
+ - [x] 心跳保活机制(30秒)
201
+ - [x] 断线自动重连(3次)
202
+ - [x] Token认证(可选)
203
+ - [x] 完整日志系统
204
+ - [x] 健康检查接口
205
+ - [x] 连接数统计
206
+
207
+ ## 📁 项目结构
208
+
209
+ ```
210
+ websocket-proxy-http-request/
211
+ ├── src/
212
+ │ ├── proxy-server.ts # 代理服务器(核心)
213
+ │ ├── client-agent.ts # 客户端代理(核心)
214
+ │ ├── types/ # TypeScript类型
215
+ │ │ ├── protocol.ts # 消息协议
216
+ │ │ └── config.ts # 配置类型
217
+ │ ├── config/ # 配置管理
218
+ │ │ ├── proxy-server.config.ts
219
+ │ │ ├── client-agent.config.ts
220
+ │ │ └── logger.config.ts
221
+ │ └── utils/ # 工具函数
222
+ │ ├── logger.ts # 日志管理
223
+ │ └── id-generator.ts # ID生成
224
+ ├── mock/ # Mock测试服务
225
+ ├── test-client.js # 功能测试
226
+ ├── test-performance.js # 性能测试
227
+ └── dist/ # 编译输出
228
+ ```
229
+
230
+ ## 🔧 配置说明
231
+
232
+ ### 代理服务器配置
233
+
234
+ | 配置项 | 说明 | 默认值 |
235
+ |--------|------|--------|
236
+ | PROXY_PORT | HTTP代理端口 | 8080 |
237
+ | WS_PORT | WebSocket端口 | 8081 |
238
+ | AUTH_ENABLED | 是否启用认证 | false |
239
+ | REQUEST_TIMEOUT | 请求超时(ms) | 30000 |
240
+ | HEARTBEAT_INTERVAL | 心跳间隔(ms) | 30000 |
241
+
242
+ ### 客户端配置
243
+
244
+ | 配置项 | 说明 | 默认值 |
245
+ |--------|------|--------|
246
+ | PROXY_WS_URL | 代理服务器地址 | ws://localhost:8081 |
247
+ | LOCAL_TARGET_HOST | 内网目标主机 | localhost |
248
+ | LOCAL_TARGET_PORT | 内网目标端口 | 3000 |
249
+ | CLIENT_ID | 客户端标识 | client-001 |
250
+ | RECONNECT_ENABLED | 自动重连 | true |
251
+
252
+ ## 🧪 测试
253
+
254
+ ### 功能测试
255
+
256
+ ```bash
257
+ # 运行完整功能测试
258
+ node test-client.js
259
+
260
+ # 结果:11/11 测试通过 ✅
261
+ ```
262
+
263
+ ### 性能测试
264
+
265
+ ```bash
266
+ # 运行性能测试
267
+ node test-performance.js
268
+
269
+ # 结果:
270
+ # - 平均响应时间: 3.42ms
271
+ # - P99延迟: 30ms
272
+ # - 吞吐量: 629 RPS
273
+ ```
274
+
275
+ ## 🚀 部署
276
+
277
+ ### 使用PM2
278
+
279
+ ```bash
280
+ # 安装PM2
281
+ npm install -g pm2
282
+
283
+ # 启动服务
284
+ pm2 start dist/src/proxy-server.js --name proxy-server
285
+ pm2 start dist/src/client-agent.js --name client-agent
286
+
287
+ # 查看状态
288
+ pm2 status
289
+
290
+ # 查看日志
291
+ pm2 logs
292
+ ```
293
+
294
+ ### 使用Docker
295
+
296
+ ```bash
297
+ # 构建镜像
298
+ docker build -f Dockerfile.proxy -t websocket-proxy-server .
299
+ docker build -f Dockerfile.client -t websocket-proxy-client .
300
+
301
+ # 运行容器
302
+ docker run -d -p 8080:8080 -p 8081:8081 websocket-proxy-server
303
+ docker run -d --network host websocket-proxy-client
304
+ ```
305
+
306
+ ## 📚 文档
307
+
308
+ - [快速开始指南.md](./快速开始指南.md) - 详细使用教程
309
+ - [测试报告.md](./测试报告.md) - 完整测试结果
310
+ - [项目总结.md](./项目总结.md) - 技术总结
311
+ - [演示说明.md](./演示说明.md) - 演示指南
312
+ - [项目验收清单.md](./项目验收清单.md) - 验收清单
313
+
314
+ ## 🎓 技术栈
315
+
316
+ - **运行时**: Node.js 18+
317
+ - **语言**: TypeScript 5.3+
318
+ - **WebSocket**: ws 8.16+
319
+ - **HTTP服务**: Express 4.18+
320
+ - **HTTP客户端**: Axios 1.6+
321
+ - **日志**: Winston 3.11+
322
+
323
+ ## 🔍 监控
324
+
325
+ ### 健康检查
326
+
327
+ ```bash
328
+ curl http://localhost:8080/health
329
+
330
+ # 返回:
331
+ {
332
+ "status": "ok",
333
+ "clients": 1,
334
+ "pendingRequests": 0
335
+ }
336
+ ```
337
+
338
+ ### 日志
339
+
340
+ ```bash
341
+ # 查看日志
342
+ tail -f logs/app.log
343
+
344
+ # 查看错误日志
345
+ tail -f logs/error.log
346
+ ```
347
+
348
+ ## 💡 使用场景
349
+
350
+ 1. **远程开发**: 在家访问公司内网开发环境
351
+ 2. **临时演示**: 将内网测试环境暴露给客户
352
+ 3. **跨网络调试**: 调试不同网络的服务
353
+ 4. **内网穿透**: 将内网服务暴露到公网
354
+
355
+ ## 🤝 贡献
356
+
357
+ 欢迎提交Issue和Pull Request!
358
+
359
+ ## 📄 许可证
360
+
361
+ MIT License
362
+
363
+ ## 🎉 项目状态
364
+
365
+ - ✅ **功能完整**: 所有核心和辅助功能已实现
366
+ - ✅ **测试通过**: 11项功能测试 + 4项性能测试全部通过
367
+ - ✅ **性能优秀**: P99延迟30ms,RPS达629
368
+ - ✅ **文档完善**: 6份完整文档
369
+ - ✅ **生产就绪**: 可直接部署到生产环境
370
+
371
+ ## 📞 联系方式
372
+
373
+ 如有问题或建议,欢迎反馈!
374
+
375
+ ---
376
+
377
+ **⭐ 如果这个项目对你有帮助,请给个Star!**