import { type RequestHeadRefusal } from "./RequestHead.js"; export type InterceptProtocol = "TLS" | "HTTP"; export type DestinationReading = /** The bytes so far decide nothing yet; read more, under the bound. */ { readonly kind: "NEED_MORE"; } | { readonly kind: "DESTINATION"; readonly protocol: InterceptProtocol; readonly host: string; readonly port: number; /** The request line's method and target for HTTP; TLS carries neither in the clear. */ readonly method?: string; readonly target?: string; readonly alpn?: readonly string[]; } | { readonly kind: "REFUSED"; readonly reason: DestinationRefusal; readonly protocol: InterceptProtocol | null; readonly detail?: RequestHeadRefusal; }; export type DestinationRefusal = /** Neither TLS with a server name nor HTTP/1 with a host: no witness to the destination. */ "DESTINATION_UNKNOWN" /** TLS or HTTP whose head does not follow its grammar. */ | "MALFORMED"; /** The most bytes read while waiting for a head; a hello that needs more at this size is refused. */ export declare const MAX_PEEK_BYTES = 65536; /** * Reads the destination from a connection's first bytes. `fallbackPort` is * the port the connection was addressed to before it was redirected, which * the listener knows and the bytes may not name. */ export declare function readDestination(bytes: Uint8Array, fallbackPort: number): DestinationReading; //# sourceMappingURL=Destination.d.ts.map