Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
SauravDharwadkar authored Jun 12, 2024
1 parent 856d13d commit 5d206fd
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 30 deletions.
62 changes: 32 additions & 30 deletions _posts/2024-06-12-goreplay.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@ GoReplay can be installed via various methods, including using pre-built binarie
```
This command captures live traffic on port 80 and mirrors it to a staging server.


4. **Capturing Traffic and Outputting to Stdout**:
```sh
goreplay --input-raw :80 --output-stdout
```
This command captures HTTP traffic on port 80 and outputs it directly to the console (stdout).

4. **Capturing Traffic, Saving to File, and Outputting to Stdout**:
```sh
goreplay --input-raw :80 --output-file ./requests.gor --output-stdout
```
This command captures HTTP traffic on port 80, saves it to `requests.gor`, and also outputs it to the console.


In summary, the updated diagram and examples provide a clear understanding of how GoReplay captures traffic, outputs it to stdout, and records it for replay. This can be particularly useful for real-time monitoring and debugging.


#### Advanced Usage

- **Filtering Traffic**:
Expand All @@ -80,41 +97,26 @@ GoReplay can be installed via various methods, including using pre-built binarie
goreplay --input-file ./requests.gor --output-http "http://staging.server" --output-http-workers 5
```

### basic workflow of GoReplay, including capturing, recording, and replaying traffic.

```mermaid
graph TD
A[Live Traffic] -->|HTTP Requests| B[GoReplay]
B -->|Capture Traffic| C[Requests.gor File]
C -->|Replaying Traffic| D[Test Server]
subgraph "GoReplay Workflow"
direction LR
A --> B
B --> C
C --> D
end
subgraph "Components"
B[GoReplay] --> E[Capture Module]
B --> F[Replay Module]
E --> C
C --> F
F --> D
end
```
### basic workflow of GoReplay, including capturing, recording, replaying traffic and standard output (stdout) process, showcasing how captured traffic can be directly output to the console.

![GoReplay Basics](/assets/images/GoReplay.svg)

### Explanation:
1. **Live Traffic**: This represents the HTTP requests coming into your server.
2. **GoReplay**: The main tool that captures and replays the traffic.
3. **Requests.gor File**: A file where the captured traffic is recorded.
4. **Test Server**: The server where the traffic is replayed for testing.
1. **Live Traffic**: Represents incoming HTTP requests.
2. **GoReplay**: The main tool capturing and replaying traffic.
3. **Stdout**: Standard output where captured traffic can be directly output to the console.
4. **Requests.gor File**: A file where the captured traffic is recorded.
5. **Test Server**: The server where traffic is replayed for testing.
6. **Staging Server: Server where live traffic is mirrored for testing.


### Components within GoReplay:
- **Capture Module**: This part of GoReplay is responsible for capturing the live HTTP traffic.
- **Replay Module**: This part of GoReplay replays the captured traffic to the test server.
- **Capture Module**: Captures live HTTP traffic.
- **Replay Module**: Replays the captured traffic to the test server.
- **Stdout**: Provides an option to output captured traffic directly to the console.

## TODO add screenshots

This diagram visually explains how GoReplay works in a simplified manner. You can further expand it to include additional details like filtering, modifying traffic, or mirroring to multiple servers.
### Conclusion

GoReplay is a powerful tool for capturing, replaying, and analyzing HTTP traffic. It is particularly useful for testing, debugging, and optimizing web applications by allowing developers to replicate real-world traffic scenarios. By incorporating GoReplay into your development and testing workflows, you can improve the reliability and performance of your applications.
Loading

0 comments on commit 5d206fd

Please sign in to comment.