[tor-commits] [meek/master] Set network.proxy.socks_remote_dns=false inside the Firefox helper.

dcf at torproject.org dcf at torproject.org
Sat Aug 2 18:33:04 UTC 2014


commit 32ca07ca008f5d09492f4d2782130bd54c52acf5
Author: David Fifield <david at bamsoftware.com>
Date:   Sat Aug 2 00:02:23 2014 -0700

    Set network.proxy.socks_remote_dns=false inside the Firefox helper.
    
    We need this setting to be false in order for DNS lookups to work
    outside of a proxy, when the extension is run in Tor Browser
    (https://trac.torproject.org/projects/tor/ticket/11183#comment:6).
    
    By setting the pref inside the extension, we don't rely on it being set
    in the user.js file, where it can instead have its default value of
    true, which is safer if the browser somehow runs without the extension.
    https://trac.torproject.org/projects/tor/ticket/12674#comment:2
---
 firefox/components/main.js |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/firefox/components/main.js b/firefox/components/main.js
index 841c6f1..0565af6 100644
--- a/firefox/components/main.js
+++ b/firefox/components/main.js
@@ -62,6 +62,14 @@ MeekHTTPHelper.prototype = {
             return;
 
         try {
+            var prefs = Components.classes["@mozilla.org/preferences-service;1"]
+                .getService(Components.interfaces.nsIPrefBranch);
+            // Allow unproxied DNS, working around a Tor Browser patch:
+            // https://trac.torproject.org/projects/tor/ticket/11183#comment:6.
+            // We set TRANSPARENT_PROXY_RESOLVES_HOST whenever we are asked to
+            // use a proxy, so name resolution uses the proxy despite this pref.
+            prefs.setBoolPref("network.proxy.socks_remote_dns", false);
+
             // https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIServerSocket
             var serverSocket = Components.classes["@mozilla.org/network/server-socket;1"]
                 .createInstance(Components.interfaces.nsIServerSocket);



More information about the tor-commits mailing list