fix: Fix defaultBypass almost always be the default bypass of Windows (#602)

感谢PR!
This commit is contained in:
Amamiya Miu 2025-03-22 23:36:21 +08:00 committed by GitHub
parent 6ffcf544b8
commit 69e65a3959
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,7 +11,14 @@ import React from 'react'
import { MdDeleteForever } from 'react-icons/md'
import { useTranslation } from 'react-i18next'
const defaultBypass: string[] =
const defaultPacScript = `
function FindProxyForURL(url, host) {
return "PROXY 127.0.0.1:%mixed-port%; SOCKS5 127.0.0.1:%mixed-port%; DIRECT;";
}
`
const Sysproxy: React.FC = () => {
const defaultBypass: string[] =
platform === 'linux'
? ['localhost', '127.0.0.1', '192.168.0.0/16', '10.0.0.0/8', '172.16.0.0/12', '::1']
: platform === 'darwin'
@ -49,13 +56,6 @@ const defaultBypass: string[] =
'<local>'
]
const defaultPacScript = `
function FindProxyForURL(url, host) {
return "PROXY 127.0.0.1:%mixed-port%; SOCKS5 127.0.0.1:%mixed-port%; DIRECT;";
}
`
const Sysproxy: React.FC = () => {
const { t } = useTranslation()
const { appConfig, patchAppConfig } = useAppConfig()
const { sysProxy } = appConfig || ({ sysProxy: { enable: false } } as IAppConfig)