Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Server sending file
server$ socat -u FILE:test.dat TCP-LISTEN:9876,reuseaddr
client$ socat -u TCP:127.0.0.1:9876 OPEN:out.dat,creat
# Server receiving file
server$ socat -u TCP-LISTEN:9876,reuseaddr OPEN:out.txt,creat && cat out.txt
client$ socat -u FILE:test.txt TCP:127.0.0.1:9876
# Server sending file with encryption
server$ ccrypt -e -K password file.txt | socat -u STDIN TCP-LISTEN:4444,reuseaddr
client$ socat -u TCP:127.0.0.1:4444 STDOUT | ccrypt -d -K password > out.txt
# Server receiving file with enryption
server$ socat -u TCP-LISTEN:4444,reuseaddr STDOUT | ccrypt -d -K password > out.txt
client$ ccrypt -e -K password file.txt | socat -u STDIN TCP:127.0.0.1:4444
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.