Modern CLI tools with better UX
Pure Python socket communication tool for sending and receiving messages and files over TCP.
Reimagines netcat/telnet for the Pynosaur ecosystem.
rec (receive), sen (send), mult (full duplex)pget install sock
Or from source:
git clone https://github.com/pynosaur/sock.git
cd sock
python app/main.py --help
rec)Listen on a port and receive messages or files:
sock rec 8080
Save received files to a directory:
sock rec 8080 -d ~/Downloads
sen)Send a message:
sock sen 192.168.1.10 8080 -m "hello"
Send a file:
sock sen 192.168.1.10 8080 -f document.txt
mult)Both sides can send text and files interactively.
Listen side:
sock mult -l 8080
Connect side:
sock mult 192.168.1.10 8080
Interactive commands inside mult:
> hello (send text)
/file notes.txt (send a file)
/ping (ping remote)
/quit (close connection)
sock info # Show local IP, public IP, gateway
sock test 8080 # Test if port can be bound
# Terminal 1
sock rec 9000
# Terminal 2
sock sen localhost 9000 -m "hello from terminal 2"
# Computer A (192.168.1.10)
sock rec 9000 -d ~/received
# Computer B
sock sen 192.168.1.10 9000 -f report.pdf
# Terminal 1
sock mult -l 8080
# Terminal 2
sock mult localhost 8080
sock uses a simple binary framing protocol over TCP:
[4 bytes: payload length (network byte order)]
[JSON header]\n[binary payload]
Packet types:
| Type | Purpose |
|---|---|
msg |
Text message |
file |
File transfer (header includes name and size) |
ping |
Ping |
pong |
Pong |
This is an educational tool with no encryption and no authentication.
MIT