From 83efe66f3e3e445a65db2e315f22dbfbc8a82576 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Fri, 10 Mar 2023 11:25:34 +0800 Subject: [PATCH] bug fixes --- v2rayN/v2rayN/Handler/CoreConfigHandler.cs | 24 +++-------------- v2rayN/v2rayN/Mode/V2rayConfig.cs | 30 ++++++++-------------- 2 files changed, 13 insertions(+), 41 deletions(-) diff --git a/v2rayN/v2rayN/Handler/CoreConfigHandler.cs b/v2rayN/v2rayN/Handler/CoreConfigHandler.cs index 2a5fcca5..c710fb3f 100644 --- a/v2rayN/v2rayN/Handler/CoreConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/CoreConfigHandler.cs @@ -458,14 +458,7 @@ namespace v2rayN.Handler if (node.streamSecurity == Global.StreamSecurityReality) { - if (Utils.IsNullOrEmpty(node.flow)) - { - usersItem.flow = Global.flows[1]; - } - else - { - usersItem.flow = node.flow; - } + usersItem.flow = node.flow; outbound.mux.enabled = false; outbound.mux.concurrency = -1; @@ -502,7 +495,7 @@ namespace v2rayN.Handler serversItem.flow = string.Empty; serversItem.ota = false; - serversItem.level = 1; + serversItem.level = 1; outbound.mux.enabled = false; outbound.mux.concurrency = -1; @@ -569,7 +562,7 @@ namespace v2rayN.Handler { streamSettings.security = node.streamSecurity; - RealitySettings realitySettings = new() + TlsSettings realitySettings = new() { fingerprint = node.fingerprint.IsNullOrEmpty() ? config.coreBasicItem.defFingerprint : node.fingerprint, serverName = sni, @@ -638,13 +631,6 @@ namespace v2rayN.Handler } streamSettings.wsSettings = wsSettings; - //TlsSettings tlsSettings = new TlsSettings(); - //tlsSettings.allowInsecure = config.allowInsecure(); - //if (!string.IsNullOrWhiteSpace(host)) - //{ - // tlsSettings.serverName = host; - //} - //streamSettings.tlsSettings = tlsSettings; break; //h2 case "h2": @@ -658,9 +644,6 @@ namespace v2rayN.Handler streamSettings.httpSettings = httpSettings; - //TlsSettings tlsSettings2 = new TlsSettings(); - //tlsSettings2.allowInsecure = config.allowInsecure(); - //streamSettings.tlsSettings = tlsSettings2; break; //quic case "quic": @@ -696,7 +679,6 @@ namespace v2rayN.Handler permit_without_stream = config.grpcItem.permit_without_stream, initial_windows_size = config.grpcItem.initial_windows_size, }; - streamSettings.grpcSettings = grpcSettings; break; default: diff --git a/v2rayN/v2rayN/Mode/V2rayConfig.cs b/v2rayN/v2rayN/Mode/V2rayConfig.cs index f2181742..d7436ca8 100644 --- a/v2rayN/v2rayN/Mode/V2rayConfig.cs +++ b/v2rayN/v2rayN/Mode/V2rayConfig.cs @@ -391,7 +391,7 @@ namespace v2rayN.Mode /// /// VLESS only /// - public RealitySettings realitySettings { get; set; } + public TlsSettings realitySettings { get; set; } /// /// grpc /// @@ -404,34 +404,24 @@ namespace v2rayN.Mode /// /// 是否允许不安全连接(用于客户端) /// - public bool allowInsecure { get; set; } + public bool? allowInsecure { get; set; } /// /// /// - public string serverName { get; set; } + public string? serverName { get; set; } /// /// /// - public List alpn - { - get; set; - } + public List? alpn { get; set; } - /// - /// "chrome" | "firefox" | "safari" | "randomized" - /// - public string fingerprint { get; set; } + public string? fingerprint { get; set; } + + public bool? show { get; set; } = false; + public string? publicKey { get; set; } + public string? shortId { get; set; } + public string? spiderX { get; set; } - } - public class RealitySettings - { - public bool show { get; set; } = false; - public string fingerprint { get; set; } - public string serverName { get; set; } - public string publicKey { get; set; } - public string shortId { get; set; } - public string spiderX { get; set; } } public class TcpSettings