NANOCAT(1)
π NANOCAT π
okay bestie, sit down, hydrate, and let me tell you about nanocat(1) β she's the command-line girlie from nanomsg version 1.2.2, and she is lowkey iconic. if you've ever wanted to yeet data across a network from your shell like it's nothing, this is your moment. β¨
π NAME π
nanocat β a command-line interface to nanomsg. that's the whole vibe. π«Ά
β¨ SYNOPSIS β¨
the main-character lineup, one per socket type:
nanocat --req {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] [-AQ]
nanocat --rep {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-AQ]
nanocat --push {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC]
nanocat --pull {--connect ADDR|--bind ADDR} [-AQ]
nanocat --pub {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC]
nanocat --sub {--connect ADDR|--bind ADDR} [--subscribe PREFIX ...] [-AQ]
nanocat --surveyor {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] [-AQ]
nanocat --respondent {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-AQ]
nanocat --bus {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] [-AQ]
nanocat --pair {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] [-AQ]
and if the symlinks happen to be installed, you get these glow-up short names instead β same energy, fewer letters:
nn_req {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] [-AQ]
nn_rep {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-AQ]
nn_push {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC]
nn_pull {--connect ADDR|--bind ADDR} [-AQ]
nn_pub {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC]
nn_sub {--connect ADDR|--bind ADDR} [--subscribe PREFIX ...] [-AQ]
nn_surveyor {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] [-AQ]
nn_respondent {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-AQ]
nn_bus {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] [-AQ]
nn_pair {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] [-AQ]
π DESCRIPTION π
so nanocat is a command-line tool for sending and receiving data through nanomsg sockets. that's it. that's her job and she does it flawlessly. π
and like, what do you do with that? the manpage says: debugging (obvi), sending files through the network (yes really), health checking the system (she's a doctor too), or honestly whatever else you can think of β the limit is literally your imagination, bestie. π¦
π₯ OPTIONS π₯
πΈ Generic πΈ
--verbose,-vβ crank the verbosity of thenanocatup. more talking, more details.--silent,-qβ drop the verbosity of thenanocatdown. shhh, she's being mysterious. π€«--help,-hβ this help text. she explains herself when asked.
π Socket Types π
pick your girl. one of these, please:
--pushβ useNN_PUSHsocket type--pullβ useNN_PULLsocket type--pubβ useNN_PUBsocket type--subβ useNN_SUBsocket type--reqβ useNN_REQsocket type--repβ useNN_REPsocket type--surveyorβ useNN_SURVEYORsocket type--respondentβ useNN_RESPONDENTsocket type--busβ useNN_BUSsocket type--pairβ useNN_PAIRsocket type
π Socket Options π
--bindADDR β bind the socket to the address ADDR--connectADDR β connect the socket to the address ADDR--bind-ipc,-XPATH β bind the socket to the ipc address"ipc://PATH".--connect-ipc,-xPATH β connect the socket to the ipc address"ipc://PATH".--bind-local,-LPORT β bind the socket to the tcp address"tcp://127.0.0.1:PORT".--connect-local,-lPORT β connect the socket to the tcp address"tcp://127.0.0.1:PORT".--recv-timeoutSEC β set the timeout for receiving a message--send-timeoutSEC β set the timeout for sending a message
π§ SUB Socket Options π§
--subscribePREFIX β subscribe to the prefix PREFIX. note: the socket will be subscribed to everything (that's an empty prefix) if no prefixes are specified on the command-line. she's a yes-girl by default, periodt.
π₯ Input Options π₯
--formatFORMAT β use echo format FORMAT (same as the options below)--rawβ dump the message as is. (note: no delimiters are printed)--ascii,-Aβ print the ASCII part of the message delimited by newline. all non-ascii characters get replaced by a dot.--quoted,-Qβ print each message on a separate line in double quotes with C-like character escaping--msgpackβ print each message as a msgpacked string (raw type). this one's for the girlies doing programmatic parsing π»
π€ Output Options π€
--interval,-iSEC β send a message (or a request) every SEC seconds. she's consistent. she's reliable. she's that girl.--delay,-dSEC β wait SEC seconds before sending the message (super useful for one-shotPUBsockets)--data,-DDATA β send DATA to the socket and quit, forPUB,PUSH,PAIR,BUSsockets. use DATA to reply forREPorRESPONDENTsockets. send DATA as a request forREQorSURVEYORsockets. one flag, three whole personalities. π--file,-FPATH β same as--databut it gets the data from the file PATH
πΈ EXAMPLES πΈ
the classic ping-pong with nn_req/nn_rep sockets β and bestie, these must be run simultaneously, no cap, two terminals or it's not happening:
nanocat --rep --bind tcp://127.0.0.1:1234 --data pong --format ascii
nanocat --req --connect tcp://127.0.0.1:1234 --data ping --format ascii
or, if you want the shorter-to-write form, she also comes in snack size:
nn_rep -L1234 -Dpong -A
nn_req -l1234 -Dping -A
do periodic requests, once every second, like clockwork π:
nn_req -l1234 -Dping -A -i 1
the rep socket that never replies (that's the no--D-option lifestyle) β this one is genuinely useful for checking whether the resending of requests is actually working:
nanocat --rep --connect ipc:///var/run/app/req.socket
send the output of ls to whatever would connect to 127.0.0.1:1234 and then dip:
ls | nanocat --push -L1234 -F-
and finally, send heartbeats to an imaginary monitoring service, because even fictional infrastructure deserves love π:
nanocat --pub --connect tcp://monitoring.example.org -D"I am alive!" --interval 10
π SEE ALSO π
nanomsg(7) β go read the big one, she's the parent lore.
π AUTHORS π
Paul Colomiets <paul@colomiets.name> β the icon, the legend, the one who made her. π
and that's the whole page, bestie! this was nanocat(1) from nanomsg version 1.2.2, dated 2026-01-16. go forth and socket responsibly. πβ¨π
π¦
π¦ where this page comes from
- fedora 44: nanomsg 1.2.2-2.fc44 Β· MIT
- fedora 44: nanomsg 1.2.2-2.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms