Skip to content
Snippets Groups Projects
  1. Mar 07, 2019
  2. Mar 05, 2019
  3. Feb 23, 2019
  4. Feb 22, 2019
    • David Fifield's avatar
      Have meek-client-torbrowser write the native host manifest. · 5b539a2c
      David Fifield authored
      The WebExtension needs a JSON "host manifest" that both authorizes the
      extension to run a native executable, and tells the browser where to
      find the native executable. The path inside the manifest needs to be an
      absolute path, so we cannot just plunk down a static file; we have to
      know the path to where the browser is installed. meek-client-torbrowser
      rewrites the manifest on each startup, where the browser expects to find
      it.
      
      The is mostly self-contained and compatible with previous behavior, with
      one small exception on windows. On mac and linux, the browser expects to
      find the manifest in a well-known location (relative to $HOME, which in
      our case is inside the browser's directory tree or the ancillary
      TorBrowser-Data directory). But on windows, the path to the manifest
      needs to be stored in the registry. So meek-client-torbrowser not only
      writes the manifest file, it also writes a registry key pointing to the
      file. I'd like to try and find a way to do this that doesn't require
      modifying global state like this.
      
      This patch is tested on linux and windows but not mac.
  5. Feb 21, 2019
  6. Feb 20, 2019
  7. Feb 19, 2019
    • David Fifield's avatar
      Makefile for building .xpi. · f0ac1f06
      David Fifield authored
      f0ac1f06
    • David Fifield's avatar
      Detect errors of proxy.onRequest. · e1ff5cde
      David Fifield authored
      It turns out that if an error occurs in proxy.onRequest, Firefox will
      ignore it and continue on as if there were no proxy. This can happen,
      for example, if the "type" of a ProxyInfo isn't one of the recognized
      types, or if the ProxyInfo is missing a field like "host".
      https://bugzilla.mozilla.org/show_bug.cgi?id=1528873
      To prevent silent failures like this, we register another pair of event
      listeners. Unlike the headers and proxy event listeners, these remain
      static for all requests, and are not overwritten with each new request:
       * proxy.onError detects when an error occurs.
       * webRequest.onBeforeRequest cancels all requests after an error
      I made the error condition be persistent because it's not something that
      should arise during normal operation. proxy.onError only gets called
      when an error occurs in proxy.onRequest, and that only happens when the
      proxy specification is bogus. It doesn't get called when there's an
      network error, for example.
      
      In order to make exceptions in proxy.onRequest be noticed by
      proxy.onError, I had to make it return a rejection promise rather than
      throw an exception. An exception just gets logged to the browser console
      and nothing else.
      e1ff5cde
    • David Fifield's avatar
      Allow specifying a proxy. · f9c9f5ae
      David Fifield authored
      Just like with headers, we can only control the proxy through a global
      event listener, namely proxy.onRequest. We use the same scheme of
      locking modifications to the events so that only one request at a time
      is affected.
      f9c9f5ae
    • David Fifield's avatar
      Minor typo and style fixes. · 8e7b504a
      David Fifield authored
      8e7b504a
  8. Feb 18, 2019
  9. Feb 15, 2019
    • David Fifield's avatar
      Strip unneeded headers by default. · 7c57727c
      David Fifield authored
      These are:
      	Accept
      	Accept-Language
      	Cookie
      	Origin
      	User-Agent
      
      Cf. https://bugs.torproject.org/12778
      
      In the old extension we stripped *all* headers, except for
      Content-Length and Content-Type, which got set by
      nsIUploadChannel.setUploadStream; and Connection, which somehow
      automatically got the value "keep-alive".
      https://gitweb.torproject.org/pluggable-transports/meek.git/commit/?id=0e6ced86880b54f57a80b34d7f1b32a0eaa33b48
      
      In the new WebExtension, stripping all headers really strips them all,
      including Content-Length, without which web servers may refuse to deal
      with us. So instead, just delete an enumerated list of headers that seem
      unnecessary; or, like Cookie or Origin, may enable cross-session
      tracking.
      
      Before this change (url=https://meek.azureedge.net/ front=ajax.aspnetcdn.com):
      Accept: */*
      Accept-Encoding: gzip, deflate, br
      Accept-Language: en-US,en;q=0.5
      Cache-Control: no-cache
      Connection: keep-alive
      Content-Length: 0
      Host: meek.azureedge.net
      Origin: moz-extension://3b29e17d-f486-48b9-8a03-782237114ad3
      Pragma: no-cache
      TE: Trailers
      User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0
      X-Session-Id: QE9IrvZFtFc
      
      After this change:
      Accept-Encoding: gzip, deflate, br
      Cache-Control: no-cache
      Connection: keep-alive
      Content-Length: 0
      Host: meek.azureedge.net
      Pragma: no-cache
      TE: Trailers
      X-Session-Id: CKOaxq4SVqM
      7c57727c
    • David Fifield's avatar
      Allow overriding the request headers. · b2b8b3af
      David Fifield authored
      The fetch API itself doesn't let you change certain headers, notably
      including Host which we need for domain fronting. So instead, we set an
      onBeforeSendHeaders listener, with a lock to cause this shared global
      setting to be used by only one request at a time.
      b2b8b3af
    • David Fifield's avatar
      Make roundtrip async. · 52ff3d08
      David Fifield authored
      roundtrip doesn't need to know the ID; tack that on in the onMessage
      listener.
      52ff3d08
    • David Fifield's avatar
      Set some safety defaults for fetch. · 830375ad
      David Fifield authored
      cache: "no-store"
      credentials: "omit"
      redirect: "manual"
      
      cache: "no-store" adds these headers, which seem fine:
      Cache-Control: no-cache
      Pragma: no-cache
      830375ad
  10. Feb 14, 2019
  11. Feb 07, 2019
  12. Feb 02, 2019
  13. Jan 25, 2019
  14. Jan 17, 2019
Loading