9 Commits

Author SHA1 Message Date
xfy
0cf943fede refactor(config,test): 优化 parseSize 为 switch 并适配 NewProxyCache 签名
将 parseSize 的 if-else 改为 switch 语句;更新集成测试中
NewProxyCache 调用以匹配新增的 stale_if_error/stale_if_timeout 参数。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 10:41:56 +08:00
xfy
604bc719f9 test(integration): 添加缓存和代理集成测试
- cache_integration_test.go: 缓存创建、存取、过期、stale、并发测试
- proxy_integration_test.go: 代理创建、负载均衡、超时、健康检查测试

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 14:59:12 +08:00
xfy
ae0bec6c3b feat(internal): 实现 internal 指令
- 新增 IsInternalRedirect 检测内部重定向请求
- static handler 支持 internal 访问限制
- proxy handler 支持 internal 访问限制
- 支持 X-Accel-Redirect 内部重定向

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-20 18:09:06 +08:00
xfy
b0ca037cad test(integration): 添加正则 location 配置集成测试
- 测试 ~ 修饰符大小写敏感匹配
- 测试 ~* 修饰符大小写不敏感匹配
- 测试 ^~ 修饰符非正则前缀优先匹配

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-20 16:04:36 +08:00
xfy
ddc9e0cef1 test(integration): 添加端到端集成性能基准测试
覆盖静态文件、代理转发、中间件链、Lua 脚本和多路由场景的完整请求路径吞吐量。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 11:44:45 +08:00
xfy
8b382606df Merge branch 'lint-fix' - resolve sendfile.go conflict
Conflict: sendfile.go (!linux build tag) was incorrectly modified to
include linuxSendfile and getSocketFd functions which already exist
in sendfile_linux.go.

Resolution: Keep HEAD version (simple fallback returning ENOTSUP) as
Linux implementation is properly separated in sendfile_linux.go.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 09:26:48 +08:00
xfy
4e826925ac refactor: 适配核心模块类型重命名
适配 variable.NewContext/ReleaseContext
适配 resolver.DNSCacheEntry
适配 logging/formatJSON 常量

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 09:41:07 +08:00
xfy
392d0b3449 docs: 新增模块 AGENTS.md 文档,更新目录索引
- 新增 http2、integration、resolver、variable 模块 AGENTS.md
- 更新 internal/AGENTS.md 目录表,补充新模块条目
- 更新 docs/prompts.md 添加 generate-config 缺失项分析提示
- 同步更新日期戳至 2026-04-09

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 13:35:29 +08:00
xfy
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