https://github.com/vi/tcpprepend
Simple TCP forwarder that prepends some fixed bytes to responses and ignores some fixed header on requests
https://github.com/vi/tcpprepend
Last synced: about 1 year ago
JSON representation
Simple TCP forwarder that prepends some fixed bytes to responses and ignores some fixed header on requests
- Host: GitHub
- URL: https://github.com/vi/tcpprepend
- Owner: vi
- License: mit
- Created: 2022-10-30T23:09:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-30T23:31:59.000Z (over 3 years ago)
- Last Synced: 2025-04-14T19:59:00.692Z (about 1 year ago)
- Language: Rust
- Size: 6.84 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tcpprepend
Simple TCP forwarder that prepends some fixed bytes to responses and ignores some fixed header on requests
Install it by building (`cargo install --path .`) or download pre-built executables from [Github Releases](https://github.com/vi/tcpprepend/releases/).
# Example
```
A$ echo -n 'ABC' | base64
A: QUJD
A$ echo -n 'XYZ' | base64
A: WFla
A$ tcpprepend 127.0.0.1:1234 QUJD 127.0.0.1:1235 WFla&
A: [1] 30101
B$ nc -lvp 1235
B: Listening on 0.0.0.0 1235
C$ nc 127.0.0.1 1234
A: Incoming connection from 127.0.0.1:40834
C> 12345
C> asdfg
C> 67ABC890
A: found matching request bytes
A: connected to upstream
A: wrote prepender bytes
B: Connection received on localhost 44242
B: 890
A: XYZ
C> tttyyy
B: tttyyy
B> 555666
C: 555666
```
Psedo-HTTP server mode:
$ tcpprepend 127.0.0.1:8080 DQoNCg== 127.0.0.1:1235 SFRUUC8xLjAgMjAwIE9LDQoNCg==
$ curl http://127.0.0.1:8080/
# Usage line
```
ARGS:
```