mirror of
https://github.com/Brandon-Rozek/website.git
synced 2024-11-22 16:26:28 -05:00
684 B
684 B
title | date | draft | tags | medium_enabled | |
---|---|---|---|---|---|
Forward Packets with Socat | 2021-06-18T19:38:43-04:00 | false |
|
true |
I've written about relaying TCP traffic using SSH port forwarding. Though sometimes you don't require the authenticity and encryption of SSH or want to use another protocol such as UDP. That's where socat
comes in.
The following will listen to TCP traffic on port 8001 and redirect it to TCP localhost:8000
socat tcp-listen:8001,reuseaddr,fork tcp:localhost:8000
This will listen UDP on port 4009 and forward it to UDP localhost:4010
socat udp-listen:4009,reuseaddr,fork udp:localhost:4010