Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Mar 10, 2023
1 parent 3f57290 commit 83efe66
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 41 deletions.
24 changes: 3 additions & 21 deletions v2rayN/v2rayN/Handler/CoreConfigHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -458,14 +458,7 @@ private static int outbound(ProfileItem node, ref V2rayConfig v2rayConfig)

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;
Expand Down Expand Up @@ -502,7 +495,7 @@ private static int outbound(ProfileItem node, ref V2rayConfig v2rayConfig)
serversItem.flow = string.Empty;

serversItem.ota = false;
serversItem.level = 1;
serversItem.level = 1;

outbound.mux.enabled = false;
outbound.mux.concurrency = -1;
Expand Down Expand Up @@ -569,7 +562,7 @@ private static int boundStreamSettings(ProfileItem node, string iobound, StreamS
{
streamSettings.security = node.streamSecurity;

RealitySettings realitySettings = new()
TlsSettings realitySettings = new()
{
fingerprint = node.fingerprint.IsNullOrEmpty() ? config.coreBasicItem.defFingerprint : node.fingerprint,
serverName = sni,
Expand Down Expand Up @@ -638,13 +631,6 @@ private static int boundStreamSettings(ProfileItem node, string iobound, StreamS
}
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":
Expand All @@ -658,9 +644,6 @@ private static int boundStreamSettings(ProfileItem node, string iobound, StreamS

streamSettings.httpSettings = httpSettings;

//TlsSettings tlsSettings2 = new TlsSettings();
//tlsSettings2.allowInsecure = config.allowInsecure();
//streamSettings.tlsSettings = tlsSettings2;
break;
//quic
case "quic":
Expand Down Expand Up @@ -696,7 +679,6 @@ private static int boundStreamSettings(ProfileItem node, string iobound, StreamS
permit_without_stream = config.grpcItem.permit_without_stream,
initial_windows_size = config.grpcItem.initial_windows_size,
};

streamSettings.grpcSettings = grpcSettings;
break;
default:
Expand Down
30 changes: 10 additions & 20 deletions v2rayN/v2rayN/Mode/V2rayConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ public class StreamSettings
/// <summary>
/// VLESS only
/// </summary>
public RealitySettings realitySettings { get; set; }
public TlsSettings realitySettings { get; set; }
/// <summary>
/// grpc
/// </summary>
Expand All @@ -404,34 +404,24 @@ public class TlsSettings
/// <summary>
/// 是否允许不安全连接(用于客户端)
/// </summary>
public bool allowInsecure { get; set; }
public bool? allowInsecure { get; set; }

/// <summary>
///
/// </summary>
public string serverName { get; set; }
public string? serverName { get; set; }
/// <summary>
///
/// </summary>
public List<string> alpn
{
get; set;
}
public List<string>? alpn { get; set; }

/// <summary>
/// "chrome" | "firefox" | "safari" | "randomized"
/// </summary>
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
Expand Down

0 comments on commit 83efe66

Please sign in to comment.