fix(smartproxy.portproxy): Optimize SNI handling by simplifying context creation
This commit is contained in:
		| @@ -3,6 +3,6 @@ | ||||
|  */ | ||||
| export const commitinfo = { | ||||
|   name: '@push.rocks/smartproxy', | ||||
|   version: '3.7.0', | ||||
|   version: '3.7.1', | ||||
|   description: 'a proxy for handling high workloads of proxying' | ||||
| } | ||||
|   | ||||
| @@ -73,14 +73,9 @@ export class PortProxy { | ||||
|           ...this.settings, | ||||
|           SNICallback: (serverName: string, cb: (err: Error | null, ctx?: plugins.tls.SecureContext) => void) => { | ||||
|             console.log(`SNI request for domain: ${serverName}`); | ||||
|             const domainConfig = findMatchingDomain(serverName); | ||||
|             if (!domainConfig) { | ||||
|               // Always allow SNI for default IPs, even if domain doesn't match | ||||
|               console.log(`SNI domain ${serverName} not found, will check IP during connection`); | ||||
|             } | ||||
|             // Create context with the provided TLS settings | ||||
|             const ctx = plugins.tls.createSecureContext(this.settings); | ||||
|             cb(null, ctx); | ||||
|             // For SNI passthrough, we don't need to create a context | ||||
|             // Just acknowledge the SNI request and continue | ||||
|             cb(null); | ||||
|           } | ||||
|         }) | ||||
|       : plugins.net.createServer(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user