import { type RequestOptions, type IncomingMessage, type ServerResponse } from "node:http";
import type { BridgeConfig } from "./config.js";
import type { Logger } from "./logger.js";
export declare class RequestBodyTooLargeError extends Error {
    readonly maxBytes: number;
    constructor(maxBytes: number);
}
export declare class UpstreamRequestTimeoutError extends Error {
    readonly timeoutMs: number;
    constructor(timeoutMs: number);
}
export type UpstreamRequestOptions = RequestOptions & {
    servername?: string;
};
export declare function readRequestBody(request: IncomingMessage, maxBytes: number): Promise<Buffer>;
export declare function proxyRequest(request: IncomingMessage, response: ServerResponse, config: BridgeConfig, logger: Logger): void;
export declare function proxyBufferedRequest(request: IncomingMessage, response: ServerResponse, body: Buffer, config: BridgeConfig, logger: Logger): Promise<void>;
export declare function fetchUpstreamBuffer(request: IncomingMessage, body: Buffer, config: BridgeConfig): Promise<Buffer | undefined>;
export declare function upstreamRequestUrl(request: IncomingMessage, config: BridgeConfig): URL;
export declare function upstreamRequestOptions(request: IncomingMessage, config: BridgeConfig, upstreamUrl?: URL): UpstreamRequestOptions;
