UNPKG

@push.rocks/smartproxy

Version:

A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.

33 lines (32 loc) 1.41 kB
import type { IMatcher, IHeaderMatchOptions } from '../types.js'; /** * HeaderMatcher provides HTTP header matching functionality * Supporting exact matches, patterns, and case-insensitive matching */ export declare class HeaderMatcher implements IMatcher<boolean, IHeaderMatchOptions> { /** * Match a header value against a pattern * @param pattern The pattern to match * @param value The header value to test * @param options Matching options * @returns true if the value matches the pattern */ static match(pattern: string, value: string | undefined, options?: IHeaderMatchOptions): boolean; /** * Match multiple headers against a set of required headers * @param requiredHeaders Headers that must match * @param actualHeaders Actual request headers * @param options Matching options * @returns true if all required headers match */ static matchAll(requiredHeaders: Record<string, string>, actualHeaders: Record<string, string | string[] | undefined>, options?: IHeaderMatchOptions): boolean; /** * Calculate the specificity of header requirements * More headers = more specific */ static calculateSpecificity(headers: Record<string, string>): number; /** * Instance method for interface compliance */ match(pattern: string, value: string, options?: IHeaderMatchOptions): boolean; }