[tor-bugs] #11183 [Pluggable transport]: Make an HTTP requestor Firefox extension for meek-client

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Mar 18 19:10:24 UTC 2014


#11183: Make an HTTP requestor Firefox extension for meek-client
-------------------------------------+----------------------
     Reporter:  dcf                  |      Owner:  dcf
         Type:  project              |     Status:  assigned
     Priority:  normal               |  Milestone:
    Component:  Pluggable transport  |    Version:
   Resolution:                       |   Keywords:  meek
Actual Points:                       |  Parent ID:  #10935
       Points:                       |
-------------------------------------+----------------------

Comment (by dcf):

 I have some code for you to try out. The whole pipeline is working, more
 or less. (I'm typing this comment through browser-camouflaged meek.) At
 this point, you have to run the extension in a separate Firefox because of
 comment:6.
  1. \\
 {{{
 git clone -b extension https://git.torproject.org/pluggable-
 transports/meek.git
 cd meek/meek-client
 export GOPATH=~/go
 go get
 go build
 }}}
  2. In your separate Firefox's extensions directory, create a file called
 `meek-http-helper at bamsoftware.com` whose contents are the directory
 containing the extension (plus a trailing slash). For me, it is \\
 {{{
 /home/david/meek/firefox/
 }}}
  3. Start the separate Firefox. You might have to active the extension in
 the Addons menu.
  4. Create a torrc file with the contents (you can edit the torrc that's
 in the meek-client directory) \\
 {{{
 UseBridges 1
 Bridge meek 0.0.2.0:1
 ClientTransportPlugin meek exec ./meek-client --url=https://meek-
 reflect.appspot.com/ --front=www.google.com --helper 127.0.0.1:7000 --log
 meek-client.log
 }}}
     `--helper` is the new special option here. Port 7000 where the
 extension is listening.
  5. \\
 {{{
 tor -f torrc
 }}}

 The comment at the top of [https://gitweb.torproject.org/pluggable-
 transports/meek.git/blob/87988ac6f2ce93204a61e80abb5e3a15e7c3372b:/firefox/components/main.js
 firefox/components/main.js] explains what's going on.
 {{{
 // This is an extension that allows external programs to make HTTP
 requests
 // using the browser's networking libraries.
 //
 // The extension opens a TCP socket listening on localhost (port 7000).
 When it
 // receives a connection, it reads a 4-byte big-endian length field, then
 tries
 // to read that many bytes of data. The data is UTF-8–encoded JSON, having
 the
 // format
 //  {
 //      "method": "POST",
 //      "url": "https://www.google.com/",
 //      "header": {
 //          "Host": "meek-reflect.appspot.com",
 //          "X-Session-Id":
 "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"}
 //      }
 //  }
 // The extension makes the request as commanded. It returns the response
 to the
 // client as a JSON blob, preceded by a 4-byte length as before. If
 successful,
 // the response looks like
 //  {
 //      "status": 200,
 //      "body": "...base64..."
 //  }
 // If there is a network error, the "error" key will be defined. A 404
 response
 // or similar from the target web server is not considered such an error.
 //  {
 //      "error": "NS_ERROR_UNKNOWN_HOST"
 //  }
 // The extension closes the connection after each transaction, and the
 client
 // must reconnect to do another request.
 }}}

 My plan next is to try to make a bundle that uses attachment:Don-t
 -prohibit-name-lookups-with-socks_remote_dns-tr.patch​, and see if all
 these steps can be automated.

 Comments on the code and design continue to be welcome. One thing to do is
 to make the listening port configurable as a pref instead of being
 hardcoded.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/11183#comment:10>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list