import type { FastifyRequest } from "fastify"; /** * 解析客户端 IP 地址 * * Fastify 内置 trustProxy 支持(通过 Fastify 配置项 trustProxy), * 但 vext 有自己的 trustProxy 逻辑(config.trustProxy)。 * 为保持 Adapter 间行为一致,此处自行解析,与 Hono Adapter 逻辑对齐。 * * trustProxy = true 时,从 X-Forwarded-For 请求头读取第一个 IP(代理链的原始客户端 IP)。 * trustProxy = false 时,从底层 socket 的 remoteAddress 读取。 * * @param request Fastify Request 对象 * @param trustProxy 是否信任代理(来自 VextConfig.trustProxy) * @returns 客户端 IP 地址 */ export declare function resolveIp(request: FastifyRequest, trustProxy: boolean): string; /** * 解析请求协议 * * trustProxy = true 时,从 X-Forwarded-Proto 请求头读取。 * trustProxy = false 时,检查 socket 是否为 TLS 加密连接。 * * @param request Fastify Request 对象 * @param trustProxy 是否信任代理(来自 VextConfig.trustProxy) * @returns 请求协议 'http' | 'https' */ export declare function resolveProtocol(request: FastifyRequest, trustProxy: boolean): "http" | "https";