mirror of https://github.com/2dust/v2rayN
Fixes Hysteria2 ports
parent
ad5d21db5a
commit
b37103b2f6
|
@ -24,7 +24,7 @@ public class Hysteria2Fmt : BaseFmt
|
||||||
item.Path = Utils.UrlDecode(query["obfs-password"] ?? "");
|
item.Path = Utils.UrlDecode(query["obfs-password"] ?? "");
|
||||||
item.AllowInsecure = (query["insecure"] ?? "") == "1" ? "true" : "false";
|
item.AllowInsecure = (query["insecure"] ?? "") == "1" ? "true" : "false";
|
||||||
|
|
||||||
item.Ports = Utils.UrlDecode(query["mport"] ?? "").Replace('-', ':');
|
item.Ports = Utils.UrlDecode(query["mport"] ?? "");
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
|
@ -706,12 +706,17 @@ public class CoreConfigSingboxService
|
||||||
|
|
||||||
outbound.up_mbps = _config.HysteriaItem.UpMbps > 0 ? _config.HysteriaItem.UpMbps : null;
|
outbound.up_mbps = _config.HysteriaItem.UpMbps > 0 ? _config.HysteriaItem.UpMbps : null;
|
||||||
outbound.down_mbps = _config.HysteriaItem.DownMbps > 0 ? _config.HysteriaItem.DownMbps : null;
|
outbound.down_mbps = _config.HysteriaItem.DownMbps > 0 ? _config.HysteriaItem.DownMbps : null;
|
||||||
if (node.Ports.IsNotEmpty())
|
if (node.Ports.IsNotEmpty() && (node.Ports.Contains(':') || node.Ports.Contains('-') || node.Ports.Contains(',')))
|
||||||
{
|
{
|
||||||
outbound.server_port = null;
|
outbound.server_port = null;
|
||||||
outbound.server_ports = node.Ports.Split(',')
|
outbound.server_ports = node.Ports.Split(',')
|
||||||
.Where(p => p.Trim().IsNotEmpty())
|
.Select(p => p.Trim())
|
||||||
.Select(p => p.Replace('-', ':'))
|
.Where(p => p.IsNotEmpty())
|
||||||
|
.Select(p =>
|
||||||
|
{
|
||||||
|
var port = p.Replace('-', ':');
|
||||||
|
return port.Contains(':') ? port : $"{port}:{port}";
|
||||||
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
outbound.hop_interval = _config.HysteriaItem.HopInterval > 0 ? $"{_config.HysteriaItem.HopInterval}s" : null;
|
outbound.hop_interval = _config.HysteriaItem.HopInterval > 0 ? $"{_config.HysteriaItem.HopInterval}s" : null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue