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.

43 lines (42 loc) 1.23 kB
/** * Parser utilities for protocol detection * Now delegates to protocol modules for actual parsing */ import type { THttpMethod, TTlsVersion } from '../models/detection-types.js'; import { HTTP_METHODS, HTTP_VERSIONS } from '../../protocols/http/index.js'; export { HTTP_METHODS, HTTP_VERSIONS }; /** * Parse HTTP request line */ export declare function parseHttpRequestLine(line: string): { method: THttpMethod; path: string; version: string; } | null; /** * Parse HTTP header line */ export declare function parseHttpHeader(line: string): { name: string; value: string; } | null; /** * Parse HTTP headers from lines */ export declare function parseHttpHeaders(lines: string[]): Record<string, string>; /** * Convert TLS version bytes to version string */ export declare function tlsVersionToString(major: number, minor: number): TTlsVersion | null; /** * Extract domain from Host header value */ export declare function extractDomainFromHost(hostHeader: string): string; /** * Validate domain name */ export declare function isValidDomain(domain: string): boolean; /** * Check if string is a valid HTTP method */ export declare function isHttpMethod(str: string): str is THttpMethod;