An open API service indexing awesome lists of open source software.

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

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:


```