https://github.com/loadmill/prod-replay-demo
Replay traffic with GoReplay in 5 minutes
https://github.com/loadmill/prod-replay-demo
Last synced: 8 months ago
JSON representation
Replay traffic with GoReplay in 5 minutes
- Host: GitHub
- URL: https://github.com/loadmill/prod-replay-demo
- Owner: loadmill
- Created: 2019-08-24T10:52:18.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-17T19:14:53.000Z (almost 2 years ago)
- Last Synced: 2025-03-23T02:13:18.918Z (about 1 year ago)
- Language: HTML
- Homepage:
- Size: 10.2 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Production Replay Demo App

## Shadow traffic from one environment to another
- Clone this repository and run `npm install`
- Run this app using `node index.js 8000`
- Run another instance of the app on a different port using `node index.js 8001`
- Install GoReplay locally by following [these simple Instructions](https://github.com/buger/goreplay/wiki/Getting-Started#installing-gor)
- Replay traffic from the first instance of the app to the second one using GoReplay: `sudo ./gor --input-raw :8000 --output-http http://localhost:8001`

## Record and replay traffic (save to file)
- Run the demo using `node index.js 8000`
- Start recording incoming traffic to the demo app by running `sudo ./gor --input-raw :8000 --output-file ./requests_0.gor`
- Stop the recording by pressing Ctrl+C
- To replay the recording run `sudo ./gor --input-file ./requests_0.gor -output-http http://localhost:8000`
## Track responses
- If you wish to include responses in your recoding, run the recording with `--input-raw-track-response` like this: `sudo ./gor --input-raw :8000 --input-raw-track-response --input-raw-realip-header "X-Real-IP" --output-file ./requests_0.gor`
- You can use the recored responses to validate that there are no errors during replay by using a [GoReplay middleware](https://github.com/buger/goreplay/tree/master/middleware)