xfy 4562dd5a7d docs: 添加子目录 AGENTS.md 文档
deepinit 生成的子目录级 AGENTS.md 文件,帮助 AI agents 理解各功能模块:
- docs/config/: advanced, basic, caching, load-balancing, lua, rewriting, security, ssl
- docs/lua/: api-gateway, authentication, caching, dynamic-routing, logging-monitoring, middleware, rate-limiting, websocket

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-23 10:35:49 +08:00

1.4 KiB
Raw Blame History

advanced

Purpose

高级功能配置示例目录,包含 WebSocket、gRPC、HTTP/2、HTTP/3、Stream 代理等高级协议配置。

Key Files

File Description
websocket.conf WebSocket 代理配置Upgrade 头处理、长连接支持
grpc.conf gRPC 代理配置HTTP/2 透传、超时设置
http2.conf HTTP/2 配置:多路复用、服务器推送、流控制
http3.conf HTTP/3 (QUIC) 配置UDP 传输、0-RTT 连接
stream-tcp.conf TCP Stream 代理:四层负载均衡、连接复用
stream-udp.conf UDP Stream 代理DNS 负载均衡、无状态转发

For AI Agents

Working In This Directory

  • HTTP/2 需要 HTTPSHTTP/3 需要 QUIC 支持
  • Stream 代理工作在四层TCP/UDP不解析 HTTP
  • WebSocket 需要正确处理 Upgrade 和 Connection 头

Testing Requirements

  • 高级协议通过集成测试验证
  • HTTP/3 测试需要 QUIC 客户端支持

Common Patterns

  • WebSocketproxy_set_header Upgrade $http_upgrade
  • gRPCgrpc_pass grpc://upstream
  • Streamlisten 12345 在 stream 块中

Dependencies

Internal

  • ../../../internal/http2/ - HTTP/2 实现
  • ../../../internal/http3/ - HTTP/3 (QUIC) 实现
  • ../../../internal/stream/ - Stream 代理实现
  • ../../../internal/proxy/websocket.go - WebSocket 代理