From cd326777e3de47c9b8f1deaa1ebf623f8d3dd3a1 Mon Sep 17 00:00:00 2001 From: Hanrui Qi Date: Sat, 28 Dec 2024 17:23:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20missing=20parameters=20in=20trojan=20(?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=BD=AC=E6=8D=A2=E6=9C=8D=E5=8A=A1=E5=90=8E?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=BF=9E=E6=8E=A5=20#85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ClashConfigBuilder.js | 2 +- src/utils.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ClashConfigBuilder.js b/src/ClashConfigBuilder.js index 67036b05..475c6c7e 100644 --- a/src/ClashConfigBuilder.js +++ b/src/ClashConfigBuilder.js @@ -174,7 +174,7 @@ export class ClashConfigBuilder extends BaseConfigBuilder { cipher: proxy.security, tls: proxy.tls?.enabled || false, 'client-fingerprint': proxy.tls.utls?.fingerprint, - servername: proxy.tls?.server_name || '', + sni: proxy.tls?.server_name || '', network: proxy.transport?.type || 'tcp', 'ws-opts': proxy.transport?.type === 'ws' ? { path: proxy.transport.path, diff --git a/src/utils.js b/src/utils.js index 7bf88d83..e9c1a947 100644 --- a/src/utils.js +++ b/src/utils.js @@ -137,7 +137,7 @@ export function parseServerInfo(serverInfo) { if (params.security === 'xtls' || params.security === 'tls' || params.security === 'reality') { tls = { enabled: true, - server_name: params.sni, + server_name: params.sni || params.host, insecure: false, utls: { enabled: true,