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
This commit is contained in:
proxy.zeroomega 2025-01-14 13:42:34 +08:00
parent 07c950c3f9
commit 785cb04196
2 changed files with 4 additions and 5 deletions

View File

@ -48,6 +48,7 @@ class FirefoxProxyImpl extends ProxyImpl
blobUrl = URL.createObjectURL(blob) blobUrl = URL.createObjectURL(blob)
browser.proxy.settings.set({ browser.proxy.settings.set({
value: { value: {
proxyDNS: true,
proxyType: 'autoConfig', proxyType: 'autoConfig',
autoConfigUrl: blobUrl autoConfigUrl: blobUrl
} }
@ -58,7 +59,7 @@ class FirefoxProxyImpl extends ProxyImpl
@_optionsReadyCallback = null @_optionsReadyCallback = null
return @setProxyAuth(profile, options) return @setProxyAuth(profile, options)
onRequest: (requestDetails) -> onRequest: (requestDetails) ->
return undefined if browser.extension.isAllowedIncognitoAccess() #return undefined if browser.extension.isAllowedIncognitoAccess()
# TODO # TODO
#return undefined #return undefined
# The browser only recognizes native promises return values, not Bluebird. # The browser only recognizes native promises return values, not Bluebird.
@ -71,7 +72,7 @@ class FirefoxProxyImpl extends ProxyImpl
switch profile.profileType switch profile.profileType
when 'DirectProfile' when 'DirectProfile'
return {type: 'direct'} return {type: 'direct'}
when 'SystemProfile' when 'SystemProfile', 'PacProfile'
# Returning undefined means using the default proxy from previous. # Returning undefined means using the default proxy from previous.
# https://hg.mozilla.org/mozilla-central/rev/9f0ee2f582a2#l1.337 # https://hg.mozilla.org/mozilla-central/rev/9f0ee2f582a2#l1.337
return undefined return undefined

View File

@ -38,7 +38,7 @@ angular.module('omega').controller 'FixedProfileCtrl', ($scope, $modal,
$scope.proxyEditors = {} $scope.proxyEditors = {}
socks5AuthSupported = (browser?.proxy?.register?) socks5AuthSupported = (browser?.proxy?.onRequest?)
$scope.authSupported = { $scope.authSupported = {
"http": true, "http": true,
"https": true, "https": true,
@ -71,8 +71,6 @@ angular.module('omega').controller 'FixedProfileCtrl', ($scope, $modal,
return unless proxyEditors return unless proxyEditors
for scheme in $scope.urlSchemes for scheme in $scope.urlSchemes
proxy = proxyEditors[scheme] 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 proxy.scheme
if not scheme if not scheme
proxyEditors[scheme] = {} proxyEditors[scheme] = {}