4 releases (2 breaking)

0.3.1 Apr 11, 2023
0.3.0 Apr 9, 2023
0.2.0 Apr 5, 2023
0.1.0 Apr 4, 2023
0.0.3 Apr 4, 2023

#1893 in Network programming

49 downloads per month

MIT license

110KB
332 lines

routez

crates.io

A zero-dep port forwarder. Routez supports both TCP and UDP.

demo

Why?

Originally implemented to reroute traffic from Class-C IPs (192.168.x.x) to Docker Class-B ones (172.18.x.x).

Useful when creating an IPVLAN (L3) which has the Class-B IPs and when one wants to reach them from Class-C ones.

Example usage

routez 127.0.0.1:1234 127.0.0.1:4321 TCP

Example usage - config file

Create a config file with source:port destination:port (exactly 1 space):

127.0.0.1:1234 192.168.0.33:22 TCP
127.0.0.1:4321 127.0.0.1:7890 UDP

Now run with:

routez routez.config

Pipeview

To output color logs, have a look at pipeview.

Either run:

routez 127.0.0.1:1234 127.0.0.1:4321 TCP | pipeview '(.*?) (.*?) (.*?) (.*?) -> (.*)' 'blue cyan white green bred'

Or create a pipeview.toml file in the directory you are calling routez from (see example in this repo) and invoke:

routez 127.0.0.1:1234 127.0.0.1:4321 UDP | pipeview

No runtime deps