mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-05 12:04:59 +03:00
Add custom config Socks port to the group
https://github.com/2dust/v2rayN/issues/5576
This commit is contained in:
@@ -1282,7 +1282,10 @@ namespace ServiceLib.Handler
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
var subRemarks = LazyConfig.Instance.GetSubItem(subid)?.remarks;
|
||||
|
||||
var subItem = LazyConfig.Instance.GetSubItem(subid);
|
||||
var subRemarks = subItem?.remarks;
|
||||
var preSocksPort = subItem?.preSocksPort;
|
||||
|
||||
List<ProfileItem>? lstProfiles = null;
|
||||
//Is sing-box array configuration
|
||||
@@ -1306,6 +1309,7 @@ namespace ServiceLib.Handler
|
||||
{
|
||||
it.subid = subid;
|
||||
it.isSub = isSub;
|
||||
it.preSocksPort = preSocksPort;
|
||||
if (AddCustomServer(config, it, true) == 0)
|
||||
{
|
||||
count++;
|
||||
@@ -1362,6 +1366,7 @@ namespace ServiceLib.Handler
|
||||
}
|
||||
profileItem.subid = subid;
|
||||
profileItem.isSub = isSub;
|
||||
profileItem.preSocksPort = preSocksPort;
|
||||
if (AddCustomServer(config, profileItem, true) == 0)
|
||||
{
|
||||
return 1;
|
||||
@@ -1501,6 +1506,7 @@ namespace ServiceLib.Handler
|
||||
item.convertTarget = subItem.convertTarget;
|
||||
item.prevProfile = subItem.prevProfile;
|
||||
item.nextProfile = subItem.nextProfile;
|
||||
item.preSocksPort = subItem.preSocksPort;
|
||||
}
|
||||
|
||||
if (Utils.IsNullOrEmpty(item.id))
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace ServiceLib.Handler
|
||||
coreType = preCoreType,
|
||||
configType = EConfigType.Socks,
|
||||
address = Global.Loopback,
|
||||
port = node.preSocksPort
|
||||
port = node.preSocksPort.Value,
|
||||
};
|
||||
_config.runningCoreType = preCoreType;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ namespace ServiceLib.Models
|
||||
|
||||
public ECoreType? coreType { get; set; }
|
||||
|
||||
public int preSocksPort { get; set; }
|
||||
public int? preSocksPort { get; set; }
|
||||
|
||||
public string fingerprint { get; set; }
|
||||
|
||||
|
||||
@@ -31,5 +31,7 @@ namespace ServiceLib.Models
|
||||
public string? prevProfile { get; set; }
|
||||
|
||||
public string? nextProfile { get; set; }
|
||||
|
||||
public int? preSocksPort { get; set; }
|
||||
}
|
||||
}
|
||||
Generated
+10
-1
@@ -2330,7 +2330,7 @@ namespace ServiceLib.Resx {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 txtPreSocksPort 的本地化字符串。
|
||||
/// 查找类似 Socks port 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string TbPreSocksPort {
|
||||
get {
|
||||
@@ -2338,6 +2338,15 @@ namespace ServiceLib.Resx {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Custom config socks port 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string TbPreSocksPort4Sub {
|
||||
get {
|
||||
return ResourceManager.GetString("TbPreSocksPort4Sub", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 PrivateKey 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -668,7 +668,7 @@
|
||||
<value>Encryption</value>
|
||||
</data>
|
||||
<data name="TbPreSocksPort" xml:space="preserve">
|
||||
<value>txtPreSocksPort</value>
|
||||
<value>Socks port</value>
|
||||
</data>
|
||||
<data name="TipPreSocksPort" xml:space="preserve">
|
||||
<value>* After setting this value, an socks service will be started using Xray/sing-box(Tun) to provide functions such as speed display</value>
|
||||
@@ -1276,4 +1276,7 @@
|
||||
<data name="UpdateStandalonePackageTip" xml:space="preserve">
|
||||
<value>You are currently running a standalone package, please manually download the SelfContained.7z file to unzip and overwrite it!</value>
|
||||
</data>
|
||||
<data name="TbPreSocksPort4Sub" xml:space="preserve">
|
||||
<value>Custom config socks port</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1273,4 +1273,7 @@
|
||||
<data name="UpdateStandalonePackageTip" xml:space="preserve">
|
||||
<value>您当前运行的是独立包,请手动下载 SelfContained.7z文件解压覆盖</value>
|
||||
</data>
|
||||
<data name="TbPreSocksPort4Sub" xml:space="preserve">
|
||||
<value>自定义配置的Socks端口</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1153,4 +1153,7 @@
|
||||
<data name="UpdateStandalonePackageTip" xml:space="preserve">
|
||||
<value>您目前運行的是獨立包,請手動下載 SelfContained.7z檔案解壓縮覆蓋</value>
|
||||
</data>
|
||||
<data name="TbPreSocksPort4Sub" xml:space="preserve">
|
||||
<value>自訂配置的Socks端口</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user