Skip to main content

Module http

Module http 

Source

Functions§

inject_www_authenticate 🔒
Tower middleware: 如果下游(MCP service)返回 401/403 又没 WWW-Authenticate 头,补一个 Bearer resource_metadata="...",指向 /.well-known/oauth-protected-resource
oauth_protected_resource_metadata 🔒
RFC 9728 — OAuth 2.0 Protected Resource Metadata
render_mcp_metrics_body 🔒
HTTP 模式:axum + rmcp StreamableHttpService,/mcp 路径跑 MCP, /metrics 暴露 Prometheus counters(无需 token), /.well-known/oauth-protected-resource 暴露 OAuth2 Protected Resource Metadata(RFC 9728,给 MCP 客户端发现鉴权要求用)。
render_mcp_metrics_body_for 🔒
serve_http 🔒
shutdown_signal 🔒
监听 SIGTERM / SIGINT,任一到达即返回。 同时兼容 Windows(只有 ctrl_c)和 Unix(SIGTERM + SIGINT)。
wait_for_ctrl_c_or_pending 🔒