https://github.com/jarpson/gotcpreply
Copy Tcp Traffic and reply to other service
https://github.com/jarpson/gotcpreply
go redis redis-test reply tcpcopy
Last synced: 3 months ago
JSON representation
Copy Tcp Traffic and reply to other service
- Host: GitHub
- URL: https://github.com/jarpson/gotcpreply
- Owner: jarpson
- License: apache-2.0
- Created: 2024-02-23T00:12:28.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-04T12:50:00.000Z (about 2 years ago)
- Last Synced: 2024-11-16T01:37:16.723Z (over 1 year ago)
- Topics: go, redis, redis-test, reply, tcpcopy
- Language: Go
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gotcpreply
Copy Tcp Traffic and reply to other service
## Function
1. Cap Input stream and reply to target address.
2. Create a forwarding connection for each input stream.
3. If there is a problem with the connection, try to reestablish the connection and write the bit to the header of a request before forwarding.
## Usage
example:
`./gotcpreply -level debug -device lo -filter "tcp dst port 6379" -target 127.0.0.1:6380`
```
Usage of ./gotcpreply:
-device string
net device (default "lo0")
-filter string
cap filter (default "tcp dst port 6379")
-header string
filter header regexp (default "^\\*\\d+\\r\\n\\$")
-level string
log level, use: debug info warn error (default "info")
-sendmsg string
sed the message to each target conn (default "*3\r\n$6\r\nclient\r\n$5\r\nreply\r\n$3\r\noff\r\n")
-target string
transfer target address
```