mirror of https://github.com/2dust/v2rayN
Add custom config Socks port to the group
https://github.com/2dust/v2rayN/issues/5576pull/5636/head
parent
c9d65e5cd9
commit
d189f4b443
|
@ -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; }
|
||||
}
|
||||
}
|
|
@ -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>
|
|
@ -69,6 +69,7 @@
|
|||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
|
@ -281,6 +282,24 @@
|
|||
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.LvPrevProfileTip}"
|
||||
AcceptsReturn="True"
|
||||
Style="{StaticResource MyOutlinedTextBox}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="11"
|
||||
Grid.Column="0"
|
||||
Margin="4"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbPreSocksPort4Sub}" />
|
||||
<TextBox
|
||||
x:Name="txtPreSocksPort"
|
||||
Grid.Row="11"
|
||||
Grid.Column="1"
|
||||
Margin="4"
|
||||
HorizontalAlignment="Left"
|
||||
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.TipPreSocksPort}"
|
||||
AcceptsReturn="True"
|
||||
Style="{StaticResource MyOutlinedTextBox}"
|
||||
ToolTip="{x:Static resx:ResUI.TipPreSocksPort}" />
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</DockPanel>
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace v2rayN.Views
|
|||
this.Bind(ViewModel, vm => vm.SelectedSource.convertTarget, v => v.cmbConvertTarget.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.prevProfile, v => v.txtPrevProfile.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.nextProfile, v => v.txtNextProfile.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.SelectedSource.preSocksPort, v => v.txtPreSocksPort.Text).DisposeWith(disposables);
|
||||
|
||||
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue