feat: add http rate limiting

This commit is contained in:
2026-01-17 09:47:49 +08:00
parent 4f2b8ea3ad
commit c399a65d83
4 changed files with 68 additions and 16 deletions

View File

@@ -38,6 +38,13 @@ Port = 8080 # HTTP 监听端口
# AllowMethods = "GET,POST,PUT,DELETE"
# ExposeHeaders = "X-Request-Id"
# AllowCredentials = true
[Http.RateLimit]
# Enabled = true
# Max = 120 # 每窗口最大请求数
# WindowSeconds = 60 # 窗口大小(秒)
# Message = "Too Many Requests"
# SkipPaths = ["/healthz", "/readyz"]
# =========================
# Connection Multiplexer (providers/cmux)
# 用于同端口同时暴露 HTTP + gRPCcmux -> 分发到 Http/Grpc