Pure Python socket communication tool for sending and receiving messages and files over TCP.
Reimagines netcat/telnet for the Pynosaur ecosystem.
- Three modes —
rec(receive),sen(send),mult(full duplex) - Structured protocol — length-prefixed JSON headers + binary payload
- File transfer — send and receive files with metadata
- Network utilities — show IP info, test ports
- Pure Python — stdlib only, no dependencies
- Cross-platform — Linux, macOS, Windows
pget install sockOr from source:
git clone https://github.com/pynosaur/sock.git
cd sock
python app/main.py --helpListen on a port and receive messages or files:
sock rec 8080Save received files to a directory:
sock rec 8080 -d ~/DownloadsSend a message:
sock sen 192.168.1.10 8080 -m "hello"Send a file:
sock sen 192.168.1.10 8080 -f document.txtBoth sides can send text and files interactively.
Listen side:
sock mult -l 8080Connect side:
sock mult 192.168.1.10 8080Interactive 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 8080sock 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.
- Messages are sent in plaintext
- Anyone who can reach the port can connect
- Do not send sensitive data
- Use on trusted networks
- Python 3.8+
- No external dependencies
MIT