Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions omega-locales/en_US/LC_MESSAGES/omega-web.po
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,12 @@ msgstr "Use the proxy above for all protocols."
msgid "options_proxy_expand"
msgstr "Show Advanced"

msgid "options_proxy_proxyDNS"
msgstr "Proxy DNS requests via SOCKS proxy."

msgid "options_proxy_proxyDNSHelp"
msgstr "This should be disabled if you use DNS-over-HTTPS in Firefox-based browsers."

msgid "options_group_bypassList"
msgstr "Bypass List"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ FindProxyForURL = (function () {
// https://dxr.mozilla.org/mozilla-central/rev/ffe6cc09ccf38cca6f0e727837bbc6cb722d1e71/toolkit/components/extensions/ProxyScriptContext.jsm#51
proxyInfo.type = 'socks';
// Enable SOCKS5 remote DNS.
// TODO(catus): Maybe allow the users to configure this?
proxyInfo.proxyDNS = true;
if (profile.proxyDNS) {
proxyInfo.proxyDNS = true;
}
}
if (auth) {
proxyInfo.username = auth.username;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class FirefoxProxyImpl extends ProxyImpl
blobUrl = URL.createObjectURL(blob)
browser.proxy.settings.set({
value: {
proxyDNS: true,
proxyDNS: profile.proxyDNS,
proxyType: 'autoConfig',
autoConfigUrl: blobUrl
}
Expand Down Expand Up @@ -81,7 +81,7 @@ class FirefoxProxyImpl extends ProxyImpl
if Array.isArray(result)
proxy = result[2]
auth = result[3]
return @proxyInfo(proxy, auth) if proxy
return @proxyInfo(proxy, auth, profile.proxyDNS) if proxy
next = result[0]
else if result.profileName
next = OmegaPac.Profiles.nameAsKey(result.profileName)
Expand All @@ -93,7 +93,7 @@ class FirefoxProxyImpl extends ProxyImpl
))
onError: (error) ->
@log.error(error)
proxyInfo: (proxy, auth) ->
proxyInfo: (proxy, auth, proxyDNS) ->
proxyInfo =
type: proxy.scheme
host: proxy.host
Expand All @@ -108,9 +108,8 @@ class FirefoxProxyImpl extends ProxyImpl
# HTTP proxy auth must be handled via webRequest.onAuthRequired.
proxyInfo.username = auth.username
proxyInfo.password = auth.password
if proxyInfo.type == 'socks'
if proxyInfo.type == 'socks' and proxyDNS
# Enable SOCKS remote DNS.
# TODO(catus): Maybe allow the users to configure this?
proxyInfo.proxyDNS = true

# TODO(catus): Maybe allow proxyDNS for socks4? Server may support SOCKS4a.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ListenerProxyImpl extends ProxyImpl
if Array.isArray(result)
proxy = result[2]
auth = result[3]
return @proxyInfo(proxy, auth) if proxy
return @proxyInfo(proxy, auth, profile.proxyDNS) if proxy
next = result[0]
else if result.profileName
next = OmegaPac.Profiles.nameAsKey(result.profileName)
Expand All @@ -57,7 +57,7 @@ class ListenerProxyImpl extends ProxyImpl
))
onError: (error) ->
@log.error(error)
proxyInfo: (proxy, auth) ->
proxyInfo: (proxy, auth, proxyDNS) ->
proxyInfo =
type: proxy.scheme
host: proxy.host
Expand All @@ -72,9 +72,8 @@ class ListenerProxyImpl extends ProxyImpl
# HTTP proxy auth must be handled via webRequest.onAuthRequired.
proxyInfo.username = auth.username
proxyInfo.password = auth.password
if proxyInfo.type == 'socks'
if proxyInfo.type == 'socks' and proxyDNS
# Enable SOCKS remote DNS.
# TODO(catus): Maybe allow the users to configure this?
proxyInfo.proxyDNS = true

# TODO(catus): Maybe allow proxyDNS for socks4? Server may support SOCKS4a.
Expand Down
8 changes: 8 additions & 0 deletions omega-web/src/omega/controllers/fixed_profile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ angular.module('omega').controller 'FixedProfileCtrl', ($scope, $modal,

$scope.showAdvanced = false

$scope.proxyDNS = $scope.profile.proxyDNS ? true

$scope.optionsForScheme = {}
for scheme in $scope.urlSchemes
defaultLabel =
Expand Down Expand Up @@ -95,6 +97,12 @@ angular.module('omega').controller 'FixedProfileCtrl', ($scope, $modal,

$scope.$watch 'profile.bypassList', onBypassListChange, true

onProxyDNSChange = (proxyDNS) ->
$scope.profile.proxyDNS = proxyDNS
$scope.proxyDNS = proxyDNS

$scope.$watch 'proxyDNS', onProxyDNSChange, true

$scope.$watch 'bypassList', (bypassList, oldList) ->
return if not bypassList? or bypassList == oldList
$scope.profile.bypassList =
Expand Down
8 changes: 8 additions & 0 deletions omega-web/src/partials/profile_fixed.jade
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ div(ng-controller='FixedProfileCtrl')
td(colspan='7')
button.btn.btn-link(ng-click='showAdvanced = true')
| #[span.glyphicon.glyphicon-chevron-down] {{'options_proxy_expand' | tr}}
tbody
tr
td(colspan='7')
div.checkbox
label
input(type='checkbox' ng-model='proxyDNS')
span {{'options_proxy_proxyDNS' | tr}}
p.help-block(omega-html="'options_proxy_proxyDNSHelp' | tr")
section.settings-group
h3 {{'options_group_bypassList' | tr}}
p.help-block {{'options_bypassListHelp' | tr}}
Expand Down