From b8c2197e89481c49a7a52eb9b309dfb1cc6db30a Mon Sep 17 00:00:00 2001 From: ishkong <19740260+ishkong@users.noreply.github.com> Date: Sun, 21 Jul 2024 17:29:12 +0800 Subject: [PATCH] feat: Support V2RayNG to get obfs parameters in shadowsocks. --- app/Protocols/V2rayNG.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Protocols/V2rayNG.php b/app/Protocols/V2rayNG.php index c758cfb..7b1ba53 100644 --- a/app/Protocols/V2rayNG.php +++ b/app/Protocols/V2rayNG.php @@ -46,7 +46,11 @@ class V2rayNG ['-', '_', ''], base64_encode("{$server['cipher']}:{$password}") ); - return "ss://{$str}@{$server['host']}:{$server['port']}#{$name}\r\n"; + $uri = "ss://{$str}@{$server['host']}:{$server['port']}"; + if ($server['obfs'] == 'http') { + $uri .= "?plugin=obfs-local;obfs=http;obfs-host={$server['obfs-host']};path={$server['obfs-path']}"; + } + return $uri."#{$name}\r\n"; } public static function buildVmess($uuid, $server)