Add ws headers for sing-box

This commit is contained in:
2dust 2023-05-09 18:44:04 +08:00
parent 69b3178c13
commit 7845569319
5 changed files with 16 additions and 2 deletions

View file

@ -367,6 +367,13 @@ namespace v2rayN.Handler
case "ws":
transport.type = "ws";
transport.path = Utils.IsNullOrEmpty(node.path) ? null : node.path;
if (!Utils.IsNullOrEmpty(node.requestHost))
{
transport.headers = new()
{
Host = node.requestHost
};
}
break;
case "quic":

View file

@ -163,7 +163,7 @@ namespace v2rayN.Mode
public bool enableTun { get; set; }
public bool strictRoute { get; set; }
public string stack { get; set; }
public int mtu { get; set; }
public int mtu { get; set; }
}
[Serializable]

View file

@ -148,12 +148,19 @@
public string type { get; set; }
public List<string>? host { get; set; }
public string? path { get; set; }
public Headers4Sbox? headers { get; set; }
public string service_name { get; set; }
public string idle_timeout { get; set; }
public string ping_timeout { get; set; }
public bool? permit_without_stream { get; set; }
}
public class Headers4Sbox
{
public string? Host { get; set; }
}
public class Server4Sbox
{
public string tag { get; set; }

View file

@ -19,7 +19,6 @@ namespace v2rayN.ViewModels
[Reactive] public string normalDNS { get; set; }
[Reactive] public string normalDNS2 { get; set; }
[Reactive] public string tunDNS2 { get; set; }
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
public ReactiveCommand<Unit, Unit> ImportDefConfig4V2rayCmd { get; }

View file

@ -27,6 +27,7 @@ namespace v2rayN.ViewModels
[Reactive]
public string IP { get; set; }
[Reactive]
public string Process { get; set; }