Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

将 “请勿将代理服务器用于本地(Intranet)地址” 做成参数按钮 #5394

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion v2rayN/v2rayN/Handler/SysProxyHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ public static bool UpdateSysProxy(Config config, bool forceDisable)
}
if (type == ESysProxyType.ForcedChange)
{
var strExceptions = $"<local>;{config.constItem.defIEProxyExceptions};{config.systemProxyExceptions}";
var strExceptions = "";
if (config.notProxyLocalAddress)
{
strExceptions = $"<local>;{config.constItem.defIEProxyExceptions};{config.systemProxyExceptions}";
}

var strProxy = string.Empty;
if (Utils.IsNullOrEmpty(config.systemProxyAdvancedProtocol))
Expand Down
1 change: 1 addition & 0 deletions v2rayN/v2rayN/Models/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class Config
public string subIndexId { get; set; }
public ESysProxyType sysProxyType { get; set; }
public string systemProxyExceptions { get; set; }
public bool notProxyLocalAddress { get; set; } = true;
public string systemProxyAdvancedProtocol { get; set; }

public ECoreType runningCoreType { get; set; }
Expand Down
9 changes: 9 additions & 0 deletions v2rayN/v2rayN/Resx/ResUI.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions v2rayN/v2rayN/Resx/ResUI.fa-Ir.resx
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,9 @@
<data name="TbSettingsRouteOnly" xml:space="preserve">
<value>فقط مسیر</value>
</data>
<data name="TbSettingsNotProxyLocalAddress" xml:space="preserve">
<value>يەرلىك (Intranet) ئادرېسلارغا ۋاكالەتچى مۇلازىمېتىر ئىشلەتمەڭ</value>
</data>
<data name="menuMixedTestServer" xml:space="preserve">
<value>One-click test Latency and speed (Ctrl+E)</value>
</data>
Expand Down
3 changes: 3 additions & 0 deletions v2rayN/v2rayN/Resx/ResUI.resx
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,9 @@
<data name="TbSettingsRouteOnly" xml:space="preserve">
<value>RouteOnly</value>
</data>
<data name="TbSettingsNotProxyLocalAddress" xml:space="preserve">
<value>Do not use proxy servers for local (intranet) addresses</value>
</data>
<data name="menuMixedTestServer" xml:space="preserve">
<value>One-click multi test Latency and speed (Ctrl+E)</value>
</data>
Expand Down
3 changes: 3 additions & 0 deletions v2rayN/v2rayN/Resx/ResUI.ru.resx
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,9 @@
<data name="TbSettingsRouteOnly" xml:space="preserve">
<value>Только маршрут</value>
</data>
<data name="TbSettingsNotProxyLocalAddress" xml:space="preserve">
<value>Не используйте прокси-серверы для локальных (интранет) адресов</value>
</data>
<data name="menuMixedTestServer" xml:space="preserve">
<value>Тест задержки и скорости всех серверов (Ctrl+E)</value>
</data>
Expand Down
3 changes: 3 additions & 0 deletions v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,9 @@
<data name="TbSettingsRouteOnly" xml:space="preserve">
<value>RouteOnly</value>
</data>
<data name="TbSettingsNotProxyLocalAddress" xml:space="preserve">
<value>请勿将代理服务器用于本地(Intranet)地址</value>
</data>
<data name="menuMixedTestServer" xml:space="preserve">
<value>一键多线程测试延迟和速度 (Ctrl+E)</value>
</data>
Expand Down
3 changes: 3 additions & 0 deletions v2rayN/v2rayN/Resx/ResUI.zh-Hant.resx
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,9 @@
<data name="TbSettingsRouteOnly" xml:space="preserve">
<value>RouteOnly</value>
</data>
<data name="TbSettingsNotProxyLocalAddress" xml:space="preserve">
<value>請勿將代理伺服器用於本機(Intranet)位址</value>
</data>
<data name="menuMixedTestServer" xml:space="preserve">
<value>一鍵多執行緒測試延遲和速度 (Ctrl+E)</value>
</data>
Expand Down
3 changes: 3 additions & 0 deletions v2rayN/v2rayN/ViewModels/OptionSettingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public class OptionSettingViewModel : ReactiveObject

#region System proxy

[Reactive] public bool notProxyLocalAddress { get; set; }
[Reactive] public string systemProxyAdvancedProtocol { get; set; }
[Reactive] public string systemProxyExceptions { get; set; }

Expand Down Expand Up @@ -178,6 +179,7 @@ public OptionSettingViewModel(Window view)

#region System proxy

notProxyLocalAddress = _config.notProxyLocalAddress;
systemProxyAdvancedProtocol = _config.systemProxyAdvancedProtocol;
systemProxyExceptions = _config.systemProxyExceptions;

Expand Down Expand Up @@ -339,6 +341,7 @@ private void SaveSetting()

//systemProxy
_config.systemProxyExceptions = systemProxyExceptions;
_config.notProxyLocalAddress = notProxyLocalAddress;
_config.systemProxyAdvancedProtocol = systemProxyAdvancedProtocol;

//tun mode
Expand Down
16 changes: 15 additions & 1 deletion v2rayN/v2rayN/Views/OptionSettingWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -855,13 +855,27 @@
<StackPanel DockPanel.Dock="Bottom" Orientation="Vertical">
<TextBlock
Grid.Row="3"
Grid.Column="0"
Margin="{StaticResource SettingItemMargin}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsNotProxyLocalAddress}" />
<ToggleButton
x:Name="tognotProxyLocalAddress"
Grid.Row="3"
Grid.Column="1"
Margin="{StaticResource SettingItemMargin}"
HorizontalAlignment="Left" />

<TextBlock
Grid.Row="4"
Margin="{StaticResource SettingItemMargin}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsAdvancedProtocol}" />
<ComboBox
x:Name="cmbsystemProxyAdvancedProtocol"
Grid.Row="4"
Grid.Row="5"
MinWidth="200"
Margin="{StaticResource SettingItemMargin}"
materialDesign:HintAssist.Hint="Protocol"
Expand Down
1 change: 1 addition & 0 deletions v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public OptionSettingWindow()
this.Bind(ViewModel, vm => vm.SubConvertUrl, v => v.cmbSubConvertUrl.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.MainGirdOrientation, v => v.cmbMainGirdOrientation.SelectedIndex).DisposeWith(disposables);

this.Bind(ViewModel, vm => vm.notProxyLocalAddress, v => v.tognotProxyLocalAddress.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.systemProxyAdvancedProtocol, v => v.cmbsystemProxyAdvancedProtocol.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.systemProxyExceptions, v => v.txtsystemProxyExceptions.Text).DisposeWith(disposables);

Expand Down