feat(smartproxy): Update documentation and route helper functions; add createPortRange, createSecurityConfig, createStaticFileRoute, and createTestRoute helpers to the readme and tests. Refactor test examples to use the new helper API and remove legacy connection handling files (including the old connection handler and PortRangeManager) to fully embrace the unified route‐based configuration.
This commit is contained in:
@ -377,16 +377,10 @@ export class NetworkProxyBridge {
|
||||
publicKey: certCert,
|
||||
destinationIps: targetHosts,
|
||||
destinationPorts: [targetPort],
|
||||
proxyConfig: {
|
||||
targetIsTls: route.action.tls.mode === 'terminate-and-reencrypt',
|
||||
allowHTTP1: true,
|
||||
// Apply any other NetworkProxy-specific settings
|
||||
...(route.action.advanced ? {
|
||||
preserveHost: true,
|
||||
timeout: route.action.advanced.timeout,
|
||||
headers: route.action.advanced.headers
|
||||
} : {})
|
||||
}
|
||||
// Use backendProtocol for TLS re-encryption:
|
||||
backendProtocol: route.action.tls.mode === 'terminate-and-reencrypt' ? 'http2' : 'http1',
|
||||
// Add rewriteHostHeader for host header handling:
|
||||
rewriteHostHeader: route.action.advanced?.headers ? true : false
|
||||
};
|
||||
|
||||
configs.push(config);
|
||||
|
Reference in New Issue
Block a user