From e79b52490ee7682c6c8b17d8b6625a925d4e5d3d Mon Sep 17 00:00:00 2001 From: johnysigma Date: Wed, 25 Mar 2026 21:21:17 +0200 Subject: [PATCH] Fix proxy connection race condition and remove Arweave source --- html/options.html | 3 +-- js/background.js | 2 +- js/config.js | 15 +++++---------- js/options.js | 17 +++++++---------- js/popup.js | 4 ++-- js/proxy-manager.js | 8 ++++---- 6 files changed, 20 insertions(+), 29 deletions(-) diff --git a/html/options.html b/html/options.html index 90ea7ce..cef1030 100644 --- a/html/options.html +++ b/html/options.html @@ -130,9 +130,8 @@
diff --git a/js/background.js b/js/background.js index 2e27442..871902d 100644 --- a/js/background.js +++ b/js/background.js @@ -317,7 +317,7 @@ async function handleNextProxy() { * @param {string} source - Proxy source * @returns {Promise} */ -async function handleFetchProxies(source = 'arweave') { +async function handleFetchProxies(source = 'github') { const result = await ProxyManager.fetchProxyList(source); if (result.success) { diff --git a/js/config.js b/js/config.js index d7d9c62..25735d2 100644 --- a/js/config.js +++ b/js/config.js @@ -18,26 +18,21 @@ const CONFIG = { WEBRTC_PROTECTION: false, KILL_SWITCH: false, BYPASS_LOCAL: true, - PROXY_SOURCE: 'arweave', + PROXY_SOURCE: 'github', UPDATE_INTERVAL: 0 // manual only }, // Proxy Sources PROXY_SOURCES: { - arweave: { - name: 'Arweave', - url: 'https://arweave.net/FjxfWIbSnZb7EaJWbeuWCsBBFWjTppfS3_KHxUP__B8', - icon: 'AR' + github: { + name: 'GitHub', + url: 'https://raw.githubusercontent.com/DeBrosDAO/anyone-proxy-list/refs/heads/main/anonproxies.json', + icon: 'GH' }, git: { name: 'GitBros', url: 'https://git.debros.io/DeBros/anyone-proxy-list/raw/branch/main/anonproxies.json', icon: 'GIT' - }, - github: { - name: 'GitHub', - url: 'https://raw.githubusercontent.com/DeBrosOfficial/anyone-proxy-list/refs/heads/main/anonproxies.json', - icon: 'GH' } }, diff --git a/js/options.js b/js/options.js index 2780b05..0829034 100644 --- a/js/options.js +++ b/js/options.js @@ -284,19 +284,16 @@ async function handleProxySourceChange() { function updateSourceNameDisplay(source) { const names = { - git: 'GitBros', github: 'GitHub', - arweave: 'Arweave' + git: 'GitBros' }; const urls = { - git: 'git.debros.io/DeBros/anyone-proxy-list', - github: 'github.com/DeBrosOfficial/anyone-proxy-list', - arweave: 'arweave.net/FjxfWIbS...B8' + github: 'github.com/DeBrosDAO/anyone-proxy-list', + git: 'git.debros.io/DeBros/anyone-proxy-list' }; const fullUrls = { - git: 'https://git.debros.io/DeBros/anyone-proxy-list', - github: 'https://github.com/DeBrosOfficial/anyone-proxy-list', - arweave: 'https://arweave.net/FjxfWIbSnZb7EaJWbeuWCsBBFWjTppfS3_KHxUP__B8' + github: 'https://github.com/DeBrosDAO/anyone-proxy-list', + git: 'https://git.debros.io/DeBros/anyone-proxy-list' }; const externalIcon = ` @@ -395,14 +392,14 @@ async function refreshProxies() { const originalText = elements.btnRefreshProxies.innerHTML; elements.btnRefreshProxies.innerHTML = 'Refreshing...'; - const source = elements.proxySource.value || 'arweave'; + const source = elements.proxySource.value || 'github'; const response = await sendMessage({ action: 'fetchProxies', source }); elements.btnRefreshProxies.disabled = false; elements.btnRefreshProxies.innerHTML = originalText; if (response.success) { - const sourceNames = { arweave: 'Arweave', git: 'GitBros', github: 'GitHub' }; + const sourceNames = { github: 'GitHub', git: 'GitBros' }; const usedName = sourceNames[response.usedSource] || response.usedSource; if (response.usedSource && response.usedSource !== source) { diff --git a/js/popup.js b/js/popup.js index 7374b84..69254d1 100644 --- a/js/popup.js +++ b/js/popup.js @@ -529,7 +529,7 @@ async function refreshProxies() { // Get the stored proxy source setting const settings = await sendMessage({ action: 'getSettings' }); - const source = settings.settings?.proxySource || 'arweave'; + const source = settings.settings?.proxySource || 'github'; const response = await sendMessage({ action: 'fetchProxies', source }); @@ -539,7 +539,7 @@ async function refreshProxies() { if (response.success) { // Show which source was used (especially if fallback occurred) - const sourceNames = { arweave: 'Arweave', git: 'GitBros', github: 'GitHub' }; + const sourceNames = { github: 'GitHub', git: 'GitBros' }; const usedName = sourceNames[response.usedSource] || response.usedSource; if (response.usedSource && response.usedSource !== source) { diff --git a/js/proxy-manager.js b/js/proxy-manager.js index 491ce01..3f55ebe 100644 --- a/js/proxy-manager.js +++ b/js/proxy-manager.js @@ -233,8 +233,8 @@ const ProxyManager = { let proxies = this._proxyList; - // Test proxies in parallel - const results = await this.testProxiesParallel(proxies); + // Test proxies sequentially + const results = await this.testProxiesParallel(proxies, 1); // Filter working proxies and sort by latency const working = results @@ -312,9 +312,9 @@ const ProxyManager = { * @param {string} source - Source key from CONFIG.PROXY_SOURCES * @returns {Promise<{success: boolean, proxies: object[], error: string|null, usedSource: string|null}>} */ - async fetchProxyList(source = 'arweave') { + async fetchProxyList(source = 'github') { // Define fallback order - const fallbackOrder = ['arweave', 'git', 'github']; + const fallbackOrder = ['github', 'git']; // Start with the requested source, then try others const sourcesToTry = [source, ...fallbackOrder.filter(s => s !== source)];