|
|
6f17bbad7e
|
chore: remove trailing blank lines and clean up whitespace
|
2026-06-03 18:08:34 +08:00 |
|
xfy911
|
a136b07bb9
|
docs: add documentation comments for exported constants and variables
- Fix gjson/gjson.go package comments and constant documentation
- Fix internal/config/config.go constant documentation
- Fix internal/utils/httperror.go variable documentation
- Fix internal/matcher/matcher.go constant documentation
- Fix internal/middleware/compression/compression.go constant documentation
- Fix internal/middleware/limitrate/limitrate.go constant documentation
- Fix internal/middleware/rewrite/rewrite.go constant documentation
- Fix internal/middleware/security/access.go and auth.go constant documentation
- Fix internal/ssl/client_verify.go constant documentation
- Fix internal/variable/builtin.go and ssl.go constant documentation
- Fix internal/lua/api_log.go HTTP and log level constant documentation
- Fix internal/benchmark/tools/tools.go constant documentation
- Include author attribution (xfy)
|
2026-06-03 15:28:53 +08:00 |
|
xfy911
|
fc1de2d445
|
docs: add documentation comments for more exported constants and variables
- Add comments for ssl/client_verify.go verification modes
- Add comments for security/auth.go hash algorithms
- Add comments for rewrite/rewrite.go flags
- Add comments for compression/compression.go algorithms
- Add comments for limitrate/limitrate.go strategies
- Include author attribution (xfy)
|
2026-06-03 15:28:53 +08:00 |
|
|
|
cf2fcca7e8
|
refactor: 提取公共逻辑、消除重复代码、加强错误处理
- 提取 App 公共逻辑到 app_common.go,消除 app.go/app_windows.go 重复定义
- 提取 Server 生命周期/中间件/路由逻辑到独立文件(lifecycle.go/middleware_builder.go/router.go)
- 提取 Proxy 缓存处理/头部修改/目标选择到独立模块
- 提取 CheckIPAccess/CheckTokenAuth 到 utils/httperror.go,消除 status/purge 重复实现
- 修复 stream 双向转发:任一方向完成立即关闭双端,避免连接泄漏
- 修复 SSL/TLS 中静默忽略错误的问题,添加日志记录
- 统一日志消息为英文
💘 Generated with Crush
Assisted-by: GLM 5.1 via Crush <crush@charm.land>
|
2026-04-28 18:00:48 +08:00 |
|
|
|
2458ac1ed1
|
docs: 为其余模块添加标准化 godoc 注释
为剩余模块添加完整文档注释:
- app: 应用生命周期管理
- cache: 文件缓存
- config: 配置加载器
- handler: 静态文件处理和错误页面
- http2/http3: HTTP/2 和 HTTP/3 适配器
- loadbalance: 负载均衡算法和均衡器
- middleware: bodylimit、compression、rewrite、security
- mimeutil: MIME 类型检测
- netutil: URL 处理工具
- resolver: DNS 解析器
- server: 服务器升级处理
- ssl: SSL/TLS 和 OCSP
- stream: 流处理
- testutil: 测试工具
- variable: 变量池和 SSL 变量
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-04-20 10:59:53 +08:00 |
|
|
|
2af3176507
|
refactor(middleware): 适配变量系统和 resolver 重命名
适配 variable.NewContext/ReleaseContext
适配 resolver.DNSCacheEntry
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
2026-04-10 09:40:57 +08:00 |
|
|
|
9495a548e6
|
feat(proxy,server,logging): 集成变量系统和 DNS 解析器
变量系统集成:
- logging: 访问日志使用 variable 包展开模板
- rewrite: 重写规则支持变量展开
- proxy: 请求/响应头设置支持变量展开
DNS 解析器集成:
- app: 创建并启用 Resolver
- server: SetResolver/GetResolver 方法传递给 proxy
- proxy: SetResolver/Start 方法,后台 DNS 刷新协程
- proxy_dns.go: DNS 刷新逻辑和 IP 直连支持
新增集成测试:
- internal/integration/variable_test.go
- internal/integration/resolver_test.go
文档更新:
- docs/config-reference.md 配置参考文档
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
2026-04-08 11:36:49 +08:00 |
|
|
|
cb45e824d4
|
feat(middleware,rewrite): 增强 FlagLast 语义与循环检测
- FlagLast 重新从第一条规则开始匹配(nginx 兼容行为)
- 新增全局迭代计数器检测循环,限制最多 10 次迭代
- FlagBreak 不触发循环检测,直接停止
- 新增测试覆盖跨规则循环、迭代限制、nginx 兼容语义
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
2026-04-07 17:50:50 +08:00 |
|
|
|
351f477822
|
feat(middleware): 增强 rewrite 安全性,添加 ReDoS 保护
- 新增 validateRegexSafety 检测危险正则模式
- 防止嵌套量词导致的灾难性回溯攻击
- 限制正则模式长度 (max 1000 chars)
- 补充 compression 和 accesslog 文档注释
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-04-03 16:57:40 +08:00 |
|
|
|
9d24263918
|
feat(stream,server,handler): 实现 Phase 6 性能优化和热升级
新增功能:
- stream 模块: 流式传输支持,优化大文件和实时数据传输
- Goroutine 池: 限制并发数量,减少调度开销
- 优雅升级: 零停机热升级,继承父进程监听器
- sendfile: 零拷贝文件传输,大文件直接从内核传输
重构改进:
- App 结构体封装,支持热升级和信号处理
- 配置结构字段对齐和代码清理
- 完善错误处理和日志记录
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-04-03 10:39:22 +08:00 |
|
|
|
87a22b79f2
|
feat(middleware): 实现 URL 重写中间件
- 支持正则表达式匹配和替换
- 可配置多条重写规则
- 支持捕获组引用 ($1, $2 等)
- 规则按顺序依次应用
- 完整单元测试覆盖
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
2026-04-03 10:11:50 +08:00 |
|