qing
0af9019af8
docs: 分发 CHANGELOG 内容到各模块文档并删除 CHANGELOG.md
...
- gateway/README.md: 新增 0.8.0 版本条目(P0 安全修复、进程退出 bug 修复、完整特性列表),修正版本号 0.7.0→0.8.0
- libhttp/README.md: 新增 v3.4.4 版本条目(Listener::close、doAccept 递归修复、stop() 改进)
- README.md: 修正 gateway 版本号 v0.5.3→v0.8.0
- docs/INDEX.md: 移除 CHANGELOG 引用行
- 删除 CHANGELOG.md(内容已分发,安全审计详情已在 gateway_SECURITY_AUDIT_20260807.md 完整覆盖)
2026-08-08 14:49:21 +00:00
qing
117fc0241e
fix(libhttp,dnfs2): HttpClient 新增超时接口,dnfs2 启用配置超时
...
修复 dnfs2 审计 L-3(P2-N5):
libhttp HttpClient 硬编码 CURLOPT_TIMEOUT=30L/CONNECTTIMEOUT=10L,
dnfs2 的 gateway_timeout/review_timeout 配置加载后从未使用,实际超时恒为 30s。
修复:
- libhttp HttpClient 新增 set_timeout/set_connect_timeout 接口
(默认 30s/10s,向后兼容 gateway/core)
- request_stream_sync 使用成员变量替代硬编码值
- dnfs2 decode_token 设置 gateway_timeout
- dnfs2 review_content 设置 review_timeout
安全评级 A- → A,已知限制 6→5 项。
2026-08-08 01:33:57 +08:00
qing
e815f0ec40
fix(gateway,libhttp): 修复进程无法退出bug,完成P0安全问题修复
...
安全修复(P0):
- 修复4处错误消息泄露内部步骤问题,替换为用户友好文案
- 修正拼写错误 "Registe" -> "Registration"
- 修正注册失败HTTP状态码 400 -> 500
- 所有P0严重问题100%修复,安全评级提升至A-
稳定性修复(关键):
- 修复信号处理非async-signal-safe问题:仅设置原子标志,杜绝死锁
- 新增SIGPIPE忽略处理,防止写关闭socket时进程意外终止
- 修复Listener::doAccept()关闭后无限递归导致CPU 100%空转bug
- 新增Listener::close()方法,stop()先关闭acceptor再停止ioc
- 改进stop()流程:acceptor->WS客户端->ioc->worker线程 有序关闭
- 新增双重超时保护:stop() 8秒、日志flush 3秒,超时强制exit保证进程绝不挂死
- 服务器事件循环改为独立线程运行,主线程负责信号检测和关闭协调
文档:
- 新增CHANGELOG.md更新日志
- 更新gateway安全审计文档,添加稳定性修复记录
- 更新docs/INDEX.md文档索引
2026-08-07 23:07:35 +08:00
qing
d680dcd058
fix: 修复 WebSocket 长连接空闲断线问题
...
三处协同修复:
1. 前端 aibox.js 添加 25s 心跳(ping),防止 gateway 30s 空闲超时
2. gateway libhttp doWsRead 对 WS 代理连接跳过空闲超时
3. aibox.py _handle_tool_calls 启动 drain 线程实时排空输出队列,
避免 SubAgent 等长时间工具执行期间前端收不到数据
2026-08-05 01:58:19 +08:00
qing
4d9bb5d940
fix(libhttp): WebSocket 发送/代理队列上限防 OOM (P1-6)
...
- 新增 setMaxWsQueueSize()(default 1000),每个入队点检查
- wsSend / onProxyReadClient / onProxyReadBackend 超限关闭连接
- 更新审计文档 P1-6 状态、README v3.4.3
2026-08-04 18:27:50 +08:00
qing
37c6d401d6
fix(libhttp): 服务器读超时防 Slowloris (P1-4)
...
- 新增 setHeaderTimeout()(default 10s) / setReadTimeout()(default 30s),对齐 WAF
- doSSLHandshake 设置头超时覆盖握手,doRead 拆分为 async_read_header (头超时) + async_read (体超时)
- doWsRead 每次读取设置空闲超时,自动清理长期空闲连接
- 更新审计文档 P1-4 状态、README v3.4.2
2026-08-04 17:39:27 +08:00
qing
507054c4b2
fix(libhttp): WebSocket 单条消息大小限制防 OOM (P1-3)
...
- 新增 setMaxWsMessageSize/getMaxWsMessageSize(默认 16MB,与 Beast 默认一致)
- 服务端 doWsUpgrade/doWssUpgrade 与代理流 onProxyConnect/onProxySslHandshake 创建后调用 read_message_max
- 超限消息由 Beast 在分配内存前拒绝并关闭连接
- 更新审计文档 P1-3 状态、README v3.4.1
2026-08-04 16:03:06 +08:00
qing
85e0d0740b
fix(libhttp): HttpClient 响应大小限制防 OOM
...
- request_stream_sync 改为真流式,按块回调不二次缓冲
- 新增 set_max_response_size/get_max_response_size(默认 10MB,对齐 WAF)
- write_callback 超限返回 0 中止传输并抛异常
- 更新审计文档 P1-2 状态、README v3.4.0、INDEX 移除不存在的文档
2026-08-04 15:12:06 +08:00
qing
fb485ebac4
fix(libhttp): 修复P1-5静态文件路径遍历 + 同步审计文档
...
- 新增 isSafeStaticPath() 校验静态文件路径,拒绝 ..、空字节、非/开头及URL编码遍历(%2e/%2f/%5c)
- handleRequest 静态文件服务前校验 target_path
- 审计文档标记 P1-5 已修复
2026-08-04 00:04:55 +08:00
qing
da4957c52d
fix(libhttp): 请求体大小限制可配置并超限返回 413 (P1-1)
2026-08-03 23:57:00 +08:00
qing
b37bf255d9
fix(libhttp): 删除遗留 WebSocketServer/WebSocketClient 并同步 CMakeLists 与 Makefile
2026-08-03 23:46:10 +08:00
qing
bd1d7ca4d0
refactor(libhttp): split HttpServer into modular TUs for faster incremental builds
...
Split the 1400-line HttpServer.cpp into 6 focused translation units by
functional area:
- HttpServer.cpp: core lifecycle, SSL init, session management, debug
- HttpServer_Listener.cpp: TCP connection acceptor
- HttpServer_Routes.cpp: route registration, matching, wildcard/query parsing
- HttpServer_Request.cpp: request dispatch, static files, CORS, HTTP I/O
- HttpServer_Ws.cpp: WS route registry, client management, broadcast APIs
- HttpServer_WsSession.cpp: per-session WS frames + bidirectional WS proxy
Add inc/us/detail/HttpServerImpl.hpp for internal shared definitions
(exception classes, full Session/Listener declarations) installed under
/usr/include/us/detail/. Update Makefile with proper dependency tracking.
Update README with Source Layout section and v3.3.0 changelog entry.
Modifying one module now only requires recompiling its corresponding .o
instead of the entire monolithic translation unit.
2026-08-01 13:15:52 +08:00
qing
e25c132722
解耦libhttp/HttpClient
2026-08-01 06:04:36 +08:00
qing
227fbb17f4
build(libhttp): lower optimization to -O2 to avoid cc1plus OOM on low-memory machines
2026-08-01 05:26:52 +08:00
qing
12ece9020c
feat(libhttp,gateway): add admin-only WebSocket reverse proxy
...
libhttp v3.1:
- add ws_proxy(path, handshake) API with WsProxyHandshakeHandler callback
- implement full-duplex async bidirectional bridging (text+binary frames)
- support ws:// and wss:// backends with SNI, write queues for ordering
- proxy routes take priority over regular ws() routes
- 403 response on handshake rejection, graceful close propagation
gateway v0.6.0:
- add [WsProxy] config section (routes = /path=ws://backend;...)
- handshake callback verifies Token (Authorization/Cookie) is_admin=true
- non-admin / expired / missing token → 403, admin → transparent bridge
- fix LocalTime.hpp C++20 tzdb incompatibility on Apple clang (use strftime/get_time/mktime)
- update example.ini and README docs for both modules
2026-08-01 05:20:14 +08:00
qing
9815ff44af
feat(libhttp): integrate WebSocket client into HttpClient
...
Merge WebSocket client functionality into HttpClient using Boost.Beast,
enabling a single client instance to handle both HTTP (libcurl) and
WebSocket (ws:// and wss://) protocols. Backward-compatible type aliases
(WebSocketClient, WebSocketClientBase) preserve existing code.
Changes:
- Add synchronous WebSocket client: ws_connect/ws_send/ws_recv/ws_close
- Support ws:// (plain TCP) and wss:// (TLS with SNI) connections
- Layered stream architecture with beast::tcp_stream for timeout support
- Binary message support via ws_send_binary()
- Update Makefile to link libcurl (-lcurl)
- Add README.md documenting unified HttpServer + HttpClient API
2026-08-01 04:59:47 +08:00
qing
ba9a77fe66
feat(libhttp): integrate WebSocket support into HttpServer
...
Merge WebSocketServer functionality into HttpServer so a single port can
serve both HTTP(S) and WebSocket(S) endpoints while preserving full backward
compatibility for existing HTTP interfaces.
Key changes:
- Add WebSocket route registration: ws(), onWsConnect(), onWsDisconnect()
- Add client management: sendToWsClient(), broadcastWs(), disconnectWsClient()
- Rewrite Session class using beast::tcp_stream for unified HTTP/WS handling
- Support automatic ws:// and wss:// upgrades on HTTP/HTTPS ports
- Thread-safe message queue with asio::post for cross-thread sends
- Update Makefile to link OpenSSL and pthread for TLS/WebSocket support
- Add test_server.cpp demonstrating HTTP + WebSocket mixed usage
2026-08-01 04:43:33 +08:00
qing
e4831522a4
docs: 新增 libhttp/libtry/pymsg/README.robot.md 技术手册,更新 BotOps/README.md
2026-07-30 12:38:31 +08:00
qing
419ae82858
修改HTTP LIBRARY,增加OPTIONS支持
...
修改GATEWAY,修复转发
修改dnfs,暂时不编译(找不到模板)
修改static,能够获取节点
2026-07-22 12:47:13 +08:00
qing
70d467d052
init
2026-07-20 11:12:29 +08:00