mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-28 07:14:40 +08:00
feat(sysproxy-viewer): make proxy bypass validation optional #4012
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
- 允许将出站模式显示在托盘一级菜单
|
||||
- 允许禁用在托盘中显示代理组
|
||||
- 支持在「编辑节点」中直接导入 AnyTLS URI 配置
|
||||
- 支持关闭「验证代理绕过格式」
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
@@ -94,6 +94,9 @@ pub struct IVerge {
|
||||
/// enable proxy guard
|
||||
pub enable_proxy_guard: Option<bool>,
|
||||
|
||||
/// enable bypass format check
|
||||
pub enable_bypass_check: Option<bool>,
|
||||
|
||||
/// enable dns settings - this controls whether dns_config.yaml is applied
|
||||
pub enable_dns_settings: Option<bool>,
|
||||
|
||||
@@ -415,6 +418,7 @@ impl IVerge {
|
||||
verge_port: Some(7899),
|
||||
verge_http_enabled: Some(false),
|
||||
enable_proxy_guard: Some(false),
|
||||
enable_bypass_check: Some(true),
|
||||
use_default_bypass: Some(true),
|
||||
proxy_guard_duration: Some(30),
|
||||
auto_close_connection: Some(true),
|
||||
@@ -501,6 +505,7 @@ impl IVerge {
|
||||
patch!(verge_http_enabled);
|
||||
patch!(enable_system_proxy);
|
||||
patch!(enable_proxy_guard);
|
||||
patch!(enable_bypass_check);
|
||||
patch!(use_default_bypass);
|
||||
patch!(system_proxy_bypass);
|
||||
patch!(proxy_guard_duration);
|
||||
|
||||
@@ -104,6 +104,7 @@ export const SysproxyViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
proxy_auto_config,
|
||||
pac_file_content,
|
||||
enable_proxy_guard,
|
||||
enable_bypass_check,
|
||||
use_default_bypass,
|
||||
system_proxy_bypass,
|
||||
proxy_guard_duration,
|
||||
@@ -112,6 +113,7 @@ export const SysproxyViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
|
||||
const [value, setValue] = useState({
|
||||
guard: enable_proxy_guard,
|
||||
enable_bypass_check: enable_bypass_check ?? true,
|
||||
bypass: system_proxy_bypass,
|
||||
duration: proxy_guard_duration ?? 10,
|
||||
use_default: use_default_bypass ?? true,
|
||||
@@ -202,6 +204,7 @@ export const SysproxyViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
setOpen(true);
|
||||
setValue({
|
||||
guard: enable_proxy_guard,
|
||||
enable_bypass_check: enable_bypass_check ?? true,
|
||||
bypass: system_proxy_bypass,
|
||||
duration: proxy_guard_duration ?? 10,
|
||||
use_default: use_default_bypass ?? true,
|
||||
@@ -280,7 +283,13 @@ export const SysproxyViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
showNotice.error("settings.modals.sysproxy.messages.durationTooShort");
|
||||
return;
|
||||
}
|
||||
if (value.bypass && !validReg.test(value.bypass)) {
|
||||
if (
|
||||
value.enable_bypass_check &&
|
||||
!value.pac &&
|
||||
!value.use_default &&
|
||||
value.bypass &&
|
||||
!validReg.test(value.bypass)
|
||||
) {
|
||||
showNotice.error("settings.modals.sysproxy.messages.invalidBypass");
|
||||
return;
|
||||
}
|
||||
@@ -310,6 +319,9 @@ export const SysproxyViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
if (value.guard !== enable_proxy_guard) {
|
||||
patch.enable_proxy_guard = value.guard;
|
||||
}
|
||||
if (value.enable_bypass_check !== enable_bypass_check) {
|
||||
patch.enable_bypass_check = value.enable_bypass_check;
|
||||
}
|
||||
if (value.duration !== proxy_guard_duration) {
|
||||
patch.proxy_guard_duration = value.duration;
|
||||
}
|
||||
@@ -560,13 +572,33 @@ export const SysproxyViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
</ListItem>
|
||||
)}
|
||||
|
||||
{!value.pac && (
|
||||
<ListItem sx={{ padding: "5px 2px" }}>
|
||||
<ListItemText
|
||||
primary={t("settings.modals.sysproxy.fields.enableBypassCheck")}
|
||||
/>
|
||||
<Switch
|
||||
edge="end"
|
||||
disabled={!enabled}
|
||||
checked={value.enable_bypass_check}
|
||||
onChange={(_, e) =>
|
||||
setValue((v) => ({ ...v, enable_bypass_check: e }))
|
||||
}
|
||||
/>
|
||||
</ListItem>
|
||||
)}
|
||||
|
||||
{!value.pac && !value.use_default && (
|
||||
<>
|
||||
<ListItemText
|
||||
primary={t("settings.modals.sysproxy.fields.proxyBypass")}
|
||||
/>
|
||||
<TextField
|
||||
error={value.bypass ? !validReg.test(value.bypass) : false}
|
||||
error={
|
||||
value.enable_bypass_check && value.bypass
|
||||
? !validReg.test(value.bypass)
|
||||
: false
|
||||
}
|
||||
disabled={!enabled}
|
||||
size="small"
|
||||
multiline
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
"proxyGuard": "حماية الوكيل",
|
||||
"guardDuration": "مدة الحماية",
|
||||
"alwaysUseDefaultBypass": "استخدام التخطي الافتراضي دائمًا",
|
||||
"enableBypassCheck": "التحقق من تنسيق تجاوز الوكيل",
|
||||
"proxyBypass": "إعدادات تخطي الوكيل:",
|
||||
"bypass": "تخطي:",
|
||||
"pacScriptContent": "محتوى سكريبت PAC"
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
"proxyGuard": "Systemproxy-Schutz",
|
||||
"guardDuration": "Proxy-Schutz-Intervall",
|
||||
"alwaysUseDefaultBypass": "Immer die Standard-Umgehung verwenden",
|
||||
"enableBypassCheck": "Proxy-Bypass-Format prüfen",
|
||||
"proxyBypass": "Proxy-Umgehungseinstellungen: ",
|
||||
"bypass": "Aktuelle Umgehung: ",
|
||||
"pacScriptContent": "PAC-Skriptinhalt"
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
"proxyGuard": "Proxy Guard",
|
||||
"guardDuration": "Guard Duration",
|
||||
"alwaysUseDefaultBypass": "Always use Default Bypass",
|
||||
"enableBypassCheck": "Validate Proxy Bypass Format",
|
||||
"proxyBypass": "Proxy Bypass Settings: ",
|
||||
"bypass": "Bypass: ",
|
||||
"pacScriptContent": "PAC Script Content"
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
"proxyGuard": "Guardia del proxy del sistema",
|
||||
"guardDuration": "Intervalo de guardia del proxy",
|
||||
"alwaysUseDefaultBypass": "Siempre usar la lista de omisión predeterminada",
|
||||
"enableBypassCheck": "Validar formato de bypass de proxy",
|
||||
"proxyBypass": "Configuración de omisión del proxy: ",
|
||||
"bypass": "Omisión actual: ",
|
||||
"pacScriptContent": "Contenido del script PAC"
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
"proxyGuard": "محافظ پراکسی",
|
||||
"guardDuration": "مدت محافظت",
|
||||
"alwaysUseDefaultBypass": "همیشه از دور زدن پیشفرض استفاده کنید",
|
||||
"enableBypassCheck": "اعتبارسنجی قالب دور زدن پراکسی",
|
||||
"proxyBypass": "دور زدن پراکسی: ",
|
||||
"bypass": "دور زدن: ",
|
||||
"pacScriptContent": "محتوای اسکریپت PAC"
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
"proxyGuard": "Penjaga Proksi",
|
||||
"guardDuration": "Durasi Penjagaan",
|
||||
"alwaysUseDefaultBypass": "Selalu gunakan Bypass Default",
|
||||
"enableBypassCheck": "Validasi format bypass proksi",
|
||||
"proxyBypass": "Pengaturan Bypass Proksi: ",
|
||||
"bypass": "Bypass: ",
|
||||
"pacScriptContent": "Konten Skrip PAC"
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
"proxyGuard": "システムプロキシガード",
|
||||
"guardDuration": "プロキシガード間隔",
|
||||
"alwaysUseDefaultBypass": "常にデフォルトのバイパスを使用",
|
||||
"enableBypassCheck": "プロキシバイパス形式を検証",
|
||||
"proxyBypass": "プロキシバイパス設定:",
|
||||
"bypass": "現在のバイパス:",
|
||||
"pacScriptContent": "PACスクリプト内容"
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
"proxyGuard": "프록시 가드",
|
||||
"guardDuration": "가드 지속시간",
|
||||
"alwaysUseDefaultBypass": "기본 우회 주소 항상 사용",
|
||||
"enableBypassCheck": "프록시 우회 형식 검증",
|
||||
"proxyBypass": "프록시 우회 설정: ",
|
||||
"bypass": "우회: ",
|
||||
"pacScriptContent": "PAC 스크립트 내용"
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
"proxyGuard": "Proxy Guard",
|
||||
"guardDuration": "Период защиты",
|
||||
"alwaysUseDefaultBypass": "Всегда использовать стандартное обходное решение",
|
||||
"enableBypassCheck": "Проверять формат обхода прокси",
|
||||
"proxyBypass": "Игнорируемые адреса: ",
|
||||
"bypass": "Игнорируемые адреса: ",
|
||||
"pacScriptContent": "Содержание сценария PAC"
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
"proxyGuard": "Vekil Koruyucusu",
|
||||
"guardDuration": "Koruma Süresi",
|
||||
"alwaysUseDefaultBypass": "Her Zaman Varsayılan Baypas Kullan",
|
||||
"enableBypassCheck": "Proxy baypas biçimini doğrula",
|
||||
"proxyBypass": "Vekil Baypas Ayarları: ",
|
||||
"bypass": "Baypas: ",
|
||||
"pacScriptContent": "PAC Betiği İçeriği"
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
"proxyGuard": "Прокси саклаучы",
|
||||
"guardDuration": "Саклау вакыты",
|
||||
"alwaysUseDefaultBypass": "Һәрвакыт төп Bypass-ны куллану",
|
||||
"enableBypassCheck": "Прокси урап узу форматын тикшерү",
|
||||
"proxyBypass": "Проксины әйләнеп узу:",
|
||||
"bypass": "Әйләнеп узу:",
|
||||
"pacScriptContent": "PAC скрипты эчтәлеге"
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
"proxyGuard": "系统代理守卫",
|
||||
"guardDuration": "代理守卫间隔",
|
||||
"alwaysUseDefaultBypass": "始终使用默认绕过",
|
||||
"enableBypassCheck": "验证代理绕过格式",
|
||||
"proxyBypass": "代理绕过设置:",
|
||||
"bypass": "当前绕过:",
|
||||
"pacScriptContent": "PAC 脚本内容"
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
"proxyGuard": "系統代理守護",
|
||||
"guardDuration": "代理守護間隔",
|
||||
"alwaysUseDefaultBypass": "始終使用預設繞過",
|
||||
"enableBypassCheck": "驗證代理繞過格式",
|
||||
"proxyBypass": "代理繞過設定:",
|
||||
"bypass": "目前繞過:",
|
||||
"pacScriptContent": "PAC 指令碼內容"
|
||||
|
||||
@@ -559,6 +559,7 @@ export const translationKeys = [
|
||||
"settings.modals.sysproxy.fields.proxyGuard",
|
||||
"settings.modals.sysproxy.fields.guardDuration",
|
||||
"settings.modals.sysproxy.fields.alwaysUseDefaultBypass",
|
||||
"settings.modals.sysproxy.fields.enableBypassCheck",
|
||||
"settings.modals.sysproxy.fields.proxyBypass",
|
||||
"settings.modals.sysproxy.fields.bypass",
|
||||
"settings.modals.sysproxy.fields.pacScriptContent",
|
||||
|
||||
@@ -983,6 +983,7 @@ export interface TranslationResources {
|
||||
fields: {
|
||||
alwaysUseDefaultBypass: string;
|
||||
bypass: string;
|
||||
enableBypassCheck: string;
|
||||
enableStatus: string;
|
||||
guardDuration: string;
|
||||
pacScriptContent: string;
|
||||
|
||||
Reference in New Issue
Block a user