Skip to content

Instantly share code, notes, and snippets.

@kizzx2
Created May 21, 2016 09:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kizzx2/eef1eaae3e8b48b9f3fdac9d59253541 to your computer and use it in GitHub Desktop.
Save kizzx2/eef1eaae3e8b48b9f3fdac9d59253541 to your computer and use it in GitHub Desktop.
# 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