Skip to content

Commit

Permalink
Add info about --output-http-track-response to middleware docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekn committed Aug 12, 2022
1 parent f3bb501 commit 794ea62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/Capturing-and-replaying-traffic.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ gor --input-raw :80 --output-http "http://staging.com" --output-http "http://de

### Tracking responses
By default `input-raw` does not intercept responses, only requests. You can turn response tracking using `--input-raw-track-response` option. When enable you will be able to access response information in middleware and `output-file`.
You need to set `--output-http-track-response` option if you want to track output responses in the middleware.


### Traffic interception engine
Expand Down
4 changes: 3 additions & 1 deletion docs/Middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ Content-Type: text/plain; charset=utf-8
```

Header contains request meta information separated by spaces. First value is payload type, possible values: `1` - request, `2` - original response, `3` - replayed response.
Header contains request meta information separated by spaces. First value is payload type, possible values: `1` - request, `2` - original response, `3` - replayed response.
Next goes request id: unique among all requests (sha1 of time and Ack), but remain same for original and replayed response, so you can create associations between request and responses. The third argument is the time when request/response was initiated/received. Forth argument is populated only for responses and means latency.

You need to set `--output-http-track-response` option if you want to track output responses in the middleware (payload type `3`).

HTTP payload is unmodified HTTP requests/responses intercepted from network. You can read more about request format [here](http://www.jmarshall.com/easy/http/), [here](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) and [here](http://www.w3.org/Protocols/rfc2616/rfc2616.html). You can operate with payload as you want, add headers, change path, and etc. Basically you just editing a string, just ensure that it is RCF compliant.

At the end modified (or untouched) request should be emitted back to STDOUT, keeping original header, and hex-encoded. If you want to filter request, just not send it. Emitting responses back is required, even if you did not touch them.
Expand Down

0 comments on commit 794ea62

Please sign in to comment.