Lox integration
Lox is reputation-based bridge distribution system based on Salmon, that uses anonymous credentials and stores all of the state on the client side. We're working on a trial integration as part of #105 (closed) that will eventually (hopefully) become a full integration if it works.
This issue is to track progress on this integration.
Integration Pieces
The Lox client library is written in Rust, so if we want to call it from the same part of Tor Browser that makes other Moat connections it has to be callable from a Javascript module in the browser. The first step for that is to write wasm bindings for the Lox library functions we need the client to call.
-
wasm bindings for the client-side lox library (https://gitlab.torproject.org/cohosh/lox-wasm)
Next is the actual Tor Browser code. We need a way to call the compiled wasm bindings and a new Javascript module for Lox that re-uses the same Moat connection logic that other calls to BridgeDB use.
-
javascript module for Tor Browser that uses the lox wasm bindings (cohosh/tor-browser!1 (diffs))
Finally, we need to integrate the server side with rdsys by writing a distributor for Lox that will receive bridge resources from the rdsys backend to eventually distribute via its reputation-based bridge distribution logic to users.
-
Make an rdsys distributor for the server-side bits of Lox -
document rdsys backend API (https://gitlab.torproject.org/tpo/anti-censorship/rdsys/-/blob/main/doc/backend-api.md) -
implement backend api library in rust (https://gitlab.torproject.org/cohosh/rdsys-backend-api) -
write distributor backend -
write distributor frontend
-
The goal is to get a minimally working example done first so that other teams can have a look at the changes required, suggest changes, and make a final decision on how we want to move forward.
Trying out the integration candidate
Note: This is very minimal at the moment. All it does is request an open invite from the lox distributor
A work in progress Lox integration is available to try out. To test it, you will need two things:
- A Tor Browser Build that implements Lox
- A local test environment to emulate the server side of Lox
-
Building or downloading the latest Lox-capable Tor Browser
You can either download one of our Tor Browser builds (Linux only for now) at https://people.torproject.org/~cohosh/lox/
or you can build it yourself by checking out the latest lox integration branch: https://gitlab.torproject.org/cohosh/tor-browser-build/-/tree/lox
-
Run the local test environment
This can be done either with a premade Docker container or manually.
To run the premade Docker container, simply run:
docker run -p 2000:2000 -it cecylia/lox-test-env
To run the lox-server and the meek-server manually:
- Build and run lox-server
- Set environment variables for the meek server:
export TOR_PT_MANAGED_TRANSPORT_VER=1 export TOR_PT_SERVER_BINDADDR=meek-0.0.0.0:2000 export TOR_PT_SERVER_TRANSPORTS=meek export TOR_PT_ORPORT=127.0.0.1:8001
- Build and run meek-server with the
--disable-tls
argument.
-
Start Tor Browser and navigate to the Connection Settings. Select the "Request a Lox Invitation from torproject.org" button.
-
If it is successful, you should see a message saying the invitation was received and an array of bytes will be displayed. Optionally, see the console messages by opening the browser console (ctrl+shift+J).