Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Saving-and-Replaying-from-file.md #1245

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/Saving-and-Replaying-from-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,16 @@ To read or write GZIP compressed files ensure that file extension ends with ".gz
Gor has memory buffer when it writes to file, and continuously flush changes to the file. Flushing to file happens if the buffer is filled, forced flush every 1 second, or if Gor is closed. You can change it using `--output-file-flush-interval` option. It most cases it should not be touched.

### File format
HTTP requests stored as it is, plain text: headers and bodies. Requests separated by `\n🐵🙈🙉\n` line (using such sequence for uniqueness and fun). Before each request goes single line with meta information containing payload type (1 - request, 2 - response, 3 - replayed response), unique request ID (request and response have the same) and timestamp when request was made. An example of 2 requests:
HTTP requests stored as it is, plain text: headers and bodies. Requests separated by `\n🐵🙈🙉\n` line (using such sequence for uniqueness and fun). Before each request goes single line with meta information containing payload type (1 - request, 2 - response, 3 - replayed response), unique request ID (request and response have the same), timestamp when request was made (in nanoseconds) and latency (time difference between request start and finish. For `request` is always zero). An example of 2 requests:

```
1 d7123dasd913jfd21312dasdhas31 127345969\n
1 d7123dasd913jfd21312dasdhas31 1710781031501207115 0\n
GET / HTTP/1.1\r\n
\r\n
\n
🐵🙈🙉
\n
1 a1ba0050a213128487cd25db 1710781031551256751 0\n
POST /upload HTTP/1.1\r\n
Content-Length: 7\r\n
Host: www.w3.org\r\n
Expand All @@ -102,4 +103,4 @@ You can loop the same set of files, so when the last one replays all the request
Pass `--input-file-loop` to make it work.

***
You may also read about [[Capturing and replaying traffic]] and [[Rate limiting]]
You may also read about [[Capturing and replaying traffic]] and [[Rate limiting]]