mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
feat: 增加SOCKS5支持 (#10061)
This commit is contained in:
1
src/MaaWpfGui/Constants/ConfigurationKeys.cs
Normal file → Executable file
1
src/MaaWpfGui/Constants/ConfigurationKeys.cs
Normal file → Executable file
@@ -174,6 +174,7 @@ namespace MaaWpfGui.Constants
|
||||
public const string CopilotLoopTimes = "Copilot.LoopTimes";
|
||||
public const string CopilotTaskList = "Copilot.CopilotTaskList";
|
||||
public const string UpdateProxy = "VersionUpdate.Proxy";
|
||||
public const string ProxyType = "VersionUpdate.ProxyType";
|
||||
public const string VersionType = "VersionUpdate.VersionType";
|
||||
public const string UpdateCheck = "VersionUpdate.UpdateCheck";
|
||||
public const string UpdateAutoCheck = "VersionUpdate.ScheduledUpdateCheck";
|
||||
|
||||
2
src/MaaWpfGui/Services/Web/HttpService.cs
Normal file → Executable file
2
src/MaaWpfGui/Services/Web/HttpService.cs
Normal file → Executable file
@@ -43,7 +43,7 @@ namespace MaaWpfGui.Services.Web
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return p.Contains("://") ? p : $"http://{p}";
|
||||
return p.Contains("://") ? p : ConfigurationHelper.GetGlobalValue(ConfigurationKeys.ProxyType, "http") + $"://{p}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
18
src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs
Normal file → Executable file
18
src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs
Normal file → Executable file
@@ -3555,6 +3555,24 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
}
|
||||
}
|
||||
|
||||
public List<CombinedData> PorxyTypeList { get; } =
|
||||
[
|
||||
new() { Display = "HTTP proxy", Value = "http" },
|
||||
new() { Display = "SOCKS5 proxy", Value = "socks5" },
|
||||
];
|
||||
|
||||
string _proxyType = "http";
|
||||
|
||||
public string ProxyType
|
||||
{
|
||||
get => _proxyType;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _proxyType, value);
|
||||
ConfigurationHelper.SetGlobalValue(ConfigurationKeys.ProxyType, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isCheckingForUpdates;
|
||||
|
||||
/// <summary>
|
||||
|
||||
11
src/MaaWpfGui/Views/UserControl/VersionUpdateSettingsUserControl.xaml
Normal file → Executable file
11
src/MaaWpfGui/Views/UserControl/VersionUpdateSettingsUserControl.xaml
Normal file → Executable file
@@ -88,11 +88,14 @@
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<controls:TextBlock
|
||||
<ComboBox
|
||||
Grid.Row="0"
|
||||
Margin="1"
|
||||
VerticalAlignment="Center"
|
||||
Text="Http Proxy" />
|
||||
Width="120"
|
||||
Margin="10"
|
||||
DisplayMemberPath="Display"
|
||||
ItemsSource="{Binding PorxyTypeList}"
|
||||
SelectedValue="{Binding ProxyType}"
|
||||
SelectedValuePath="Value" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
Width="150"
|
||||
|
||||
Reference in New Issue
Block a user