import { BaseProxy } from './BaseProxy.js'; import { ProxyUpstream } from './types.js'; /** * Proxy with dynamically configurable routing based on hostnames. * * Routes are matched against the destination hostname. First match wins. * Routes can optionally be labelled and removed by label. */ export declare class RoutingProxy extends BaseProxy { protected routes: ProxyRoute[]; getRoutes(): ProxyRoute[]; matchRoute(host: string): ProxyUpstream | null; /** * Clears routing table. All requests will be routed directly. */ clearRoutes(): void; /** * Inserts a new route. Requests matching `hostPattern` are routed to `upstream`. * Inserted at the beginning by default; first match wins. */ insertRoute(route: ProxyInsertRouteSpec, index?: number): void; /** * Removes routes matching the specified label. */ removeRoutes(label: string): void; } export interface ProxyRoute { label: string; hostPattern: string; upstream: ProxyUpstream | null; } export interface ProxyInsertRouteSpec { label?: string; hostPattern: string; upstream: ProxyUpstream | null; }