Update READMEs for distributor and wasm crates

This commit is contained in:
onyinyang 2023-11-08 15:47:14 -05:00
parent e356034dae
commit 37b3aea81a
No known key found for this signature in database
GPG Key ID: 156A6435430C2036
3 changed files with 28 additions and 17 deletions

View File

@ -38,7 +38,7 @@ The rdsys request `rtype` has the following fields:
"name": "lox",
"token": "LoxApiTokenPlaceholder",
"types": [
"obfs2",
"obfs4",
"scramblesuit"
]
}
@ -73,28 +73,36 @@ Rolling back to a previous version of the database is possible by passing the
`roll_back_date` flag at runtime and providing the date/time as a `%Y-%m-%d_%H:%M:%S` string. This argument should be passed if the `LoxContext` should be rolled back to a previous state due to, for example, a mass blocking event that is likely not due to Lox user behaviour. If the exact roll back date/time is not known, the last db entry within 24 hours from the passed `roll_back_date` will be used or else the program will fail gracefully.
## Test Run
## Distributor Staging Environnment
For testing purposes, you will need a running instance of [rdsys](https://gitlab.torproject.org/tpo/anti-censorship/rdsys) as well as a running Lox client.
The lox distributor is currently deployed for testing on `rdsys-frontend-01`.
Client requests can be made to this distributor by following the instructions in the [`lox-wasm` README](../lox-wasm/README.md/#testing)
## Running the Lox Distributor Locally
For testing purposes, you will need a locally running instance of [rdsys](https://gitlab.torproject.org/tpo/anti-censorship/rdsys) as well as a running [Lox client](../lox-wasm/).
### Run rdsys locally
First clone rdsys from [here](https://gitlab.torproject.org/tpo/anti-censorship/rdsys) then change into the backend directory:
```
cd rdsys/cmd/backend
```
Finally run rdsys:
```
./backend --config config.json
```
First clone rdsys from [here](https://gitlab.torproject.org/tpo/anti-censorship/rdsys) then follow the instructions in the [README](https://gitlab.torproject.org/tpo/anti-censorship/rdsys/-/blob/main/README.md) to create a locally running rdsys instance with fake bridge descriptors.
### Run Lox Distributor locally
Simply run `cargo run -- config.json` :)
The easiest way to test with rdsys is to adjust the [config.json](config.json) so that the `rtype` reads as follows:
```
"rtype": {
"endpoint": "http://127.0.0.1:7100/resources",
"name": "https",
"token": "HttpsApiTokenPlaceholder",
"types": [
"obfs4",
"snowflake"
]
}
```
Then simply run `cargo run -- config.json` :)
### Run a Lox client locally
First clone lox-wasm from [here](https://gitlab.torproject.org/tpo/anti-censorship/lox/lox-wasm). Follow the instructions in the [README](https://gitlab.torproject.org/tpo/anti-censorship/lox/lox-wasm/-/blob/main/README.md) to build and test the Lox client.
First clone lox-wasm from [here](https://gitlab.torproject.org/tpo/anti-censorship/lox/lox-wasm). Follow the instructions in the [README](../lox-wasm/README.md) to build and test the Lox client.

View File

@ -13,7 +13,7 @@
"token": "LoxApiTokenPlaceholder",
"types": [
"obfs4",
"scramblesuit"
"snowflake"
]
}
}

View File

@ -16,6 +16,9 @@ wasm-pack build --target web
# Testing
### Testing Locally
The provided `index.html` file can be used for testing the lox bindings. First, follow the instructions to [run a lox server](https://gitlab.torproject.org/cohosh/lox-server).
Then, spin up a simple local webserver in the current directory: