Faster Golang alternative of socat.
Multi-purpose relay from source to destination.
A relay is a tool for bidirectional data transfer between two independent data channels.
Supported source-to-destination relays:
- TCP to Unix,
- Unix to TCP.
- Need something else? Feel free to open an issue to discuss it or shoot a Pull Request.
- Significantly faster than socat with medium and larger message payloads.
- Static binary, it just works. TM
- Actively health checks the
sourceto prevent hanging/zombified
sourceconnections. (initial reason why socat didn't work for us)
- socat performs slightly better with small message payloads.
Where it's used?
At SumUp we use it as a backbone for infrastructure and deployment system(s) that:
- need to relay SSH protocol,
- proxy to TCP -> Unix or vice-versa where speed
- have reliability as an important concern.
As a now open-source project of SumUp, we hope that we find more use-cases together.
How the benchmarks work
Benchmarks are sending a message from the destination, relaying via
to the source, which is an echo server that relays back to the destination via
Reading the benchmarks
X axis is the message payload size.
Y axis is throughput as per golang
-count argument, which benchmarks only
the sending and receiving of a message sync or async.
TCP to UNIX
Unix to TCP
Think we can improve them or got something wrong? Feel free to open an issue to discuss it.
We want the best possible benchmark and opportunity to improve the software!
Check out config.go
Unix Domain Socket to TCP
Example SSH agent forwarding
> gocat unix-to-tcp --src /run/ssh-agent.socket --dst 0.0.0.0:56789
# NOTE: `-d -d -d` is to reach at least some level of verbosity > socat -d -d -d TCP-LISTEN:56789,reuseaddr,fork UNIX-CLIENT:/run/ssh-agent.socket
TCP to Unix Domain Socket
Example TCP to ssh-agent socket forwarding
> gocat tcp-to-unix --src 0.0.0.0:56789 --dst /tmp/sshagent.sock
# NOTE: `-d -d -d` is to reach at least some level of verbosity > socat -t 100000 -v UNIX-LISTEN:/tmp/sshagent.sock,unlink-early,mode=777,fork TCP:0.0.0.0:56789
Check out CONTRIBUTING.md
Code of conduct (CoC)
We want to foster an inclusive and friendly community around our Open Source efforts. Like all SumUp Open Source projects, this project follows the Contributor Covenant Code of Conduct. Please, read it and follow it.
If you feel another member of the community violated our CoC or you are experiencing problems participating in our community because of another individual's behavior, please get in touch with our maintainers. We will enforce the CoC.