diff --git a/src/components/ProxiesSettingsModal.tsx b/src/components/ProxiesSettingsModal.tsx index 0b0cdf8..3639293 100644 --- a/src/components/ProxiesSettingsModal.tsx +++ b/src/components/ProxiesSettingsModal.tsx @@ -21,8 +21,6 @@ import { setProxiesPreviewType, setRenderProxiesInTwoColumns, setUrlForLatencyTest, - setUrlIPv6SupportTest, - urlForIPv6SupportTest, urlForLatencyTest, } from '~/signals' @@ -76,16 +74,6 @@ export const ProxiesSettingsModal: Component<{ /> -
- {t('urlForIPv6SupportTest')} - - setUrlIPv6SupportTest(e.target.value?.trim())} - /> -
-
{t('proxiesSorting')} diff --git a/src/components/ProxyNodeCard.tsx b/src/components/ProxyNodeCard.tsx index 3017a4f..1dc9716 100644 --- a/src/components/ProxyNodeCard.tsx +++ b/src/components/ProxyNodeCard.tsx @@ -16,16 +16,8 @@ export const ProxyNodeCard = (props: { onClick?: () => void }) => { const { proxyName, isSelected, onClick } = props - const { - getNowProxyNodeName, - proxyIPv6SupportMap, - proxyNodeMap, - proxyLatencyTest, - proxyLatencyTestingMap, - } = useProxies() - const supportIPv6 = createMemo( - () => proxyIPv6SupportMap()[getNowProxyNodeName(proxyName || '')], - ) + const { proxyNodeMap, proxyLatencyTest, proxyLatencyTestingMap } = + useProxies() const proxyNode = createMemo(() => proxyNodeMap()[proxyName]) const specialType = () => @@ -60,21 +52,6 @@ export const ProxyNodeCard = (props: { {proxyName} - - {[ - specialType(), - supportIPv6() && 'IPv6', - proxyNode().tfo && 'TFO', - ] - .filter(Boolean) - .join(' / ')} - -
{formatProxyType(proxyNode()?.type)} @@ -102,6 +79,17 @@ export const ProxyNodeCard = (props: {

{proxyName}

+
+ {[specialType(), proxyNode().tfo && 'TFO'] + .filter(Boolean) + .join(' / ')} +
+
    {(latencyTestResult, index) => ( diff --git a/src/i18n/en.ts b/src/i18n/en.ts index 1bdab49..6b31626 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -48,7 +48,6 @@ export default { auto: 'Auto', off: 'Off', proxiesPreviewType: 'Proxies Preview Type', - urlForIPv6SupportTest: 'URL for IPv6 Support Test', urlForLatencyTest: 'URL for Latency Test', autoCloseConns: 'Automatically Close Connections', useTwemoji: 'Use Twemoji Mozilla Font', diff --git a/src/i18n/zh.ts b/src/i18n/zh.ts index bfd42a2..810f9b7 100644 --- a/src/i18n/zh.ts +++ b/src/i18n/zh.ts @@ -50,7 +50,6 @@ export default { auto: '自适应', off: '关闭', proxiesPreviewType: '节点组预览样式', - urlForIPv6SupportTest: '测试 IPv6 支持链接', urlForLatencyTest: '测速链接', autoCloseConns: '自动断开连接', useTwemoji: '使用 Twemoji Mozilla 字体', diff --git a/src/signals/config.ts b/src/signals/config.ts index 8195949..a8b3267 100644 --- a/src/signals/config.ts +++ b/src/signals/config.ts @@ -53,13 +53,6 @@ export const [urlForLatencyTest, setUrlForLatencyTest] = makePersisted( { name: 'urlForLatencyTest', storage: localStorage }, ) -export const urlForIPv6SupportTestDefault = 'https://ipv6.google.com' - -export const [urlForIPv6SupportTest, setUrlIPv6SupportTest] = makePersisted( - createSignal(urlForIPv6SupportTestDefault), - { name: 'urlForIPv6SupportTest', storage: localStorage }, -) - export const autoCloseConnsDefault = false export const [autoCloseConns, setAutoCloseConns] = makePersisted( diff --git a/src/signals/proxies.ts b/src/signals/proxies.ts index acaef10..f9b2233 100644 --- a/src/signals/proxies.ts +++ b/src/signals/proxies.ts @@ -1,4 +1,3 @@ -import { makePersisted } from '@solid-primitives/storage' import { closeSingleConnectionAPI, fetchProxiesAPI, @@ -16,7 +15,6 @@ import { latencyTestTimeoutDuration, latestConnectionMsg, restructRawMsgToConnection, - urlForIPv6SupportTest, urlForLatencyTest, } from '~/signals' import type { Proxy, ProxyNode, ProxyProvider } from '~/types' @@ -66,14 +64,6 @@ const [proxyNodeMap, setProxyNodeMap] = createSignal>( {}, ) -const [proxyIPv6SupportMap, setProxyIPv6SupportMap] = makePersisted( - createSignal>({}), - { - name: 'proxyIPv6SupportMap', - storage: localStorage, - }, -) - const getLatencyFromProxy = ( proxy: Pick, url: string, @@ -101,7 +91,6 @@ const setProxiesInfo = ( ) => { const newProxyNodeMap = { ...proxyNodeMap() } const newLatencyMap = { ...latencyMap() } - const newProxyIPv6SupportMap = { ...proxyIPv6SupportMap() } proxies.forEach((proxy) => { const { udp, xudp, type, now, history, name, tfo, provider = '' } = proxy @@ -118,20 +107,11 @@ const setProxiesInfo = ( } newLatencyMap[proxy.name] = getLatencyFromProxy(proxy, urlForLatencyTest()) - - // we don't set it when false because sing-box didn't have "extra" so it will always be false - if ( - getLatencyFromProxy(proxy, urlForIPv6SupportTest(), false) > - latencyQualityMap().NOT_CONNECTED - ) { - newProxyIPv6SupportMap[proxy.name] = true - } }) batch(() => { setProxyNodeMap(newProxyNodeMap) setLatencyMap(newLatencyMap) - setProxyIPv6SupportMap(newProxyIPv6SupportMap) }) } @@ -201,7 +181,6 @@ export const useProxies = () => { const nodeName = getNowProxyNodeName(proxyName) setProxyLatencyTestingMap(nodeName, async () => { - await proxyIPv6SupportTest(nodeName, provider) try { const { delay } = await proxyLatencyTestAPI( nodeName, @@ -225,7 +204,6 @@ export const useProxies = () => { const proxyGroupLatencyTest = async (proxyGroupName: string) => { setProxyGroupLatencyTestingMap(proxyGroupName, async () => { - await proxyGroupIPv6SupportTest(proxyGroupName) await proxyGroupLatencyTestAPI( proxyGroupName, urlForLatencyTest(), @@ -235,75 +213,6 @@ export const useProxies = () => { }) } - const proxyIPv6SupportTest = async (proxyName: string, provider: string) => { - const urlForTest = urlForIPv6SupportTest() - - if (!urlForTest || urlForTest.length === 0) { - setProxyIPv6SupportMap({}) - - return - } - - let support = false - try { - const { delay } = await proxyLatencyTestAPI( - proxyName, - provider, - urlForTest, - latencyTestTimeoutDuration(), - ) - support = delay > latencyQualityMap().NOT_CONNECTED - } catch { - support = false - } - setProxyIPv6SupportMap((supportMap) => ({ - ...supportMap, - [proxyName]: support, - })) - } - - const proxyGroupIPv6SupportTest = async (proxyGroupName: string) => { - const urlForTest = urlForIPv6SupportTest() - - if (!urlForTest || urlForTest.length === 0) { - setProxyIPv6SupportMap({}) - - return - } - - try { - const newLatencyMap = await proxyGroupLatencyTestAPI( - proxyGroupName, - urlForTest, - latencyTestTimeoutDuration(), - ) - - const newSupportMap = Object.fromEntries( - Object.entries(newLatencyMap).map(([nodeName, latency]) => [ - getNowProxyNodeName(nodeName), - latency > latencyQualityMap().NOT_CONNECTED, - ]), - ) - setProxyIPv6SupportMap((supportMap) => ({ - ...supportMap, - ...newSupportMap, - })) - } catch { - const allNodes = proxies().find((p) => p.name === proxyGroupName)?.all - - if (!allNodes) { - return - } - - setProxyIPv6SupportMap((proxyIPv6SupportMap) => ({ - ...proxyIPv6SupportMap, - ...Object.fromEntries( - allNodes.map((name) => [getNowProxyNodeName(name), false]), - ), - })) - } - } - const updateProviderByProviderName = (providerName: string) => setUpdatingMap(providerName, async () => { try { @@ -392,6 +301,5 @@ export const useProxies = () => { getNowProxyNodeName, getLatencyByName, isProxyGroup, - proxyIPv6SupportMap, } }