smartproxy/ts/index.ts
Philipp Kunz 54ffbadb86 feat(routing): Implement unified routing and matching system
- Introduced a centralized routing module with comprehensive matchers for domains, headers, IPs, and paths.
- Added DomainMatcher for domain pattern matching with support for wildcards and specificity calculation.
- Implemented HeaderMatcher for HTTP header matching, including exact matches and pattern support.
- Developed IpMatcher for IP address matching, supporting CIDR notation, ranges, and wildcards.
- Created PathMatcher for path matching with parameter extraction and wildcard support.
- Established RouteSpecificity class to calculate and compare route specificity scores.
- Enhanced HttpRouter to utilize the new matching system, supporting both modern and legacy route configurations.
- Added detailed logging and error handling for routing operations.
2025-06-02 03:57:52 +00:00

48 lines
2.6 KiB
TypeScript

/**
* SmartProxy main module exports
*/
// Legacy exports (to maintain backward compatibility)
// Migrated to the new proxies structure
export * from './proxies/nftables-proxy/index.js';
// Export HttpProxy elements selectively to avoid RouteManager ambiguity
export { HttpProxy, CertificateManager, ConnectionPool, RequestHandler, WebSocketHandler } from './proxies/http-proxy/index.js';
export type { IMetricsTracker, MetricsTracker } from './proxies/http-proxy/index.js';
// Export models except IAcmeOptions to avoid conflict
export type { IHttpProxyOptions, ICertificateEntry, ILogger } from './proxies/http-proxy/models/types.js';
export { RouteManager as HttpProxyRouteManager } from './proxies/http-proxy/models/types.js';
// Backward compatibility exports (deprecated)
export { HttpProxy as NetworkProxy } from './proxies/http-proxy/index.js';
export type { IHttpProxyOptions as INetworkProxyOptions } from './proxies/http-proxy/models/types.js';
export { HttpProxyBridge as NetworkProxyBridge } from './proxies/smart-proxy/index.js';
// Certificate and Port80 modules have been removed - use SmartCertManager instead
// Redirect module has been removed - use route-based redirects instead
// Export SmartProxy elements selectively to avoid RouteManager ambiguity
export { SmartProxy, ConnectionManager, SecurityManager, TimeoutManager, TlsManager, HttpProxyBridge, RouteConnectionHandler, SmartCertManager } from './proxies/smart-proxy/index.js';
export { SharedRouteManager as RouteManager } from './core/utils/route-manager.js';
// Export smart-proxy models
export type { ISmartProxyOptions, IConnectionRecord, IRouteConfig, IRouteMatch, IRouteAction, IRouteTls, IRouteContext } from './proxies/smart-proxy/models/index.js';
export type { TSmartProxyCertProvisionObject } from './proxies/smart-proxy/models/interfaces.js';
export * from './proxies/smart-proxy/utils/index.js';
// Original: export * from './smartproxy/classes.pp.snihandler.js'
// Now we export from the new module
export { SniHandler } from './tls/sni/sni-handler.js';
// Original: export * from './smartproxy/classes.pp.interfaces.js'
// Now we export from the new module (selectively to avoid conflicts)
// Core types and utilities
export * from './core/models/common-types.js';
// Export IAcmeOptions from one place only
export type { IAcmeOptions } from './proxies/smart-proxy/models/interfaces.js';
// Modular exports for new architecture
export * as forwarding from './forwarding/index.js';
// Certificate module has been removed - use SmartCertManager instead
export * as tls from './tls/index.js';
export * as routing from './routing/index.js';