From 79e8b40dfd317449bce609c8e1f847116f16e1f8 Mon Sep 17 00:00:00 2001 From: v2rayv3 <53737797+v2rayv3@users.noreply.github.com> Date: Tue, 18 Feb 2020 20:20:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=9C=A8tls=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8Chost=E5=BF=85=E9=A1=BB=E6=98=AFtls?= =?UTF-8?q?=E7=9A=84=E5=9F=9F=E5=90=8D=E3=80=82=20=E6=84=9F=E6=81=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Utils/AppURI.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/Utils/AppURI.php b/app/Utils/AppURI.php index c927c4b3..d44a0255 100644 --- a/app/Utils/AppURI.php +++ b/app/Utils/AppURI.php @@ -3,6 +3,7 @@ namespace App\Utils; use App\Services\Config; +use function PHPSTORM_META\elementType; class AppURI { @@ -65,7 +66,7 @@ class AppURI if ($item['tls'] == 'tls') { $tls = ', over-tls=true'; if ($item['verify_cert']) { - $tls .=', tls-host=' . $item['add']; + $tls .=', tls-host=' . $item['host']; $tls .= ', certificate=1'; } else { $tls .=', tls-host=' . $item['host']; @@ -288,7 +289,16 @@ class AppURI 'mode' => 'websocket', ]; $v2rayplugin['tls'] = $item['tls'] == 'tls' ? true : false; - $v2rayplugin['peer'] = $v2rayplugin['tls'] ? $v2rayplugin['address']:""; + if ($v2rayplugin['tls']) { + if ($v2rayplugin['host']!="" && $v2rayplugin['host']!="windowsupdate.windows.com"){ + $v2rayplugin['peer'] = $v2rayplugin['host']; + }else { + $v2rayplugin['peer'] = $v2rayplugin['address']; + } + }else { + $v2rayplugin['peer']=""; + } + $return = ('ss://' . Tools::base64_url_encode($item['method'] . ':' . $item['passwd'] . '@' . $item['address'] . ':' . $item['port']) . '?v2ray-plugin=' . base64_encode(json_encode($v2rayplugin)) . '#' . rawurlencode($item['remark'])); } if ($item['obfs'] == 'plain') {