From b3e7eac89581c968af0f75086fc90cc52f168337 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Fri, 24 Jun 2022 14:25:09 +0800 Subject: [PATCH] Parse ss plugin obfs-host --- v2rayN/v2rayN/Handler/ShareHandler.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/v2rayN/v2rayN/Handler/ShareHandler.cs b/v2rayN/v2rayN/Handler/ShareHandler.cs index f171c3c6..c00967ff 100644 --- a/v2rayN/v2rayN/Handler/ShareHandler.cs +++ b/v2rayN/v2rayN/Handler/ShareHandler.cs @@ -582,7 +582,19 @@ namespace v2rayN.Handler NameValueCollection queryParameters = HttpUtility.ParseQueryString(parsedUrl.Query); if (queryParameters["plugin"] != null) { - return null; + //obfs-host exists + var obfsHost = queryParameters["plugin"].Split(';').FirstOrDefault(t => t.Contains("obfs-host")); + if (queryParameters["plugin"].Contains("obfs=http") && !Utils.IsNullOrEmpty(obfsHost)) + { + obfsHost = obfsHost.Replace("obfs-host=", ""); + server.network = Global.DefaultNetwork; + server.headerType = Global.TcpHeaderHttp; + server.requestHost = obfsHost; + } + else + { + return null; + } } return server;