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
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
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
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
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