Tori CLI is a small command-line tool that opens a TCP connection to a destination host and port by speaking the SOCKS4 protocol directly to a local Tor proxy at 127.0.0.1:9050. It's aimed at people who want to see the raw mechanics of a SOCKS handshake rather than use a library for it.
The client hand-builds the SOCKS4 request struct (version, command, destination port/IP, user id) in a single header file, sends it over a POSIX socket, and reads back the proxy's reply to check the connect code before reporting success or failure.