generated from matrix-org/.github
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shuffle chrome functions around, add RunAsyncFn
Everything will end up using RunAsyncFn to reduce the surface area when interacting with the browser.
- Loading branch information
Showing
4 changed files
with
81 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
### mitmproxy | ||
|
||
This directory contains code that will be used as a [mitmproxy addon](https://docs.mitmproxy.org/stable/addons-overview/). | ||
|
||
How this works: | ||
- A vanilla `mitmproxy` is run in the same network as the homeservers. | ||
- It is told to proxy both hs1 and hs2 i.e `mitmdump --mode reverse:http://hs1:8008@3000` | ||
- It is also told to run a normal proxy, to which a Flask HTTP server is attached. | ||
- The Flask HTTP server can be used to control mitmproxy at test runtime. This is done via the Controller HTTP API. | ||
|
||
|
||
### Controller HTTP API | ||
|
||
**This is highly experimental and will change without warning.** | ||
|
||
`mitmproxy` is run once for all tests. To avoid test pollution, the controller is "locked" for the duration | ||
of a test and must be "unlocked" afterwards. When acquiring the lock, options can be set on `mitmproxy`. | ||
|
||
``` | ||
POST /options/lock | ||
{ | ||
"options": { | ||
"body_size_limit": "3m", | ||
} | ||
} | ||
HTTP/1.1 200 OK | ||
{ | ||
"reset_id": "some_opaque_string" | ||
} | ||
``` | ||
|
||
``` | ||
POST /options/unlock | ||
{ | ||
"reset_id": "some_opaque_string" | ||
} | ||
``` |