From 66e40edd0e4893095b2be2260d072843c729f0cf Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sat, 2 Mar 2024 09:58:50 +0800 Subject: [PATCH] Bug fix singbox transport type http --- v2rayN/v2rayN/Handler/CoreConfigSingbox.cs | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/v2rayN/v2rayN/Handler/CoreConfigSingbox.cs b/v2rayN/v2rayN/Handler/CoreConfigSingbox.cs index c88d422e..2a364006 100644 --- a/v2rayN/v2rayN/Handler/CoreConfigSingbox.cs +++ b/v2rayN/v2rayN/Handler/CoreConfigSingbox.cs @@ -238,14 +238,6 @@ namespace v2rayN.Handler outbound.method = LazyConfig.Instance.GetShadowsocksSecurities(node).Contains(node.security) ? node.security : Global.None; outbound.password = node.id; - if (node.network == Global.DefaultNetwork - && node.headerType == Global.TcpHeaderHttp - && node.requestHost.IsNullOrEmpty() == false) - { - outbound.plugin = "obfs-local"; - outbound.plugin_opts = $"obfs=http;obfs-host={node.requestHost};"; - } - GenOutboundMux(node, outbound); } else if (node.configType == EConfigType.Socks) @@ -419,6 +411,24 @@ namespace v2rayN.Handler transport.path = Utile.IsNullOrEmpty(node.path) ? null : node.path; break; + case "tcp": //http + if (node.headerType == Global.TcpHeaderHttp) + { + if (node.configType == EConfigType.Shadowsocks) + { + outbound.plugin = "obfs-local"; + outbound.plugin_opts = $"obfs=http;obfs-host={node.requestHost};"; + } + else + { + transport.type = "http"; + transport.host = Utile.IsNullOrEmpty(node.requestHost) ? null : Utile.String2List(node.requestHost); + transport.path = Utile.IsNullOrEmpty(node.path) ? null : node.path; + } + } + + break; + case "ws": transport.type = "ws"; transport.path = Utile.IsNullOrEmpty(node.path) ? null : node.path;