Add reverse proxy and configuration for replay capability

This commit is contained in:
Michael Hohn
2024-07-01 12:03:24 -07:00
committed by =Michael Hohn
parent 380e90135a
commit 7413e23bab
3 changed files with 43 additions and 1 deletions

View File

@@ -6,6 +6,42 @@ TODO Style notes
- NO package init() functions - NO package init() functions
- Dynamic behaviour must be explicit - Dynamic behaviour must be explicit
## Reverse proxy
For testing, replay flows using mitmweb. This is faster and simpler than using
gh-mrva or the VS Code plugin.
- Set up the virtual environment and install tools
python3.11 -m venv venv
source venv/bin/activate
pip install mitmproxy
For intercepting requests:
1. Start mitmproxy to listen on port 8080 and forward requests to port 8081, with
web interface
mitmweb --mode reverse:http://localhost:8081 -p 8080
1. Change `server` ports in `docker-compose.yml` to
ports:
- "8081:8080" # host:container
1. Start the containers.
1. Submit requests.
3. Save the flows for later replay.
One such session is in `tools/mitmweb-flows`; it can be loaded to replay the
requests:
1. start `mitmweb --mode reverse:http://localhost:8081 -p 8080`
2. `file` > `open` > `tools/mitmweb-flows`
3. replay at least the submit, status, and download requests
## Cross-compile server on host, run it in container ## Cross-compile server on host, run it in container
These are simple steps using a single container. These are simple steps using a single container.

View File

@@ -26,7 +26,7 @@ services:
container_name: server container_name: server
stop_grace_period: 1s stop_grace_period: 1s
ports: ports:
- "8080:8080" - "8081:8080" # host:container
depends_on: depends_on:
- rabbitmq - rabbitmq
- dbstore - dbstore

6
tools/mitmweb-flows Normal file

File diff suppressed because one or more lines are too long