1 .TH sock 1 "12 June 2001" "sock-1.1" "UCW Utilities"
4 sock \- simple socket interface for shell scripts
7 [-dentuvx] ([-b <local>] <remote> | -l <local>) [<command>]
10 is a simple program serving as an interface between its standard input/output
11 streams and sockets, primarily intended to be used in shell scripts, but often
12 useful interactively from the command line as well.
15 supports two modes: listening mode and originating mode. In the listening mode
20 acts as an server and accepts incoming connections for the network address
23 (see below for how to write addresses). In the originating mode, you specify
26 to connect to and maybe also the local address
28 to bind the local end to.
32 just copies its standard input to the socket and all data received from the socket
33 to its standard output. If you want, you can specify a
35 to be spawned and the socket redirected to its standard input/output instead
36 (in the listening mode, you can use
38 to wait for multiple connections and spawn the command for each of them
39 instead of exiting after serving a single incoming connection).
43 currently supports two address families: IP and UNIX.
47 domain sockets, just use a socket file name as an address.
51 sockets, addresses look like [\fB<host>\fR][\fB:<port>\fR], where
52 \fB<host>\fR is a host name and \fB<port>\fR is a port number or
53 a service name. In case you don't specify whether you want to use TCP
54 or UDP, sock uses the protocol associated with the specified service
55 or falls back to TCP if both are possible. If the host name is omitted,
56 "any" (for binding or listening) or "localhost" (for connecting)
62 Run as a daemon and run the
64 for each incoming connection instead of exiting after having served
68 Terminate after receiving first EOF in any direction. Default behaviour
69 is to wait for EOF in both directions. Please note that this has changed
73 Avoid reverse DNS lookups in verbose mode.
82 Be verbose. The more -v's you give, the more verbose sock is.
88 Use `sock :smtp' to talk with local mailer.
90 Use `echo -e "HELO `hostname -f`\\nETRN `hostname -f`" | sock mail.server.name:smtp' to tell
91 your mail-exchanger it should start sending all messages queued for you.
93 Use `sock -dl :7777 fortune' to establish a simple fortune cookie server.
95 Use `sock -e :7777' as a client for the above server.
99 has been written and is (at least sometimes) maintained by Martin Mares <mj@ucw.cz>.