From 785cb04196db10009fac7bbd848e3166d76d4f78 Mon Sep 17 00:00:00 2001 From: "proxy.zeroomega" Date: Tue, 14 Jan 2025 13:42:34 +0800 Subject: [PATCH] 1. cannot connect to SOCKS proxy with login/password auth #83 2. Opening the settings of a Socks5 Proxy with saved credentials deletes those credentials #67 --- .../src/module/proxy/proxy_impl_firefox.coffee | 5 +++-- omega-web/src/omega/controllers/fixed_profile.coffee | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/omega-target-chromium-extension/src/module/proxy/proxy_impl_firefox.coffee b/omega-target-chromium-extension/src/module/proxy/proxy_impl_firefox.coffee index 15fb999..d537997 100644 --- a/omega-target-chromium-extension/src/module/proxy/proxy_impl_firefox.coffee +++ b/omega-target-chromium-extension/src/module/proxy/proxy_impl_firefox.coffee @@ -48,6 +48,7 @@ class FirefoxProxyImpl extends ProxyImpl blobUrl = URL.createObjectURL(blob) browser.proxy.settings.set({ value: { + proxyDNS: true, proxyType: 'autoConfig', autoConfigUrl: blobUrl } @@ -58,7 +59,7 @@ class FirefoxProxyImpl extends ProxyImpl @_optionsReadyCallback = null return @setProxyAuth(profile, options) onRequest: (requestDetails) -> - return undefined if browser.extension.isAllowedIncognitoAccess() + #return undefined if browser.extension.isAllowedIncognitoAccess() # TODO 将来可以在这里实现按标签进行代理控制功能 #return undefined # The browser only recognizes native promises return values, not Bluebird. @@ -71,7 +72,7 @@ class FirefoxProxyImpl extends ProxyImpl switch profile.profileType when 'DirectProfile' return {type: 'direct'} - when 'SystemProfile' + when 'SystemProfile', 'PacProfile' # Returning undefined means using the default proxy from previous. # https://hg.mozilla.org/mozilla-central/rev/9f0ee2f582a2#l1.337 return undefined diff --git a/omega-web/src/omega/controllers/fixed_profile.coffee b/omega-web/src/omega/controllers/fixed_profile.coffee index 1bc2333..04f0792 100644 --- a/omega-web/src/omega/controllers/fixed_profile.coffee +++ b/omega-web/src/omega/controllers/fixed_profile.coffee @@ -38,7 +38,7 @@ angular.module('omega').controller 'FixedProfileCtrl', ($scope, $modal, $scope.proxyEditors = {} - socks5AuthSupported = (browser?.proxy?.register?) + socks5AuthSupported = (browser?.proxy?.onRequest?) $scope.authSupported = { "http": true, "https": true, @@ -71,8 +71,6 @@ angular.module('omega').controller 'FixedProfileCtrl', ($scope, $modal, return unless proxyEditors for scheme in $scope.urlSchemes proxy = proxyEditors[scheme] - if $scope.profile.auth and not $scope.authSupported[proxy.scheme] - delete $scope.profile.auth[proxyProperties[scheme]] if not proxy.scheme if not scheme proxyEditors[scheme] = {}