)nl()
tt(socat -V)nl()
tt(socat -h[h[h]] | -?[?[?]])nl()
tt(filan)nl()
tt(procan)
label(DESCRIPTION)
manpagedescription()
Socat() is a command line based utility that establishes two bidirectional byte
streams and transfers data between them. Because the streams can be constructed
from a large set of different types of data sinks and sources
(see link(address types)(ADDRESS_TYPES)), and because lots of
link(address options)(ADDRESS_OPTIONS) may be applied to the streams, socat can
be used for many different purposes.
Filan() is a utility that prints information about its active file
descriptors to stdout. It has been written for debugging socat(), but might be
useful for other purposes too. Use the -h option to find more infos.
Procan() is a utility that prints information about process parameters to
stdout. It has been written to better understand
some UNIX process properties and for debugging socat(), but might be
useful for other purposes too.
The life cycle of a socat() instance typically consists of four phases.
In the em(init) phase, the command line options are parsed and logging is
initialized.
During the em(open) phase, socat() opens the first address and afterwards the
second address. These steps are usually blocking; thus, especially for complex address types like socks,
connection requests or authentication dialogs must be completed before the next
step is started.
In the em(transfer) phase, socat() watches both streams' read and write file
descriptors via code(select()), and, when data is available on one side em(and)
can be written to the other side, socat reads it, performs newline
character conversions if required, and writes the data to the write file
descriptor of the other stream, then continues waiting for more data in both
directions.
When one of the streams effectively reaches EOF, the em(closing) phase
begins. Socat() transfers the EOF condition to the other stream,
i.e. tries to shutdown only its write stream, giving it a chance to
terminate gracefully. For a defined time socat() continues to transfer data in
the other direction, but then closes all remaining channels and terminates.
label(OPTIONS)
manpageoptions()
Socat() provides some command line options that modify the behaviour of the
program. They have nothing to do with so called
link(address options)(ADDRESS_OPTIONS) that are used as parts of link(address specifications)(ADDRESS_SPECIFICATIONS).
startdit()
dit(bf(tt(-V)))
Print version and available feature information to stdout, and exit.
dit(bf(tt(-h | -?)))
Print a help text to stdout describing command line options and available address
types, and exit.
dit(bf(tt(-hh | -??)))
Like -h, plus a list of the short names of all available address options. Some options are
platform dependend, so this output is helpful for checking the particular
implementation.
dit(bf(tt(-hhh | -???)))
Like -hh, plus a list of all available address option names.
label(option_d)dit(bf(tt(-d)))
Without this option, only fatal, error, and warning messages are printed;
applying this option also prints notice messages.
See link(DIAGNOSTICS)(DIAGNOSTICS) for more information.
label(option_d0)dit(bf(tt(-d0)))
With this option, only fatal and error messages are printed; this restores
the behaviour of socat() up to version 1.7.4.
label(option_d_d)dit(bf(tt(-d -d | -dd | -d2))) Prints fatal, error, warning, and notice messages.
dit(bf(tt(-d -d -d | -ddd | -d3))) Prints fatal, error, warning, notice, and info messages.
dit(bf(tt(-d -d -d -d | -dddd | -d4))) Prints fatal, error, warning, notice, info, and debug
messages.
dit(bf(tt(-D)))
Logs information about file descriptors before starting the transfer phase.
label(option_experimental)dit(bf(tt(--experimental)))
New features that are not well tested or are subject to change in the future
must me explicitely enabled using this option.
dit(bf(tt(-ly[])))
Writes messages to syslog instead of stderr; severity as defined with -d
option. With optional link()(TYPE_FACILITY), the syslog type can
be selected, default is "daemon". Third party libraries might not obey this
option.
dit(bf(tt(-lf))tt( ))
Writes messages to [link(filename)(TYPE_FILENAME)] instead of
stderr. Some third party libraries, in particular libwrap, might not obey
this option.
dit(bf(tt(-ls)))
Writes messages to stderr (this is the default). Some third party libraries
might not obey this option, in particular libwrap appears to only log to
syslog.
label(option_lp)dit(bf(tt(-lp))tt())
Overrides the program name printed in error messages and used for
constructing environment variable names.
dit(bf(tt(-lu)))
Extends the timestamp of error messages to microsecond resolution. Does not
work when logging to syslog.
label(option_lm)dit(bf(tt(-lm[])))
Mixed log mode. During startup messages are printed to stderr; when socat()
starts the transfer phase loop or daemon mode (i.e. after opening all
streams and before starting data transfer, or, with listening sockets with
fork option, before the first accept call), it switches logging to syslog.
With optional link()(TYPE_FACILITY), the syslog type can be
selected, default is "daemon".
label(option_lh)dit(bf(tt(-lh)))
Adds hostname to log messages. Uses the value from environment variable
HOSTNAME or the value retrieved with tt(uname()) if HOSTNAME is not set.
dit(bf(tt(-v)))
Writes the transferred data not only to their target streams, but also to
stderr. The output format is text with some conversions for readability, and
prefixed with "> " or "< " indicating flow directions.
dit(bf(tt(-x)))
Writes the transferred data not only to their target streams, but also to
stderr. The output format is hexadecimal, prefixed with "> " or "< "
indicating flow directions. Can be combined with code(-v).
label(option_r)dit(bf(tt(-r )))
Dumps the raw (binary) data flowing from left to right address to the given
file. The file name may contain references to environment variables and
code($$) (pid), code($PROGNAME) (see option link(option -lp)(option_lp)),
code($TIMESTAMP) (uses format %Y%m%dT%H%M%S), and code(MICROS) (microseconds
of daytime). These references have to be protected from shell expansion of
course.
dit(bf(tt(-R )))
Dumps the raw (binary) data flowing from right to left address to the given
file. See link(option -r)(option_r) for customization of file name.
label(option_b)dit(bf(tt(-b))tt())
Sets the data transfer block [link(size_t)(TYPE_SIZE_T)].
At most bytes are transferred per step. Default is 8192 bytes.
label(option_s)dit(bf(tt(-s)))
By default, socat() terminates when an error occurred to prevent the process
from running when some option could not be applied. With this
option, socat() is sloppy with errors and tries to continue. Even with this
option, socat will exit on fatals, and will abort connection attempts when
security checks failed.
label(option_S)dit(bf(tt(-S))tt())
Changes the set of signals that are caught by socat() just for printing an
log message. This catching is useful to get the information about the signal
into socat()s log, but prevents core dump or other standard actions. The
default set of these signals is SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGABRT,
SIGBUS, SIGFPE, SIGSEGV, and SIGTERM; replace this set (0x89de on Linux)
with a bitmap (e.g., SIGFPE has value 8 and its bit is 0x0080).nl()
Note: Signals SIGHUP, SIGINT, SIGQUIT, SIGUSR1, SIGPIPE, SIGALRM, SIGTERM, and
SIGCHLD may be handled specially anyway.
label(option_t)dit(bf(tt(-t))tt())
When one channel has reached EOF, the write part of the other channel is shut
down. Then, socat() waits [link(timeval)(TYPE_TIMEVAL)] seconds
before terminating. Default is 0.5 seconds. This timeout only applies to
addresses where write and read part can be closed independently. When during
the timeout interval the read part gives EOF, socat terminates without
awaiting the timeout.
label(option_T)dit(bf(tt(-T))tt())
Total inactivity timeout: when socat() is already in the transfer loop and
nothing has happened for [link(timeval)(TYPE_TIMEVAL)] seconds
(no data arrived, no interrupt occurred...) then it terminates. Up to
version 1.8.0.0 "0" meant infinite"; since version 1.8.0.1 "0" means 0
and values <0 mean infinite.nl()
Useful with protocols like UDP that cannot transfer EOF.
label(option_u)dit(bf(tt(-u)))
Uses unidirectional mode. The first address is only used for reading, and the
second address is only used for writing (link(example)(EXAMPLE_option_u)).
label(option_U)dit(bf(tt(-U)))
Uses unidirectional mode in reverse direction. The first address is only
used for writing, and the second address is only used for reading.
label(option_g)dit(bf(tt(-g)))
During address option parsing, don't check if the option is considered
useful in the given address environment. Use it if you want to force, e.g.,
appliance of a socket option to a serial device.
label(option_L)dit(bf(tt(-L))tt())
If lockfile exists, exits with error. If lockfile does not exist, creates it
and continues, unlinks lockfile on exit.
label(option_W)dit(bf(tt(-W))tt())
If lockfile exists, waits until it disappears. When lockfile does not exist,
creates it and continues, unlinks lockfile on exit.
label(option_4)dit(bf(tt(-4)))
Use IP version 4 in case the addresses do not implicitly or explicitly
specify a version. Since version 1.8.0 the default is no preference.
label(option_6)dit(bf(tt(-6)))
Use IP version 6 in case the addresses do not implicitly or explicitly
specify a version.
label(option_statistics)dit(bf(tt(--statistics)))
dit(bf(tt(-S)))
Logs transfer statistics (bytes and blocks counters for both directions)
before terminating socat().nl()
See also link(signal USR1)(signal_usr1).nl()
This feature is experimental and might change in future versions.
enddit()
label(ADDRESS_SPECIFICATIONS)
manpagesection(ADDRESS SPECIFICATIONS)
With the address command line arguments, the user gives socat() instructions and
the necessary information for establishing the byte streams.
An address specification usually consists of an address type
keyword, zero or more required address parameters separated by ':' from the keyword and
from each
other, and zero or more address options separated by ','.
The keyword specifies the address type (e.g., TCP4, OPEN, EXEC). For some
keywords there exist synonyms ('-' for STDIO, TCP for TCP4). Keywords are case
insensitive.
For a few special address types, the keyword may be omitted:
Address specifications starting with a number are assumed to be FD (raw file
descriptor) addresses;
if a '/' is found before the first ':' or ',', GOPEN (generic file open) is
assumed.
The required number and type of address parameters depend on the address
type. E.g., TCP4 requires a server specification (name or address), and a port
specification (number or service name).
Zero or more address options may be given with each address. They influence the
address in some ways.
Options consist of an option keyword or an option keyword and a value,
separated by '='. Option keywords are case insensitive.
For filtering the options that are useful with an address
type, each option is member of one option group. For
each address type there is a set of option groups allowed. Only options
belonging to one of these address groups may be used (except with link(option -g)(option_g)).
label(ADDRESS_DUAL)
Address specifications following the above schema are also called em(single)
address specifications.
Two single addresses can be combined with "!!" to form a em(dual) type
address for one channel. Here, the first address is used by socat() for reading
data, and the
second address for writing data. There is no way to specify an option only once
for being applied to both single addresses.
Usually, addresses are opened in read/write
mode. When an address is part of a dual address specification, or when
link(option -u)(option_u) or link(-U)(option_U) is used, an address might be
used only for reading or for writing. Considering this is important with some
address types.
With socat version 1.5.0 and higher, the lexical analysis tries to handle
quotes and parenthesis meaningfully and allows escaping of special characters.
If one of the characters ( { [ ' is found, the corresponding closing
character - ) } ] ' - is looked for; they may also be nested. Within these
constructs, socats special characters and strings : , !! are not handled
specially. All those characters and strings can be escaped with \ or within ""
label(ADDRESS_TYPES)
manpagesection(ADDRESS TYPES)
This section describes the available address types with their keywords,
parameters, and semantics.
startdit()
label(ADDRESS_CREAT)dit(bf(tt(CREATE:)))
Opens link()(TYPE_FILENAME) with code(creat()) and uses the file
descriptor for writing.
This is a write-only address because a file opened with code(creat) cannot
be read from. See options link(-u)(option_u) and
link(-U)(option_U), and link(dual addresses)(ADDRESS_DUAL).nl()
Flags like O_LARGEFILE cannot be applied. If you need them use
link(OPEN)(ADDRESS_OPEN) with options
link(create)(OPTION_O_CREAT),link(create)(OPTION_O_TRUNC). nl()
must be a valid existing or not existing path.
If is a named pipe, code(creat()) might block;
if refers to a socket, this is an error.nl()
Option groups: link(FD)(GROUP_FD),link(REG)(GROUP_REG),link(NAMED)(GROUP_NAMED) nl()
Useful options:
link(mode)(OPTION_MODE),
link(user)(OPTION_USER),
link(group)(OPTION_GROUP),
link(unlink-early)(OPTION_UNLINK_EARLY),
link(unlink-late)(OPTION_UNLINK_LATE),
link(append)(OPTION_APPEND)nl()
See also: link(OPEN)(ADDRESS_OPEN), link(GOPEN)(ADDRESS_GOPEN)
label(ADDRESS_DCCP_CONNECT)dit(bf(tt(DCCP-CONNECT::)) (bf(tt(DCCP::))))
Establishes a DCCP connect to the specified [link(IP
address)(TYPE_IP_ADDRESS)] and [link(DCCP service)(TYPE_TCP_SERVICE)]
using IP version 4 or 6 depending on address specification, name
resolution, or option link(pf)(OPTION_PROTOCOL_FAMILY).nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),link(SCTP)(GROUP_SCTP),link(CHILD)(GROUP_CHILD),link(RETRY)(GROUP_RETRY) nl()
Useful options:
link(bind)(OPTION_BIND),
link(connect-timeout)(OPTION_CONNECT_TIMEOUT),
link(tos)(OPTION_TOS),
link(dccp-set-ccid)(OPTION_DCCP_SET_CCID),
link(nonblock)(OPTION_NONBLOCK),
link(sourceport)(OPTION_SOURCEPORT),
link(retry)(OPTION_RETRY),
link(readbytes)(OPTION_READBYTES)nl()
See also:
link(DCCP4-CONNECT)(ADDRESS_DCCP4_CONNECT),
link(DCCP6-CONNECT)(ADDRESS_DCCP6_CONNECT),
link(DCCP-LISTEN)(ADDRESS_DCCP_LISTEN),
link(TCP-CONNECT)(ADDRESS_TCP_CONNECT)
link(SCTP-CONNECT)(ADDRESS_SCTP_CONNECT)
label(ADDRESS_DCCP4_CONNECT)dit(bf(tt(DCCP4-CONNECT::)) (bf(tt(DCCP4::))))
Like link(DCCP-CONNECT)(ADDRESS_DCCP_CONNECT), but only supports IPv4 protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(DCCP)(GROUP_DCCP),link(CHILD)(GROUP_CHILD),link(RETRY)(GROUP_RETRY) nl()
label(ADDRESS_DCCP6_CONNECT)dit(bf(tt(DCCP6-CONNECT::)) (bf(tt(DCCP6::))))
Like link(DCCP-CONNECT)(ADDRESS_DCCP_CONNECT), but only supports IPv6 protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP6)(GROUP_IP6),link(DCCP)(GROUP_DCCP),link(CHILD)(GROUP_CHILD),link(RETRY)(GROUP_RETRY) nl()
label(ADDRESS_DCCP_LISTEN)dit(bf(tt(DCCP-LISTEN:)) (bf(tt(DCCP-L:))))
Listens on [link(DCCP service)(TYPE_TCP_SERVICE)] and accepts an
DCCP connection. The IP version is 4 or the one specified with
address option link(pf)(OPTION_PROTOCOL_FAMILY), socat option
(link(-4)(option_4), link(-6)(option_6)), or environment variable link(SOCAT_DEFAULT_LISTEN_IP)(ENV_SOCAT_DEFAULT_LISTEN_IP).
Note that opening
this address usually blocks until a client connects.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(LISTEN)(GROUP_LISTEN),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),link(DCCP)(GROUP_DCCP),link(RETRY)(GROUP_RETRY) nl()
Useful options:
link(fork)(OPTION_FORK),
link(bind)(OPTION_BIND),
link(range)(OPTION_RANGE),
link(max-children)(OPTION_MAX_CHILDREN),
link(backlog)(OPTION_BACKLOG),
link(accept-timeout)(OPTION_ACCEPT_TIMEOUT),
link(dccp-set-sid)(OPTION_DCCP_SET_CCID),
link(su)(OPTION_SUBSTUSER),
link(reuseaddr)(OPTION_SO_REUSEADDR),
link(retry)(OPTION_RETRY)nl()
See also:
link(DCCP4-LISTEN)(ADDRESS_DCCP4_LISTEN),
link(DCCP6-LISTEN)(ADDRESS_DCCP6_LISTEN),
link(TCP-LISTEN)(ADDRESS_TCP_LISTEN),
link(SCTP-LISTEN)(ADDRESS_SCTP_LISTEN),
link(DCCP-CONNECT)(ADDRESS_DCCP_CONNECT)
label(ADDRESS_DCCP4_LISTEN)dit(bf(tt(DCCP4-LISTEN:)) (bf(tt(DCCP4-L:))))
Like link(DCCP-LISTEN)(ADDRESS_DCCP_LISTEN), but only supports IPv4
protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(LISTEN)(GROUP_LISTEN),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE),link(IP4)(GROUP_IP4),link(DCCP)(GROUP_DCCP),link(RETRY)(GROUP_RETRY) nl()
label(ADDRESS_DCCP6_LISTEN)dit(bf(tt(DCCP6-LISTEN:)) (bf(tt(DCCP6-L:))))
Like link(DCCP-LISTEN)(ADDRESS_DCCP_LISTEN), but only supports IPv6
protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(LISTEN)(GROUP_LISTEN),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE),link(IP6)(GROUP_IP6),link(DCCP)(GROUP_DCCP),link(RETRY)(GROUP_RETRY) nl()
label(ADDRESS_EXEC)dit(bf(tt(EXEC:)))
Forks a sub process that establishes communication with its parent process
and invokes the specified program with code(execvp()).
link()(TYPE_COMMAND_LINE) is a simple command
with arguments separated by single spaces. If the program name
contains a '/', the part after the last '/' is taken as ARGV[0]. If the
program name is a relative
path, the code(execvp()) semantics for finding the program via
code($PATH)
apply. After successful program start, socat() writes data to stdin of the
process and reads from its stdout using a unixdomain() socket generated by
code(socketpair()) per default. (link(example)(EXAMPLE_ADDRESS_EXEC)) nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(EXEC)(GROUP_EXEC),link(FORK)(GROUP_FORK),link(TERMIOS)(GROUP_TERMIOS) nl()
Useful options:
link(path)(OPTION_PATH),
link(fdin)(OPTION_FDIN),
link(fdout)(OPTION_FDOUT),
link(chroot)(OPTION_CHROOT),
link(su)(OPTION_SUBSTUSER),
link(su-d)(OPTION_SUBSTUSER_DELAYED),
link(nofork)(OPTION_NOFORK),
link(socktype)(OPTION_SO_TYPE),
link(pty)(OPTION_PTY),
link(stderr)(OPTION_STDERR),
link(ctty)(OPTION_CTTY),
link(setsid)(OPTION_SETSID),
link(pipes)(OPTION_PIPES),
link(umask)(OPTION_UMASK),
link(login)(OPTION_LOGIN),
link(sigint)(OPTION_SIGINT),
link(sigquit)(OPTION_SIGQUIT),
link(netns)(OPTION_NETNS)nl()
See also: link(SYSTEM)(ADDRESS_SYSTEM),link(SHELL)(ADDRESS_SHELL)
label(ADDRESS_FD)dit(bf(tt(FD:)))
Uses the file descriptor link()(TYPE_FDNUM). It must already exist as
valid unix() file descriptor.nl()
Option groups: link(FD)(GROUP_FD) (link(TERMIOS)(GROUP_TERMIOS),link(REG)(GROUP_REG),link(SOCKET)(GROUP_SOCKET)) nl()
See also:
link(STDIO)(ADDRESS_STDIO),
link(STDIN)(ADDRESS_STDIN),
link(STDOUT)(ADDRESS_STDOUT),
link(STDERR)(ADDRESS_STDERR)
label(ADDRESS_GOPEN)dit(bf(tt(GOPEN:)))
(Generic open) This address type tries to handle any file system entry
except directories usefully. link()(TYPE_FILENAME) may be a
relative or absolute path. If it already exists, its type is checked.
In case of a unixdomain() socket, socat() connects; if connecting fails,
socat() assumes a datagram socket and uses code(sendto()) calls.
If the entry is not a socket, socat() opens it applying the code(O_APPEND)
flag.
If it does not exist, it is opened with flag
code(O_CREAT) as a regular file (link(example)(EXAMPLE_ADDRESS_GOPEN)).nl()
Option groups: link(FD)(GROUP_FD),link(REG)(GROUP_REG),link(SOCKET)(GROUP_SOCKET),link(NAMED)(GROUP_NAMED),link(OPEN)(GROUP_OPEN) nl()
See also:
link(OPEN)(ADDRESS_OPEN),
link(CREATE)(ADDRESS_CREAT),
link(UNIX-CONNECT)(ADDRESS_UNIX_CONNECT)
label(ADDRESS_IP_SENDTO)dit(bf(tt(IP-SENDTO::)))
Opens a raw IP socket. Depending on host specification or option link(pf)(OPTION_PROTOCOL_FAMILY), IP protocol version
4 or 6 is used. It uses link()(TYPE_PROTOCOL) to send packets
to [link(IP address)(TYPE_IP_ADDRESS)] and receives packets from
host, ignores packets from other hosts.
Protocol 255 uses the raw socket with the IP header being part of the
data.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6) nl()
Useful options:
link(pf)(OPTION_PROTOCOL_FAMILY),
link(ttl)(OPTION_TTL) nl()
See also:
link(IP4-SENDTO)(ADDRESS_IP4_SENDTO),
link(IP6-SENDTO)(ADDRESS_IP6_SENDTO),
link(IP-RECVFROM)(ADDRESS_IP_RECVFROM),
link(IP-RECV)(ADDRESS_IP_RECV),
link(UDP-SENDTO)(ADDRESS_UDP_SENDTO),
link(UNIX-SENDTO)(ADDRESS_UNIX_SENDTO)
label(ADDRESS_INTERFACE)dit(bf(tt(INTERFACE:)))
Communicates with a network connected on an interface using raw packets
including link level data. link()(TYPE_INTERFACE) is the name of
the network interface. Currently only available on Linux.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET) nl()
Useful options:
link(pf)(OPTION_PROTOCOL_FAMILY),
link(type)(OPTION_SO_TYPE)nl()
See also: link(ip-recv)(ADDRESS_IP_RECV)
label(ADDRESS_IP4_SENDTO)dit(bf(tt(IP4-SENDTO::)))
Like link(IP-SENDTO)(ADDRESS_IP_SENDTO), but always uses IPv4.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4) nl()
label(ADDRESS_IP6_SENDTO)dit(bf(tt(IP6-SENDTO::)))
Like link(IP-SENDTO)(ADDRESS_IP_SENDTO), but always uses IPv6.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP6)(GROUP_IP6) nl()
label(ADDRESS_IP_DATAGRAM)dit(bf(tt(IP-DATAGRAM::)))
Sends outgoing data to the specified address which may in particular be a
broadcast or multicast address. Packets arriving on the local socket are
checked if their source addresses match
link(RANGE)(OPTION_RANGE) or link(TCPWRAP)(OPTION_TCPWRAPPERS)
options. This address type can for example be used for implementing
symmetric or asymmetric broadcast or multicast communications.nl()
Option groups: link(FD)(GROUP_FD), link(SOCKET)(GROUP_SOCKET),
link(IP4)(GROUP_IP4), link(IP6)(GROUP_IP6), link(RANGE)(GROUP_RANGE) nl()
Useful options:
link(bind)(OPTION_BIND),
link(range)(OPTION_RANGE),
link(tcpwrap)(OPTION_TCPWRAPPERS),
link(broadcast)(OPTION_SO_BROADCAST),
link(ip-multicast-loop)(OPTION_IP_MULTICAST_LOOP),
link(ip-multicast-ttl)(OPTION_IP_MULTICAST_TTL),
link(ip-multicast-if)(OPTION_IP_MULTICAST_IF),
link(ip-add-membership)(OPTION_IP_ADD_MEMBERSHIP),
link(ip-add-source-membership)(OPTION_IP_ADD_SOURCE_MEMBERSHIP),
link(ipv6-join-group)(OPTION_IPV6_JOIN_GROUP),
link(ipv6-join-source-group)(OPTION_IPV6_JOIN_SOURCE_GROUP),
link(ttl)(OPTION_TTL),
link(tos)(OPTION_TOS),
link(pf)(OPTION_PROTOCOL_FAMILY)nl()
See also:
link(IP4-DATAGRAM)(ADDRESS_IP4_DATAGRAM),
link(IP6-DATAGRAM)(ADDRESS_IP6_DATAGRAM),
link(IP-SENDTO)(ADDRESS_IP_SENDTO),
link(IP-RECVFROM)(ADDRESS_IP_RECVFROM),
link(IP-RECV)(ADDRESS_IP_RECV),
link(UDP-DATAGRAM)(ADDRESS_UDP_DATAGRAM)
label(ADDRESS_IP4_DATAGRAM)dit(bf(tt(IP4-DATAGRAM::)))
Like link(IP-DATAGRAM)(ADDRESS_IP_DATAGRAM), but always uses IPv4.
(link(example)(EXAMPLE_ADDRESS_IP4_BROADCAST_CLIENT))nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(RANGE)(GROUP_RANGE) nl()
label(ADDRESS_IP6_DATAGRAM)dit(bf(tt(IP6-DATAGRAM::)))
Like link(IP-DATAGRAM)(ADDRESS_IP_DATAGRAM), but always uses IPv6. Please
note that IPv6 does not know broadcasts.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP6)(GROUP_IP6),link(RANGE)(GROUP_RANGE) nl()
label(ADDRESS_IP_RECVFROM)dit(bf(tt(IP-RECVFROM:)))
Opens a raw IP socket of link()(TYPE_PROTOCOL). Depending on option link(pf)(OPTION_PROTOCOL_FAMILY), IP protocol version
4 or 6 is used. It receives one packet from an unspecified peer and may send one or more answer packets to that peer.
This mode is particularly useful with fork option where each arriving packet - from arbitrary peers - is handled by its own sub process.
This allows a behaviour similar to typical UDP based servers like ntpd or
named.nl()
Please note that the reply packets might be fetched as incoming traffic when
sender and receiver IP address are identical because there is no port number
to distinguish the sockets.nl()
This address works well with IP-SENDTO address peers (see above).
Protocol 255 uses the raw socket with the IP header being part of the
data.nl()
See the link(note about RECVFROM addresses)(NOTE_RECVFROM).nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE) nl()
Useful options:
link(pf)(OPTION_PROTOCOL_FAMILY),
link(fork)(OPTION_FORK),
link(range)(OPTION_RANGE),
link(ttl)(OPTION_TTL),
link(broadcast)(OPTION_SO_BROADCAST)nl()
See also:
link(IP4-RECVFROM)(ADDRESS_IP4_RECVFROM),
link(IP6-RECVFROM)(ADDRESS_IP6_RECVFROM),
link(IP-SENDTO)(ADDRESS_IP_SENDTO),
link(IP-RECV)(ADDRESS_IP_RECV),
link(UDP-RECVFROM)(ADDRESS_UDP_RECVFROM),
link(UNIX-RECVFROM)(ADDRESS_UNIX_RECVFROM)
label(ADDRESS_IP4_RECVFROM)dit(bf(tt(IP4-RECVFROM:)))
Like link(IP-RECVFROM)(ADDRESS_IP_RECVFROM), but always uses IPv4.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE) nl()
label(ADDRESS_IP6_RECVFROM)dit(bf(tt(IP6-RECVFROM:)))
Like link(IP-RECVFROM)(ADDRESS_IP_RECVFROM), but always uses IPv6.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP6)(GROUP_IP6),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE) nl()
label(ADDRESS_IP_RECV)dit(bf(tt(IP-RECV:)))
Opens a raw IP socket of link()(TYPE_PROTOCOL). Depending on option link(pf)(OPTION_PROTOCOL_FAMILY), IP protocol version
4 or 6 is used. It receives packets from multiple unspecified peers and merges the data.
No replies are possible, this is a read-only address, see options link(-u)(option_u) and
link(-U)(option_U), and link(dual addresses)(ADDRESS_DUAL).
It can be, e.g., addressed by socat IP-SENDTO address peers.
Protocol 255 uses the raw socket with the IP header being part of the
data.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),link(RANGE)(GROUP_RANGE) nl()
Useful options:
link(pf)(OPTION_PROTOCOL_FAMILY),
link(range)(OPTION_RANGE)nl()
See also:
link(IP4-RECV)(ADDRESS_IP4_RECV),
link(IP6-RECV)(ADDRESS_IP6_RECV),
link(IP-SENDTO)(ADDRESS_IP_SENDTO),
link(IP-RECVFROM)(ADDRESS_IP_RECVFROM),
link(UDP-RECV)(ADDRESS_UDP_RECV),
link(UNIX-RECV)(ADDRESS_UNIX_RECV)
label(ADDRESS_IP4_RECV)dit(bf(tt(IP4-RECV:)))
Like link(IP-RECV)(ADDRESS_IP_RECV), but always uses IPv4.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(RANGE)(GROUP_RANGE) nl()
label(ADDRESS_IP6_RECV)dit(bf(tt(IP6-RECV:)))
Like link(IP-RECV)(ADDRESS_IP_RECV), but always uses IPv6.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP6)(GROUP_IP6),link(RANGE)(GROUP_RANGE) nl()
label(ADDRESS_OPEN)dit(bf(tt(OPEN:)))
Opens link()(TYPE_FILENAME) using the code(open()) system call
(link(example)(EXAMPLE_ADDRESS_OPEN)).
This operation fails on unixdomain() sockets. nl()
Note: This address type is rarely useful in bidirectional mode.nl()
Option groups: link(FD)(GROUP_FD),link(REG)(GROUP_REG),link(NAMED)(GROUP_NAMED),link(OPEN)(GROUP_OPEN) nl()
Useful options:
link(creat)(OPTION_O_CREAT),
link(excl)(OPTION_EXCL),
link(noatime)(OPTION_O_NOATIME),
link(nofollow)(OPTION_NOFOLLOW),
link(append)(OPTION_APPEND),
link(rdonly)(OPTION_RDONLY),
link(wronly)(OPTION_WRONLY),
link(lock)(OPTION_LOCK),
link(readbytes)(OPTION_READBYTES),
link(ignoreeof)(OPTION_IGNOREEOF)nl()
See also:
link(CREATE)(ADDRESS_CREAT),
link(GOPEN)(ADDRESS_GOPEN),
link(UNIX-CONNECT)(ADDRESS_UNIX_CONNECT)
label(ADDRESS_OPENSSL_CONNECT)dit(bf(tt(OPENSSL::)))
Tries to establish a SSL connection to [link(TCP
service)(TYPE_TCP_SERVICE)] on
[link(IP address)(TYPE_IP_ADDRESS)] using TCP/IP version 4 or 6
depending on address specification, name resolution, or option
link(pf)(OPTION_PROTOCOL_FAMILY).nl()
NOTE: Up to version 1.7.2.4
the server certificate was only checked for validity against the system
certificate store or link(cafile)(OPTION_OPENSSL_CAFILE) or
link(capath)(OPTION_OPENSSL_CAPATH),
but not for match with the server's name or its IP address.
Since version 1.7.3.0 socat checks the peer certificate for match with the
parameter or the value of the
link(openssl-commonname)(OPTION_OPENSSL_COMMONNAME) option.
Socat tries to match it against the certificates subject commonName,
and the certificates extension subjectAltName DNS names. Wildcards in the
certificate are supported.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),link(TCP)(GROUP_TCP),link(OPENSSL)(GROUP_OPENSSL),link(RETRY)(GROUP_RETRY) nl()
Useful options:
link(min-proto-version)(OPTION_OPENSSL_MIN_PROTO_VERSION),
link(cipher)(OPTION_OPENSSL_CIPHERLIST),
link(verify)(OPTION_OPENSSL_VERIFY),
link(commonname)(OPTION_OPENSSL_COMMONNAME),
link(cafile)(OPTION_OPENSSL_CAFILE),
link(capath)(OPTION_OPENSSL_CAPATH),
link(certificate)(OPTION_OPENSSL_CERTIFICATE),
link(key)(OPTION_OPENSSL_KEY),
link(compress)(OPTION_OPENSSL_COMPRESS),
link(bind)(OPTION_BIND),
link(pf)(OPTION_PROTOCOL_FAMILY),
link(connect-timeout)(OPTION_CONNECT_TIMEOUT),
link(sourceport)(OPTION_SOURCEPORT),
link(retry)(OPTION_RETRY)nl()
See also:
link(OPENSSL-LISTEN)(ADDRESS_OPENSSL_LISTEN),
link(TCP)(ADDRESS_TCP_CONNECT)
label(ADDRESS_OPENSSL_LISTEN)dit(bf(tt(OPENSSL-LISTEN:)))
Listens on tcp [link(TCP service)(TYPE_TCP_SERVICE)].
The IP version is 4 or the one specified with
link(pf)(OPTION_PROTOCOL_FAMILY). When a
connection is accepted, this address behaves as SSL server.nl()
Note: You probably want to use the link(certificate)(OPTION_OPENSSL_CERTIFICATE) option with this address.nl()
NOTE: The client certificate is only checked for validity against
link(cafile)(OPTION_OPENSSL_CAFILE) or link(capath)(OPTION_OPENSSL_CAPATH),
but not for match with the client's name or its IP address!nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),link(TCP)(GROUP_TCP),link(LISTEN)(GROUP_LISTEN),link(OPENSSL)(GROUP_OPENSSL),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE),link(RETRY)(GROUP_RETRY) nl()
Useful options:
link(pf)(OPTION_PROTOCOL_FAMILY),
link(min-proto-version)(OPTION_OPENSSL_MIN_PROTO_VERSION),
link(cipher)(OPTION_OPENSSL_CIPHERLIST),
link(verify)(OPTION_OPENSSL_VERIFY),
link(commonname)(OPTION_OPENSSL_COMMONNAME),
link(cafile)(OPTION_OPENSSL_CAFILE),
link(capath)(OPTION_OPENSSL_CAPATH),
link(certificate)(OPTION_OPENSSL_CERTIFICATE),
link(key)(OPTION_OPENSSL_KEY),
link(compress)(OPTION_OPENSSL_COMPRESS),
link(fork)(OPTION_FORK),
link(bind)(OPTION_BIND),
link(range)(OPTION_RANGE),
link(tcpwrap)(OPTION_TCPWRAPPERS),
link(su)(OPTION_SUBSTUSER),
link(reuseaddr)(OPTION_SO_REUSEADDR),
link(retry)(OPTION_RETRY)nl()
See also:
link(OPENSSL)(ADDRESS_OPENSSL_CONNECT),
link(TCP-LISTEN)(ADDRESS_TCP_LISTEN)
label(ADDRESS_OPENSSL_DTLS_CLIENT)dit(bf(tt(OPENSSL-DTLS-CLIENT::)))
Tries to establish a DTLS connection to [link(UDP
service)(TYPE_UDP_SERVICE)] on
[link(IP address)(TYPE_IP_ADDRESS)] using UDP/IP version 4 or 6
depending on address specification, name resolution, or option
link(pf)(OPTION_PROTOCOL_FAMILY).nl()
Socat() checks the peer certificates subjectAltName or commonName against the addresses
option link(openssl-commonname)(OPTION_OPENSSL_COMMONNAME) or the host name.
Wildcards in the certificate are supported.nl()
Use socat() option link(-b)(option_b) to make datagrams small enough to fit with overhead
on the network. Use option link(-T)(option_T) to prevent indefinite hanging when peer went down quietly.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),COMMENT(link(UDP)(GROUP_UDP),)link(OPENSSL)(GROUP_OPENSSL),link(RETRY)(GROUP_RETRY) nl()
Useful options:
link(min-proto-version)(OPTION_OPENSSL_MIN_PROTO_VERSION),
link(cipher)(OPTION_OPENSSL_CIPHERLIST),
link(verify)(OPTION_OPENSSL_VERIFY),
link(commonname)(OPTION_OPENSSL_COMMONNAME),
link(cafile)(OPTION_OPENSSL_CAFILE),
link(capath)(OPTION_OPENSSL_CAPATH),
link(certificate)(OPTION_OPENSSL_CERTIFICATE),
link(key)(OPTION_OPENSSL_KEY),
link(compress)(OPTION_OPENSSL_COMPRESS),
link(bind)(OPTION_BIND),
link(pf)(OPTION_PROTOCOL_FAMILY),
link(sourceport)(OPTION_SOURCEPORT),
link(retry)(OPTION_RETRY),
link(rcvtimeo)(OPTION_SO_RCVTIMOE)nl()
See also:
link(OPENSSL-DTLS-SERVER)(ADDRESS_OPENSSL_DTLS_SERVER),
link(OPENSSL-CONNECT)(ADDRESS_OPENSSL_CONNECT),
link(UDP-CONNECT)(ADDRESS_UDP_CONNECT)
label(ADDRESS_OPENSSL_DTLS_SERVER)dit(bf(tt(OPENSSL-DTLS-SERVER:)))
Listens on UDP [link(UDP service)(TYPE_UDP_SERVICE)].
The IP version is 4 or the one specified with
link(pf)(OPTION_PROTOCOL_FAMILY). When a
connection is accepted, this address behaves as DTLS server.nl()
Note: You probably want to use the link(certificate)(OPTION_OPENSSL_CERTIFICATE) option with this address.nl()
NOTE: The client certificate is only checked for validity against
link(cafile)(OPTION_OPENSSL_CAFILE) or link(capath)(OPTION_OPENSSL_CAPATH),
but not for match with the client's name or its IP address!
Use socat() option link(-b)(option_b) to make datagrams small enough to fit with overhead on the network.
Use option link(-T)(option_T) to prevent indefinite hanging when peer went down quietly.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),COMMENT(link(UDP)(GROUP_UDP),)link(LISTEN)(GROUP_LISTEN),link(OPENSSL)(GROUP_OPENSSL),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE),link(RETRY)(GROUP_RETRY) nl()
Useful options:
link(pf)(OPTION_PROTOCOL_FAMILY),
link(min-proto-version)(OPTION_OPENSSL_MIN_PROTO_VERSION),
link(cipher)(OPTION_OPENSSL_CIPHERLIST),
link(verify)(OPTION_OPENSSL_VERIFY),
link(commonname)(OPTION_OPENSSL_COMMONNAME),
link(cafile)(OPTION_OPENSSL_CAFILE),
link(capath)(OPTION_OPENSSL_CAPATH),
link(certificate)(OPTION_OPENSSL_CERTIFICATE),
link(key)(OPTION_OPENSSL_KEY),
link(compress)(OPTION_OPENSSL_COMPRESS),
link(fork)(OPTION_FORK),
link(bind)(OPTION_BIND),
link(range)(OPTION_RANGE),
link(tcpwrap)(OPTION_TCPWRAPPERS),
link(su)(OPTION_SUBSTUSER),
link(reuseaddr)(OPTION_SO_REUSEADDR),
link(retry)(OPTION_RETRY)nl()
link(rcvtimeo)(OPTION_SO_RCVTIMOE)nl()
See also:
link(OPENSSL-DTLS-CLIENT)(ADDRESS_OPENSSL_DTLS_CLIENT),
link(OPENSSL-LISTEN)(ADDRESS_OPENSSL_LISTEN),
link(UDP-LISTEN)(ADDRESS_UDP_LISTEN)
label(ADDRESS_NAMED_PIPE)dit(bf(tt(PIPE:)))
If link()(TYPE_FILENAME) already exists, it is opened.
If it does not exist, a named pipe is created and opened. Beginning with
socat version 1.4.3, the named pipe is removed when the address is closed
(but see option link(unlink-close)(OPTION_UNLINK_CLOSE)nl()
Note: When a pipe is used for both reading and writing, it works
as echo service.nl()
Note: When a pipe is used for both reading and writing, and socat tries
to write more bytes than the pipe can buffer (Linux 2.4: 2048 bytes), socat
might block. Consider using socat option, e.g., code(-b 2048) nl()
Option groups: link(FD)(GROUP_FD),link(NAMED)(GROUP_NAMED),link(OPEN)(GROUP_OPEN) nl()
Useful options:
link(rdonly)(OPTION_RDONLY),
link(nonblock)(OPTION_NONBLOCK),
link(group)(OPTION_GROUP),
link(user)(OPTION_USER),
link(mode)(OPTION_MODE),
link(unlink-early)(OPTION_UNLINK_EARLY)nl()
See also: link(unnamed pipe)(ADDRESS_UNNAMED_PIPE)
label(ADDRESS_UNNAMED_PIPE)dit(bf(tt(PIPE)))
Creates an unnamed pipe and uses it for reading and writing. It works as an
echo, because everything written to it appeares immediately as read
data.nl()
Note: When socat tries to write more bytes than the pipe can queue (Linux
2.4: 2048 bytes), socat might block. Consider, e.g., using
option code(-b 2048) nl()
Option groups: link(FD)(GROUP_FD) nl()
See also: link(named pipe)(ADDRESS_NAMED_PIPE), link(SOCKETPAIR)(ADDRESS_SOCKETPAIR)
label(ADDRESS_SOCKETPAIR)dit(bf(tt(SOCKETPAIR)))
Creates a socketpair and uses it for reading and writing. It works as an
echo, because everything written to it appeares immediately as read
data. The default socket type is datagram, so it keeps packet boundaries.
nl()
Option groups: link(FD)(GROUP_FD) nl()
Useful options:
link(socktype)(OPTION_SO_TYPE)nl()
See also: link(unnamed pipe)(ADDRESS_UNNAMED_PIPE)
label(ADDRESS_POSIXMQ_READ)dit(bf(tt(POSIXMQ-READ:/)))
Opens the specified POSIX message queue and reads messages (packets). It
keeps the boundaries.nl()
This is a read-only address, see options link(-u)(option_u) and
link(-U)(option_U) and link(dual addresses)(ADDRESS_DUAL).nl()
Socat() provides this address type only on Linux because POSIX MQ is based
on UNIX filedescriptors there.nl()
This feature is new in version 1.8.0.0 and might change in the future,
therefore it is link(experimental)(option_experimental).nl()
Useful options:
link(posixmq-priority)(OPTION_POSIXMQ_PRIORITY),
link(unlink-early)(OPTION_UNLINK_EARLY),
link(unlink-close)(OPTION_UNLINK_CLOSE)
label(ADDRESS_POSIXMQ_RECEIVE)dit(bf(tt(POSIXMQ-RECEIVE:/)))
dit(bf(tt(POSIXMQ-RECV:/)))
Opens the specified POSIX message queue and reads one message (packet).nl()
This is a read-only address. See link(POSIXMQ-READ)(ADDRESS_POSIXMQ_READ)
for more info.nl()
Example: link(POSIX MQ recv with fork)(EXAMPLE_POSIXMQ_RECV_FORK)nl()
This feature is link(experimental)(option_experimental).nl()
Useful options:
link(posixmq-priority)(OPTION_POSIXMQ_PRIORITY),
link(fork)(OPTION_FORK),
link(max-children)(OPTION_MAX_CHILDREN),
link(unlink-early)(OPTION_UNLINK_EARLY),
link(unlink-close)(OPTION_UNLINK_CLOSE)
label(ADDRESS_POSIXMQ_SEND)dit(bf(tt(POSIXMQ-SEND:/)))
Opens the specified POSIX message queue and writes messages (packets).nl()
This is a write-only address. See link(POSIXMQ-READ)(ADDRESS_POSIXMQ_READ)
for more info.nl()
(link(Example)(EXAMPLE_POSIXMQ_SEND))nl()
This feature is link(experimental)(option_experimental).nl()
Useful options:
link(posixmq-priority)(OPTION_POSIXMQ_PRIORITY),
link(fork)(OPTION_FORK),
link(max-children)(OPTION_MAX_CHILDREN),
link(unlink-early)(OPTION_UNLINK_EARLY),
link(unlink-close)(OPTION_UNLINK_CLOSE)
label(ADDRESS_POSIXMQ_BIDIRECTIONAL)dit(bf(tt(POSIXMQ-BIDIRECTIONAL:/mqueue)))
Opens the specified POSIX message queue and writes and reads messages
(packet). This is probably rarely useful but has been implemented for
functional completeness.
label(ADDRESS_PROXY_CONNECT)dit(bf(tt(PROXY:::)))
Connects to an HTTP proxy server on port 8080 using TCP/IP version 4 or 6
depending on address specification, name resolution, or option
link(pf)(OPTION_PROTOCOL_FAMILY), and sends a CONNECT
request for hostname:port. If the proxy grants access and succeeds to
connect to the target, data transfer between socat and the target can
start (link(example)(EXAMPLE_PROXY_CONNECT)).
Note that the traffic need not be HTTP but can be an arbitrary protocol. nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),link(TCP)(GROUP_TCP),link(HTTP)(GROUP_HTTP),link(RETRY)(GROUP_RETRY) nl()
Useful options:
link(proxyport)(OPTION_PROXYPORT),
link(ignorecr)(OPTION_IGNORECR),
link(proxyauth)(OPTION_PROXY_AUTHORIZATION),
link(resolve)(OPTION_PROXY_RESOLVE),
link(crnl)(OPTION_CRNL),
link(bind)(OPTION_BIND),
link(connect-timeout)(OPTION_CONNECT_TIMEOUT),
link(mss)(OPTION_MSS),
link(sourceport)(OPTION_SOURCEPORT),
link(retry)(OPTION_RETRY) nl()
See also: link(SOCKS)(ADDRESS_SOCKS4), link(TCP)(ADDRESS_TCP_CONNECT)
label(ADDRESS_PTY)dit(bf(tt(PTY)))
Generates a pseudo terminal (pty) and uses its master side. Another process
may open the pty's slave side using it like a serial line or terminal.
(link(example)(EXAMPLE_ADDRESS_PTY)). If
both the ptmx and the openpty mechanisms are available, ptmx is used
(POSIX).nl()
Option groups: link(FD)(GROUP_FD),link(NAMED)(GROUP_NAMED),link(PTY)(GROUP_PTY),link(TERMIOS)(GROUP_TERMIOS) nl()
Useful options:
link(link)(OPTION_SYMBOLIC_LINK),
link(openpty)(OPTION_OPENPTY),
link(wait-slave)(OPTION_PTY_WAIT_SLAVE),
link(mode)(OPTION_MODE),
link(user)(OPTION_USER),
link(group)(OPTION_GROUP)nl()
See also:
link(UNIX-LISTEN)(ADDRESS_UNIX_LISTEN),
link(PIPE)(ADDRESS_NAMED_PIPE),
link(EXEC)(ADDRESS_EXEC), link(SYSTEM)(ADDRESS_SYSTEM), link(SHELL)(ADDRESS_SHELL)
label(ADDRESS_READLINE)dit(bf(tt(READLINE)))
Uses GNU readline and history on stdio to allow editing and reusing input
lines (link(example)(EXAMPLE_ADDRESS_READLINE)). This requires the GNU readline and
history libraries. Note that stdio should be a (pseudo) terminal device,
otherwise readline does not seem to work.nl()
Option groups: link(FD)(GROUP_FD),link(READLINE)(GROUP_READLINE),link(TERMIOS)(GROUP_TERMIOS) nl()
Useful options:
link(history)(OPTION_HISTORY),
link(noecho)(OPTION_NOECHO)nl()
See also:
link(STDIO)(ADDRESS_STDIO)
label(ADDRESS_SCTP_CONNECT)dit(bf(tt(SCTP-CONNECT::)))
Establishes an SCTP stream connection to the specified [link(IP
address)(TYPE_IP_ADDRESS)] and [link(TCP service)(TYPE_TCP_SERVICE)]
using IP version 4 or 6 depending on address specification, name
resolution, or option link(pf)(OPTION_PROTOCOL_FAMILY).nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),link(SCTP)(GROUP_SCTP),link(CHILD)(GROUP_CHILD),link(RETRY)(GROUP_RETRY) nl()
Useful options:
link(bind)(OPTION_BIND),
link(pf)(OPTION_PROTOCOL_FAMILY),
link(connect-timeout)(OPTION_CONNECT_TIMEOUT),
link(tos)(OPTION_TOS),
link(mtudiscover)(OPTION_MTUDISCOVER),
link(sctp-maxseg)(OPTION_SCTP_MAXSEG),
link(sctp-nodelay)(OPTION_SCTP_NODELAY),
link(nonblock)(OPTION_NONBLOCK),
link(sourceport)(OPTION_SOURCEPORT),
link(retry)(OPTION_RETRY),
link(readbytes)(OPTION_READBYTES)nl()
See also:
link(SCTP4-CONNECT)(ADDRESS_SCTP4_CONNECT),
link(SCTP6-CONNECT)(ADDRESS_SCTP6_CONNECT),
link(SCTP-LISTEN)(ADDRESS_SCTP_LISTEN),
link(TCP-CONNECT)(ADDRESS_TCP_CONNECT)
label(ADDRESS_SCTP4_CONNECT)dit(bf(tt(SCTP4-CONNECT::)))
Like link(SCTP-CONNECT)(ADDRESS_SCTP_CONNECT), but only supports IPv4 protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(SCTP)(GROUP_SCTP),link(CHILD)(GROUP_CHILD),link(RETRY)(GROUP_RETRY) nl()
label(ADDRESS_SCTP6_CONNECT)dit(bf(tt(SCTP6-CONNECT::)))
Like link(SCTP-CONNECT)(ADDRESS_SCTP_CONNECT), but only supports IPv6 protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP6)(GROUP_IP6),link(SCTP)(GROUP_SCTP),link(CHILD)(GROUP_CHILD),link(RETRY)(GROUP_RETRY) nl()
label(ADDRESS_SCTP_LISTEN)dit(bf(tt(SCTP-LISTEN:)))
Listens on [link(TCP service)(TYPE_TCP_SERVICE)] and accepts an
SCTP connection. The IP version is 4 or the one specified with
address option link(pf)(OPTION_PROTOCOL_FAMILY), socat option
(link(-4)(option_4), link(-6)(option_6)), or environment variable link(SOCAT_DEFAULT_LISTEN_IP)(ENV_SOCAT_DEFAULT_LISTEN_IP).
Note that opening
this address usually blocks until a client connects.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(LISTEN)(GROUP_LISTEN),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),link(SCTP)(GROUP_SCTP),link(RETRY)(GROUP_RETRY) nl()
Useful options:
link(crnl)(OPTION_CRNL),
link(fork)(OPTION_FORK),
link(bind)(OPTION_BIND),
link(range)(OPTION_RANGE),
link(tcpwrap)(OPTION_TCPWRAPPERS),
link(pf)(OPTION_PROTOCOL_FAMILY),
link(max-children)(OPTION_MAX_CHILDREN),
link(backlog)(OPTION_BACKLOG),
link(accept-timeout)(OPTION_ACCEPT_TIMEOUT),
link(sctp-maxseg)(OPTION_SCTP_MAXSEG),
link(sctp-nodelay)(OPTION_SCTP_NODELAY),
link(su)(OPTION_SUBSTUSER),
link(reuseaddr)(OPTION_SO_REUSEADDR),
link(retry)(OPTION_RETRY)nl()
See also:
link(SCTP4-LISTEN)(ADDRESS_SCTP4_LISTEN),
link(SCTP6-LISTEN)(ADDRESS_SCTP6_LISTEN),
link(TCP-LISTEN)(ADDRESS_TCP_LISTEN),
link(SCTP-CONNECT)(ADDRESS_SCTP_CONNECT)
label(ADDRESS_SCTP4_LISTEN)dit(bf(tt(SCTP4-LISTEN:)))
Like link(SCTP-LISTEN)(ADDRESS_SCTP_LISTEN), but only supports IPv4
protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(LISTEN)(GROUP_LISTEN),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE),link(IP4)(GROUP_IP4),link(SCTP)(GROUP_SCTP),link(RETRY)(GROUP_RETRY) nl()
label(ADDRESS_SCTP6_LISTEN)dit(bf(tt(SCTP6-LISTEN:)))
Like link(SCTP-LISTEN)(ADDRESS_SCTP_LISTEN), but only supports IPv6
protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(LISTEN)(GROUP_LISTEN),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE),link(IP6)(GROUP_IP6),link(SCTP)(GROUP_SCTP),link(RETRY)(GROUP_RETRY) nl()
label(ADDRESS_SOCKET_CONNECT)dit(bf(tt(SOCKET-CONNECT:::)))
Creates a stream socket using the first and second given socket parameters
and tt(SOCK_STREAM) (see man NOEXPAND(socket(2))) and connects to the remote-address.
The two socket parameters have to be specified by link(int)(TYPE_INT)
numbers. Consult your OS documentation and include files to find the
appropriate values. The remote-address must be the link(data)(TYPE_DATA)
representation of a sockaddr structure without sa_family and (BSD) sa_len
components.nl()
Please note that you can - beyond the options of the specified groups - also
use options of higher level protocols when you apply socat option
link(-g)(option_g).nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(CHILD)(GROUP_CHILD),link(RETRY)(GROUP_RETRY)nl()
Useful options:
link(bind)(OPTION_BIND),
link(setsockopt)(OPTION_SETSOCKOPT),
nl()
See also:
link(TCP)(ADDRESS_TCP_CONNECT),
link(UDP-CONNECT)(ADDRESS_UDP_CONNECT),
link(UNIX-CONNECT)(ADDRESS_UNIX_CONNECT),
link(SOCKET-LISTEN)(ADDRESS_SOCKET_LISTEN),
link(SOCKET-SENDTO)(ADDRESS_SOCKET_SENDTO)
label(ADDRESS_SOCKET_DATAGRAM)dit(bf(tt(SOCKET-DATAGRAM::::)))
Creates a datagram socket using the first three given socket parameters (see
man NOEXPAND(socket(2))) and sends outgoing data to the remote-address. The three
socket parameters have to be specified by link(int)(TYPE_INT)
numbers. Consult your OS documentation and include files to find the
appropriate values. The remote-address must be the link(data)(TYPE_DATA)
representation of a sockaddr structure without sa_family and (BSD) sa_len
components.nl()
Please note that you can - beyond the options of the specified groups - also
use options of higher level protocols when you apply socat option
link(-g)(option_g).nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(RANGE)(GROUP_RANGE)nl()
Useful options:
link(bind)(OPTION_BIND),
link(range)(OPTION_RANGE),
link(setsockopt)(OPTION_SETSOCKOPT),
nl()
See also:
link(UDP-DATAGRAM)(ADDRESS_UDP_DATAGRAM),
link(IP-DATAGRAM)(ADDRESS_IP_DATAGRAM),
link(SOCKET-SENDTO)(ADDRESS_SOCKET_SENDTO),
link(SOCKET-RECV)(ADDRESS_SOCKET_RECV),
link(SOCKET-RECVFROM)(ADDRESS_SOCKET_RECVFROM)
label(ADDRESS_SOCKET_LISTEN)dit(bf(tt(SOCKET-LISTEN:::)))
Creates a stream socket using the first and second given socket parameters
and tt(SOCK_STREAM) (see man NOEXPAND(socket(2))) and waits for incoming connections
on local-address. The two socket parameters have to be specified by
link(int)(TYPE_INT) numbers. Consult your OS documentation and include files
to find the appropriate values. The local-address must be the
link(data)(TYPE_DATA) representation of a sockaddr structure without
sa_family and (BSD) sa_len components.nl()
Please note that you can - beyond the options of the specified groups - also
use options of higher level protocols when you apply socat option
link(-g)(option_g).nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(LISTEN)(GROUP_LISTEN),link(RANGE)(GROUP_RANGE),link(CHILD)(GROUP_CHILD),link(RETRY)(GROUP_RETRY)nl()
Useful options:
link(setsockopt)(OPTION_SETSOCKOPT),
link(setsockopt-listen)(OPTION_SETSOCKOPT_LISTEN),
nl()
See also:
link(TCP)(ADDRESS_TCP_LISTEN),
link(UDP-CONNECT)(ADDRESS_UDP_LISTEN),
link(UNIX-CONNECT)(ADDRESS_UNIX_LISTEN),
link(SOCKET-LISTEN)(ADDRESS_SOCKET_CONNECT),
link(SOCKET-SENDTO)(ADDRESS_SOCKET_RECVFROM),
link(SOCKET-SENDTO)(ADDRESS_SOCKET_RECV)
label(ADDRESS_SOCKET_RECV)dit(bf(tt(SOCKET-RECV::::)))
Creates a socket using the three given socket parameters (see man NOEXPAND(socket(2)))
and binds it to . Receives arriving data. The three
parameters have to be specified by link(int)(TYPE_INT) numbers. Consult your
OS documentation and include files to find the appropriate values. The
local-address must be the link(data)(TYPE_DATA) representation of a sockaddr
structure without sa_family and (BSD) sa_len components.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(RANGE)(GROUP_RANGE)nl()
Useful options:
link(range)(OPTION_RANGE),
link(setsockopt)(OPTION_SETSOCKOPT),
link(setsockopt-listen)(OPTION_SETSOCKOPT_LISTEN)
nl()
See also:
link(UDP-RECV)(ADDRESS_UDP_RECV),
link(IP-RECV)(ADDRESS_IP_RECV),
link(UNIX-RECV)(ADDRESS_UNIX_RECV),
link(SOCKET-DATAGRAM)(ADDRESS_SOCKET_DATAGRAM),
link(SOCKET-SENDTO)(ADDRESS_SOCKET_SENDTO),
link(SOCKET-RECVFROM)(ADDRESS_SOCKET_RECVFROM)
label(ADDRESS_SOCKET_RECVFROM)dit(bf(tt(SOCKET-RECVFROM::::)))
Creates a socket using the three given socket parameters (see man NOEXPAND(socket(2)))
and binds it to . Receives arriving data and sends replies
back to the sender. The first three parameters have to be specified as
link(int)(TYPE_INT) numbers. Consult your OS documentation and include files
to find the appropriate values. The local-address must be the
link(data)(TYPE_DATA) representation of a sockaddr structure without
sa_family and (BSD) sa_len components.nl()
See the link(note about RECVFROM addresses)(NOTE_RECVFROM).nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE)nl()
Useful options:
link(fork)(OPTION_FORK),
link(range)(OPTION_RANGE),
link(setsockopt)(OPTION_SETSOCKOPT),
link(setsockopt-listen)(OPTION_SETSOCKOPT_LISTEN)
nl()
See also:
link(UDP-RECVFROM)(ADDRESS_UDP_RECVFROM),
link(IP-RECVFROM)(ADDRESS_IP_RECVFROM),
link(UNIX-RECVFROM)(ADDRESS_UNIX_RECVFROM),
link(SOCKET-DATAGRAM)(ADDRESS_SOCKET_DATAGRAM),
link(SOCKET-SENDTO)(ADDRESS_SOCKET_SENDTO),
link(SOCKET-RECV)(ADDRESS_SOCKET_RECV)
label(ADDRESS_SOCKET_SENDTO)dit(bf(tt(SOCKET-SENDTO::::)))
Creates a socket using the three given socket parameters (see man
NOEXPAND(socket(2))). Sends outgoing data to the given address and receives replies.
The three parameters have to be specified as link(int)(TYPE_INT)
numbers. Consult your OS documentation and include files to find the
appropriate values. The remote-address must be the link(data)(TYPE_DATA)
representation of a sockaddr structure without sa_family and (BSD) sa_len
components.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET)nl()
Useful options:
link(bind)(OPTION_BIND),
link(setsockopt)(OPTION_SETSOCKOPT),
link(setsockopt-listen)(OPTION_SETSOCKOPT_LISTEN)
nl()
See also:
link(UDP-SENDTO)(ADDRESS_UDP_SENDTO),
link(IP-SENDTO)(ADDRESS_IP_SENDTO),
link(UNIX-SENDTO)(ADDRESS_UNIX_SENDTO),
link(SOCKET-DATAGRAM)(ADDRESS_SOCKET_DATAGRAM),
link(SOCKET-RECV)(ADDRESS_SOCKET_RECV)
link(SOCKET-RECVFROM)(ADDRESS_SOCKET_RECVFROM)
label(ADDRESS_ACCEPT_FD)dit(bf(tt(ACCEPT-FD:)))
Expects a listening socket in and accepts one or (with option
link(fork)(OPTION_FORK)) more connections. This address type is useful under
systemd control with "inetd mode".nl()
Example: (link(example)(EXAMPLE_ADDRESS_ACCEPT_FD))nl()
Option groups: link(FD)(GROUP_FD), link(SOCKET)(GROUP_SOCKET), link(TCP)(GROUP_TCP), link(CHILD)(GROUP_CHILD), link(RETRY)(GROUP_RETRY)nl()
Useful options:
link(fork)(OPTION_FORK),
link(range)(OPTION_RANGE),
link(sourceport)(OPTION_SOURCEPORT),
link(lowport)(OPTION_LOWPORT),
link(tcpwrap)(OPTION_TCPWRAPPERS)
label(ADDRESS_SOCKS4)dit(bf(tt(SOCKS4:::)))
Connects via [link(IP address)(TYPE_IP_ADDRESS)]
to [link(IPv4 address)(TYPE_IPV4_ADDRESS)]
on [link(TCP service)(TYPE_TCP_SERVICE)],
using socks version 4 protocol over IP version 4 or 6 depending on address specification, name resolution, or option
link(pf)(OPTION_PROTOCOL_FAMILY) (link(example)(EXAMPLE_ADDRESS_SOCKS4)).nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),link(TCP)(GROUP_TCP),link(SOCKS4)(GROUP_SOCKS),link(RETRY)(GROUP_RETRY) nl()
Useful options:
link(socksuser)(OPTION_SOCKSUSER),
link(socksport)(OPTION_SOCKSPORT),
link(sourceport)(OPTION_SOURCEPORT),
link(pf)(OPTION_PROTOCOL_FAMILY),
link(retry)(OPTION_RETRY)nl()
See also:
link(SOCKS5)(ADDRESS_SOCKS5_CONNECT),
link(SOCKS4A)(ADDRESS_SOCKS4A),
link(PROXY)(ADDRESS_PROXY_CONNECT),
link(TCP)(ADDRESS_TCP_CONNECT)
label(ADDRESS_SOCKS4A)dit(bf(tt(SOCKS4A:::)))
like link(SOCKS4)(ADDRESS_SOCKS4), but uses socks protocol version 4a, thus
leaving host name resolution to the socks server.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),link(TCP)(GROUP_TCP),link(SOCKS4)(GROUP_SOCKS),link(RETRY)(GROUP_RETRY) nl()
label(ADDRESS_SOCKS5_CONNECT)dit(bf(tt(SOCKS5-CONNECT::::)))
Connects via [link(IP address)(TYPE_IP_ADDRESS)]
to [link(IPv4 address)(TYPE_IPV4_ADDRESS)]
on [link(TCP service)(TYPE_TCP_SERVICE)],
using socks version 5 protocol over TCP. Currently no authentication mechanism is provided.nl()
This address type is experimental.nl()
Option groups: link(FD)(GROUP_FD), link(SOCKET)(GROUP_SOCKET), link(IP4)(GROUP_IP4), link(IP6)(GROUP_IP6), link(TCP)(GROUP_TCP), link(CHILD)(GROUP_CHILD), link(RETRY)(GROUP_RETRY)nl()
Useful options:
link(sourceport)(OPTION_SOURCEPORT),
link(pf)(OPTION_PROTOCOL_FAMILY),
link(retry)(OPTION_RETRY)nl()
See also:
link(SOCKS5-LISTEN)(ADDRESS_SOCKS5_LISTEN),
link(SOCKS4)(ADDRESS_SOCKS4),
link(SOCKS4A)(ADDRESS_SOCKS4A),
link(PROXY)(ADDRESS_PROXY_CONNECT),
link(TCP)(ADDRESS_TCP_CONNECT)
label(ADDRESS_SOCKS5_LISTEN)dit(bf(tt(SOCKS5-LISTEN::::)))
Connects to [link(IP address)(TYPE_IP_ADDRESS)]
using socks version 5 protocol over TCP
and makes it listen for incoming connections on [link(TCP service)(TYPE_TCP_SERVICE)], binding to <-listen-host> [link(IPv4 address)(TYPE_IPV4_ADDRESS)]
Currently not authentication mechanism is provided. This address type is experimental.
Option groups: link(FD)(GROUP_FD), link(SOCKET)(GROUP_SOCKET), link(IP4)(GROUP_IP4), link(IP6)(GROUP_IP6), link(TCP)(GROUP_TCP), link(CHILD)(GROUP_CHILD), link(RETRY)(GROUP_RETRY)nl()
Useful options:
link(sourceport)(OPTION_SOURCEPORT),
link(pf)(OPTION_PROTOCOL_FAMILY),
link(retry)(OPTION_RETRY)nl()
See also:
link(SOCKS5-CONNECT)(ADDRESS_SOCKS5_CONNECT),
label(ADDRESS_STDERR)dit(bf(tt(STDERR)))
Uses file descriptor 2.nl()
This is a write-only address, see options link(-u)(option_u) and
link(-U)(option_U), and link(dual addresses)(ADDRESS_DUAL).nl()
Option groups: link(FD)(GROUP_FD) (link(TERMIOS)(GROUP_TERMIOS),link(REG)(GROUP_REG),link(SOCKET)(GROUP_SOCKET)) nl()
See also: link(FD)(ADDRESS_FD)
label(ADDRESS_STDIN)dit(bf(tt(STDIN)))
Uses file descriptor 0.nl()
This is a read-only address, see options link(-u)(option_u) and
link(-U)(option_U), and link(dual addresses)(ADDRESS_DUAL).nl()
Option groups: link(FD)(GROUP_FD) (link(TERMIOS)(GROUP_TERMIOS),link(REG)(GROUP_REG),link(SOCKET)(GROUP_SOCKET)) nl()
Useful options:
link(readbytes)(OPTION_READBYTES)nl()
See also: link(FD)(ADDRESS_FD)
label(ADDRESS_STDIO)dit(bf(tt(STDIO)))
Uses file descriptor 0 for reading, and 1 for writing.nl()
Option groups: link(FD)(GROUP_FD) (link(TERMIOS)(GROUP_TERMIOS),link(REG)(GROUP_REG),link(SOCKET)(GROUP_SOCKET)) nl()
Useful options:
link(readbytes)(OPTION_READBYTES)nl()
See also: link(FD)(ADDRESS_FD)
label(ADDRESS_STDOUT)dit(bf(tt(STDOUT)))
Uses file descriptor 1.nl()
This is a write-only address, see options link(-u)(option_u) and
link(-U)(option_U), and link(dual addresses)(ADDRESS_DUAL).nl()
Option groups: link(FD)(GROUP_FD) (link(TERMIOS)(GROUP_TERMIOS),link(REG)(GROUP_REG),link(SOCKET)(GROUP_SOCKET)) nl()
See also: link(FD)(ADDRESS_FD)
label(ADDRESS_SHELL)dit(bf(tt(SHELL:)))
Forks a sub process that establishes communication with its parent process
and invokes the specified program with the configured shell ($SHELL).
Note that [link(string)(TYPE_STRING)] must
not contain ',' or "!!", and that shell meta characters may have to be
protected.
After successful program start, socat() writes data to stdin of the
process and reads from its stdout.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(EXEC)(GROUP_EXEC),link(FORK)(GROUP_FORK),link(TERMIOS)(GROUP_TERMIOS) nl()
Useful options:
link(path)(OPTION_PATH),
link(fdin)(OPTION_FDIN),
link(fdout)(OPTION_FDOUT),
link(chroot)(OPTION_CHROOT),
link(su)(OPTION_SUBSTUSER),
link(su-d)(OPTION_SUBSTUSER_DELAYED),
link(nofork)(OPTION_NOFORK),
link(socktype)(OPTION_SO_TYPE),
link(pty)(OPTION_PTY),
link(stderr)(OPTION_STDERR),
link(ctty)(OPTION_CTTY),
link(setsid)(OPTION_SETSID),
link(pipes)(OPTION_PIPES),
link(umask)(OPTION_UMASK),
link(sigint)(OPTION_SIGINT),
link(sigquit)(OPTION_SIGQUIT)nl()
See also: link(EXEC)(ADDRESS_EXEC), link(SYSTEM)(ADDRESS_SYSTEM)
label(ADDRESS_SYSTEM)dit(bf(tt(SYSTEM:)))
Forks a sub process that establishes communication with its parent process
and invokes the specified program with code(system()). Please note that
[link(string)(TYPE_STRING)] must
not contain ',' or "!!", and that shell meta characters may have to be
protected.
After successful program start, socat() writes data to stdin of the
process and reads from its stdout.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(EXEC)(GROUP_EXEC),link(FORK)(GROUP_FORK),link(TERMIOS)(GROUP_TERMIOS) nl()
Useful options:
link(path)(OPTION_PATH),
link(fdin)(OPTION_FDIN),
link(fdout)(OPTION_FDOUT),
link(chroot)(OPTION_CHROOT),
link(su)(OPTION_SUBSTUSER),
link(su-d)(OPTION_SUBSTUSER_DELAYED),
link(nofork)(OPTION_NOFORK),
link(socktype)(OPTION_SO_TYPE),
link(pty)(OPTION_PTY),
link(stderr)(OPTION_STDERR),
link(ctty)(OPTION_CTTY),
link(setsid)(OPTION_SETSID),
link(pipes)(OPTION_PIPES),
link(umask)(OPTION_UMASK),
link(sigint)(OPTION_SIGINT),
link(sigquit)(OPTION_SIGQUIT),
link(netns)(OPTION_NETNS)nl()
See also: link(EXEC)(ADDRESS_EXEC), link(SHELL)(ADDRESS_SHELL)
label(ADDRESS_TCP_CONNECT)dit(bf(tt(TCP::)))
Connects to [link(TCP service)(TYPE_TCP_SERVICE)] on
[link(IP address)(TYPE_IP_ADDRESS)] using TCP/IP version 4 or 6
depending on address specification, name resolution, or option
link(pf)(OPTION_PROTOCOL_FAMILY).nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),link(TCP)(GROUP_TCP),link(RETRY)(GROUP_RETRY) nl()
Useful options:
link(connect-timeout)(OPTION_CONNECT_TIMEOUT),
link(retry)(OPTION_RETRY),
link(sourceport)(OPTION_SOURCEPORT),
link(netns)(OPTION_NETNS),
link(crnl)(OPTION_CRNL),
link(bind)(OPTION_BIND),
link(pf)(OPTION_PROTOCOL_FAMILY),
link(tos)(OPTION_TOS),
link(mtudiscover)(OPTION_MTUDISCOVER),
link(mss)(OPTION_MSS),
link(nodelay)(OPTION_TCP_NODELAY),
link(nonblock)(OPTION_NONBLOCK),
link(readbytes)(OPTION_READBYTES)nl()
See also:
link(TCP4)(ADDRESS_TCP4_CONNECT),
link(TCP6)(ADDRESS_TCP6_CONNECT),
link(TCP-LISTEN)(ADDRESS_TCP_LISTEN),
link(UDP)(ADDRESS_UDP_CONNECT),
link(SCTP-CONNECT)(ADDRESS_SCTP_CONNECT),
link(UNIX-CONNECT)(ADDRESS_UNIX_CONNECT)
label(ADDRESS_TCP4_CONNECT)dit(bf(tt(TCP4::)))
Like link(TCP)(ADDRESS_TCP_CONNECT), but only supports IPv4 protocol (link(example)(EXAMPLE_ADDRESS_TCP4_CONNECT)).nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(TCP)(GROUP_TCP),link(RETRY)(GROUP_RETRY) nl()
label(ADDRESS_TCP6_CONNECT)dit(bf(tt(TCP6::)))
Like link(TCP)(ADDRESS_TCP_CONNECT), but only supports IPv6 protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP6)(GROUP_IP6),link(TCP)(GROUP_TCP),link(RETRY)(GROUP_RETRY) nl()
label(ADDRESS_TCP_LISTEN)dit(bf(tt(TCP-LISTEN:)))
Listens on [link(TCP service)(TYPE_TCP_SERVICE)] and accepts a
TCP/IP connection. The IP version is 4 or the one specified with
address option link(pf)(OPTION_PROTOCOL_FAMILY), socat option
(link(-4)(option_4), link(-6)(option_6)), or environment variable link(SOCAT_DEFAULT_LISTEN_IP)(ENV_SOCAT_DEFAULT_LISTEN_IP).
Note that opening
this address usually blocks until a client connects.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(LISTEN)(GROUP_LISTEN),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),link(TCP)(GROUP_TCP),link(RETRY)(GROUP_RETRY) nl()
Useful options:
link(crnl)(OPTION_CRNL),
link(fork)(OPTION_FORK),
link(bind)(OPTION_BIND),
link(range)(OPTION_RANGE),
link(tcpwrap)(OPTION_TCPWRAPPERS),
link(pf)(OPTION_PROTOCOL_FAMILY),
link(max-children)(OPTION_MAX_CHILDREN),
link(backlog)(OPTION_BACKLOG),
link(accept-timeout)(OPTION_ACCEPT_TIMEOUT),
link(mss)(OPTION_MSS),
link(su)(OPTION_SUBSTUSER),
link(reuseaddr)(OPTION_SO_REUSEADDR),
link(retry)(OPTION_RETRY),
link(cool-write)(OPTION_COOL_WRITE)nl()
See also:
link(TCP4-LISTEN)(ADDRESS_TCP4_LISTEN),
link(TCP6-LISTEN)(ADDRESS_TCP6_LISTEN),
link(UDP-LISTEN)(ADDRESS_UDP_LISTEN),
link(SCTP-LISTEN)(ADDRESS_SCTP_LISTEN),
link(UNIX-LISTEN)(ADDRESS_UNIX_LISTEN),
link(OPENSSL-LISTEN)(ADDRESS_OPENSSL_LISTEN),
link(TCP-CONNECT)(ADDRESS_TCP_CONNECT)
label(ADDRESS_TCP4_LISTEN)dit(bf(tt(TCP4-LISTEN:)))
Like link(TCP-LISTEN)(ADDRESS_TCP_LISTEN), but only supports IPv4
protocol (link(example)(EXAMPLE_ADDRESS_TCP4_LISTEN)).nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(LISTEN)(GROUP_LISTEN),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE),link(IP4)(GROUP_IP4),link(TCP)(GROUP_TCP),link(RETRY)(GROUP_RETRY) nl()
label(ADDRESS_TCP6_LISTEN)dit(bf(tt(TCP6-LISTEN:)))
Like link(TCP-LISTEN)(ADDRESS_TCP_LISTEN), but only supports IPv6
protocol.nl()
Additional useful option:
link(ipv6only)(OPTION_IPV6_V6ONLY)nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(LISTEN)(GROUP_LISTEN),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE),link(IP6)(GROUP_IP6),link(TCP)(GROUP_TCP),link(RETRY)(GROUP_RETRY) nl()
label(ADDRESS_TUN)dit(bf(tt(TUN[:/])))
Creates a Linux TUN/TAP device and optionally assignes it the address and
netmask given by the parameters. The resulting network interface is almost
ready for use by other processes; socat serves its "wire side". This address
requires read and write access to the tunnel cloning device, usually
code(/dev/net/tun), as well as permission to set some tt(ioctl()s).
bf(Option iff-up is required to immediately activate the interface!)nl()
Note: If you intend to transfer packets between two Socat "wire sides" you
need a protocol that keeps packet boundaries, e.g.UDP; TCP might work with
option link(nodelay)(OPTION_TCP_NODELAY).nl()
Option groups: link(FD)(GROUP_FD),link(NAMED)(GROUP_NAMED),link(OPEN)(GROUP_OPEN),link(TUN)(GROUP_INTERFACE) nl()
Useful options:
link(iff-up)(OPTION_IFF_UP),
link(tun-device)(OPTION_TUN_DEVICE),
link(tun-name)(OPTION_TUN_NAME),
link(tun-type)(OPTION_TUN_TYPE),
link(iff-no-pi)(OPTION_IFF_NO_PI),
link(netns)(OPTION_NETNS)nl()
See also:
link(ip-recv)(ADDRESS_IP_RECV)
label(ADDRESSES_UDP)
label(ADDRESS_UDP_CONNECT)dit(bf(tt(UDP::)))
Connects to [link(UDP service)(TYPE_UDP_SERVICE)] on
[link(IP address)(TYPE_IP_ADDRESS)] using UDP/IP version 4 or 6
depending on address specification, name resolution, or option
link(pf)(OPTION_PROTOCOL_FAMILY).nl()
Please note that,
due to UDP protocol properties, no real connection is established; data has
to be sent for `connecting' to the server, and no end-of-file condition can
be transported.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6) nl()
Useful options:
link(ttl)(OPTION_TTL),
link(tos)(OPTION_TOS),
link(bind)(OPTION_BIND),
link(sourceport)(OPTION_SOURCEPORT),
link(pf)(OPTION_PROTOCOL_FAMILY)nl()
See also:
link(UDP4)(ADDRESS_UDP4_CONNECT),
link(UDP6)(ADDRESS_UDP6_CONNECT),
link(UDP-LISTEN)(ADDRESS_UDP_LISTEN),
link(TCP)(ADDRESS_TCP_CONNECT),
link(IP)(ADDRESS_IP_SENDTO)
label(ADDRESS_UDP4_CONNECT)dit(bf(tt(UDP4::)))
Like link(UDP)(ADDRESS_UDP_CONNECT), but only supports IPv4 protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4) nl()
label(ADDRESS_UDP6_CONNECT)dit(bf(tt(UDP6::)))
Like link(UDP)(ADDRESS_UDP_CONNECT), but only supports IPv6 protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP6)(GROUP_IP6) nl()
label(ADDRESS_UDP_DATAGRAM)dit(bf(tt(UDP-DATAGRAM::)))
Sends outgoing data to the specified address which may in particular be a
broadcast or multicast address. Packets arriving on the local socket are
checked for the correct remote port only when option link(sourceport)(OPTION_SOURCEPORT) is used (this is a change with Socat() version 1.7.4.0) and if their source addresses match
link(RANGE)(OPTION_RANGE) or link(TCPWRAP)(OPTION_TCPWRAPPERS)
options. This address type can for example be used for implementing
symmetric or asymmetric broadcast or multicast communications.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),link(RANGE)(GROUP_RANGE) nl()
Useful options:
link(bind)(OPTION_BIND),
link(range)(OPTION_RANGE),
link(tcpwrap)(OPTION_TCPWRAPPERS),
link(broadcast)(OPTION_SO_BROADCAST),
link(ip-multicast-loop)(OPTION_IP_MULTICAST_LOOP),
link(ip-multicast-ttl)(OPTION_IP_MULTICAST_TTL),
link(ip-multicast-if)(OPTION_IP_MULTICAST_IF),
link(ip-add-membership)(OPTION_IP_ADD_MEMBERSHIP),
link(ip-add-source-membership)(OPTION_IP_ADD_SOURCE_MEMBERSHIP),
link(ipv6-join-group)(OPTION_IPV6_JOIN_GROUP),
link(ipv6-join-source-group)(OPTION_IPV6_JOIN_SOURCE_GROUP),
link(ttl)(OPTION_TTL),
link(tos)(OPTION_TOS),
link(sourceport)(OPTION_SOURCEPORT),
link(pf)(OPTION_PROTOCOL_FAMILY)nl()
See also:
link(UDP4-DATAGRAM)(ADDRESS_UDP4_DATAGRAM),
link(UDP6-DATAGRAM)(ADDRESS_UDP6_DATAGRAM),
link(UDP-SENDTO)(ADDRESS_UDP_SENDTO),
link(UDP-RECVFROM)(ADDRESS_UDP_RECVFROM),
link(UDP-RECV)(ADDRESS_UDP_RECV),
link(UDP-CONNECT)(ADDRESS_UDP_CONNECT),
link(UDP-LISTEN)(ADDRESS_UDP_LISTEN),
link(IP-DATAGRAM)(ADDRESS_IP_DATAGRAM)
label(ADDRESS_UDP4_DATAGRAM)dit(bf(tt(UDP4-DATAGRAM::)))
Like link(UDP-DATAGRAM)(ADDRESS_UDP_DATAGRAM), but only supports IPv4
protocol (link(example1)(EXAMPLE_ADDRESS_UDP4_BROADCAST_CLIENT),
link(example2)(EXAMPLE_ADDRESS_UDP4_MULTICAST)).nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4), link(RANGE)(GROUP_RANGE)
label(ADDRESS_UDP6_DATAGRAM)dit(bf(tt(UDP6-DATAGRAM::)))
Like link(UDP-DATAGRAM)(ADDRESS_UDP_DATAGRAM), but only supports IPv6
protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP6)(GROUP_IP6),link(RANGE)(GROUP_RANGE)
label(ADDRESS_UDP_LISTEN)dit(bf(tt(UDP-LISTEN:)))
Waits for a UDP/IP packet arriving on
[link(UDP service)(TYPE_UDP_SERVICE)] and `connects' back to sender.
The accepted IP version is 4 or the one specified with option
link(pf)(OPTION_PROTOCOL_FAMILY).
Please note that,
due to UDP protocol properties, no real connection is established; data has
to arrive from the peer first, and no end-of-file condition can be
transported. Note that opening
this address usually blocks until a client connects.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(LISTEN)(GROUP_LISTEN),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6) nl()
Useful options:
link(fork)(OPTION_FORK),
link(bind)(OPTION_BIND),
link(range)(OPTION_RANGE),
link(pf)(OPTION_PROTOCOL_FAMILY) nl()
See also:
link(UDP)(ADDRESS_UDP_CONNECT),
link(UDP4-LISTEN)(ADDRESS_UDP4_LISTEN),
link(UDP6-LISTEN)(ADDRESS_UDP6_LISTEN),
link(TCP-LISTEN)(ADDRESS_TCP_LISTEN)
label(ADDRESS_UDP4_LISTEN)dit(bf(tt(UDP4-LISTEN:)))
Like link(UDP-LISTEN)(ADDRESS_UDP_LISTEN), but only support IPv4
protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(LISTEN)(GROUP_LISTEN),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE),link(IP4)(GROUP_IP4) nl()
label(ADDRESS_UDP6_LISTEN)dit(bf(tt(UDP6-LISTEN:)))
Like link(UDP-LISTEN)(ADDRESS_UDP_LISTEN), but only support IPv6
protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(LISTEN)(GROUP_LISTEN),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE),link(IP6)(GROUP_IP6) nl()
label(ADDRESS_UDP_SENDTO)dit(bf(tt(UDP-SENDTO::)))
Communicates with the specified peer socket, defined by [link(UDP
service)(TYPE_UDP_SERVICE)] on
[link(IP address)(TYPE_IP_ADDRESS)], using UDP/IP version 4 or 6
depending on address specification, name resolution, or option
link(pf)(OPTION_PROTOCOL_FAMILY). It sends packets to and receives packets
from that peer socket only.
This address effectively implements a datagram client.
It works well with socat UDP-RECVFROM and UDP-RECV address peers.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6) nl()
Useful options:
link(ttl)(OPTION_TTL),
link(tos)(OPTION_TOS),
link(bind)(OPTION_BIND),
link(sourceport)(OPTION_SOURCEPORT),
link(pf)(OPTION_PROTOCOL_FAMILY)nl()
See also:
link(UDP4-SENDTO)(ADDRESS_UDP4_SENDTO),
link(UDP6-SENDTO)(ADDRESS_UDP6_SENDTO),
link(UDP-RECVFROM)(ADDRESS_UDP_RECVFROM),
link(UDP-RECV)(ADDRESS_UDP_RECV),
link(UDP-CONNECT)(ADDRESS_UDP_CONNECT),
link(UDP-LISTEN)(ADDRESS_UDP_LISTEN),
link(IP-SENDTO)(ADDRESS_IP_SENDTO)
label(ADDRESS_UDP4_SENDTO)dit(bf(tt(UDP4-SENDTO::)))
Like link(UDP-SENDTO)(ADDRESS_UDP_SENDTO), but only supports IPv4
protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4)
label(ADDRESS_UDP6_SENDTO)dit(bf(tt(UDP6-SENDTO::)))
Like link(UDP-SENDTO)(ADDRESS_UDP_SENDTO), but only supports IPv6
protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP6)(GROUP_IP6)
label(ADDRESS_UDP_RECVFROM)dit(bf(tt(UDP-RECVFROM:)))
Creates a UDP socket on [link(UDP service)(TYPE_UDP_SERVICE)] using
UDP/IP version 4 or 6
depending on option link(pf)(OPTION_PROTOCOL_FAMILY).
It receives one packet from an unspecified peer and may send one or more
answer packets to that peer. This mode is particularly useful with
link(fork)(OPTION_FORK) option
where each arriving packet - from arbitrary peers - is handled by its own sub
process. This allows a behaviour similar to typical UDP based servers like ntpd
or named. This address works well with socat UDP-SENDTO address peers.nl()
label(NOTE_RECVFROM)Note: When the second address fails before entering the transfer loop the
packet is dropped. Use option link(retry)(OPTION_RETRY) or
link(forever)(OPTION_FOREVER) on the second address to avoid data loss.
nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE) nl()
Useful options:
link(fork)(OPTION_FORK),
link(ttl)(OPTION_TTL),
link(tos)(OPTION_TOS),
link(bind)(OPTION_BIND),
link(sourceport)(OPTION_SOURCEPORT),
link(pf)(OPTION_PROTOCOL_FAMILY)nl()
See also:
link(UDP4-RECVFROM)(ADDRESS_UDP4_RECVFROM),
link(UDP6-RECVFROM)(ADDRESS_UDP6_RECVFROM),
link(UDP-SENDTO)(ADDRESS_UDP_SENDTO),
link(UDP-RECV)(ADDRESS_UDP_RECV),
link(UDP-CONNECT)(ADDRESS_UDP_CONNECT),
link(UDP-LISTEN)(ADDRESS_UDP_LISTEN),
link(IP-RECVFROM)(ADDRESS_IP_RECVFROM),
link(UNIX-RECVFROM)(ADDRESS_UNIX_RECVFROM)
label(ADDRESS_UDP4_RECVFROM)dit(bf(tt(UDP4-RECVFROM:)))
Like link(UDP-RECVFROM)(ADDRESS_UDP_RECVFROM), but only supports IPv4 protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE)
label(ADDRESS_UDP6_RECVFROM)dit(bf(tt(UDP6-RECVFROM:)))
Like link(UDP-RECVFROM)(ADDRESS_UDP_RECVFROM), but only supports IPv6 protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP6)(GROUP_IP6),link(CHILD)(GROUP_CHILD),link(RANGE)(GROUP_RANGE)
label(ADDRESS_UDP_RECV)dit(bf(tt(UDP-RECV:)))
Creates a UDP socket on [link(UDP service)(TYPE_UDP_SERVICE)] using UDP/IP version 4 or 6
depending on option link(pf)(OPTION_PROTOCOL_FAMILY).
It receives packets from multiple unspecified peers and merges the data.
No replies are possible. It works well with, e.g., socat
link(UDP-SENDTO)(ADDRESS_UDP_SENDTO) address peers; it behaves similar to a
syslog server.nl()
This is a read-only address, see options link(-u)(option_u) and
link(-U)(option_U), and link(dual addresses)(ADDRESS_DUAL).nl()
Note: if you need the link(fork)(OPTION_FORK) option, use link(UDP-RECVFROM)(ADDRESS_UDP_RECVFROM) in unidirectional mode (with link(option -u)(option_u)) instead.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(IP6)(GROUP_IP6),link(RANGE)(GROUP_RANGE) nl()
Useful options:
link(pf)(OPTION_PROTOCOL_FAMILY),
link(bind)(OPTION_BIND),
link(sourceport)(OPTION_SOURCEPORT),
link(ttl)(OPTION_TTL),
link(tos)(OPTION_TOS)nl()
See also:
link(UDP4-RECV)(ADDRESS_UDP4_RECV),
link(UDP6-RECV)(ADDRESS_UDP6_RECV),
link(UDP-SENDTO)(ADDRESS_UDP_SENDTO),
link(UDP-RECVFROM)(ADDRESS_UDP_RECVFROM),
link(UDP-CONNECT)(ADDRESS_UDP_CONNECT),
link(UDP-LISTEN)(ADDRESS_UDP_LISTEN),
link(IP-RECV)(ADDRESS_IP_RECV),
link(UNIX-RECV)(ADDRESS_UNIX_RECV)
label(ADDRESS_UDP4_RECV)dit(bf(tt(UDP4-RECV:)))
Like link(UDP-RECV)(ADDRESS_UDP_RECV), but only supports IPv4 protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP4)(GROUP_IP4),link(RANGE)(GROUP_RANGE)
label(ADDRESS_UDP6_RECV)dit(bf(tt(UDP6-RECV:)))
Like link(UDP-RECV)(ADDRESS_UDP_RECV), but only supports IPv6 protocol.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(IP6)(GROUP_IP6),link(RANGE)(GROUP_RANGE)
label(ADDRESS_UDPLITE)
dit(bf(tt(UDPLITE-CONNECT::)))
dit(bf(tt(UDPLITE4-CONNECT::)))
dit(bf(tt(UDPLITE6-CONNECT::)))
dit(bf(tt(UDPLITE-DATAGRAM::)))
dit(bf(tt(UDPLITE4-DATAGRAM::)))
dit(bf(tt(UDPLITE6-DATAGRAM::)))
dit(bf(tt(UDPLITE-LISTEN:)))
dit(bf(tt(UDPLITE4-LISTEN:)))
dit(bf(tt(UDPLITE6-LISTEN:)))
dit(bf(tt(UDPLITE-SENDTO::)))
dit(bf(tt(UDPLITE4-SENDTO::)))
dit(bf(tt(UDPLITE6-SENDTO::)))
dit(bf(tt(UDPLITE-RECVFROM:)))
dit(bf(tt(UDPLITE4-RECVFROM:)))
dit(bf(tt(UDPLITE6-RECVFROM:)))
dit(bf(tt(UDPLITE-RECV:)))
dit(bf(tt(UDPLITE4-RECV:)))
dit(bf(tt(UDPLITE6-RECV:)))
The UDPLITE addresses are almost identical to the related link(UDP addresses)(ADDRESSES_UDP)
but they use UDP-Lite protocol and have the additional link(UDPLITE option
group)(GROUP_UDPLITE).nl()
label(ADDRESS_UNIX_CONNECT)dit(bf(tt(UNIX-CONNECT:)))
Connects to link()(TYPE_FILENAME) assuming it is a unixdomain()
socket.
If does not exist, this is an error;
if is not a unixdomain() socket, this is an error;
if is a unixdomain() socket, but no process is listening, this is
an error.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(NAMED)(GROUP_NAMED),link(RETRY)(GROUP_RETRY),link(UNIX)(GROUP_SOCK_UNIX) nl())
Useful options:
link(bind)(OPTION_BIND)nl()
See also:
link(UNIX-LISTEN)(ADDRESS_UNIX_LISTEN),
link(UNIX-SENDTO)(ADDRESS_UNIX_SENDTO),
link(TCP)(ADDRESS_TCP_CONNECT)
label(ADDRESS_UNIX_LISTEN)dit(bf(tt(UNIX-LISTEN:)))
Listens on link()(TYPE_FILENAME) using a unixdomain() stream
socket and accepts a connection.
If exists and is not a socket, this is an error.
If exists and is a unixdomain() socket, binding to the address
fails (use option link(unlink-early)(OPTION_UNLINK_EARLY)!).
Note that opening this address usually blocks until a client connects.
Beginning with socat version 1.4.3, the file system entry is removed when
this address is closed (but see option link(unlink-close)(OPTION_UNLINK_CLOSE)) (link(example)(EXAMPLE_ADDRESS_UNIX_LISTEN)).nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(NAMED)(GROUP_NAMED),link(LISTEN)(GROUP_LISTEN),link(CHILD)(GROUP_CHILD),link(RETRY)(GROUP_RETRY),link(UNIX)(GROUP_SOCK_UNIX) nl()
Useful options:
link(fork)(OPTION_FORK),
link(umask)(OPTION_UMASK),
link(mode)(OPTION_MODE),
link(user)(OPTION_USER),
link(group)(OPTION_GROUP),
link(unlink-early)(OPTION_UNLINK_EARLY)nl()
See also:
link(UNIX-CONNECT)(ADDRESS_UNIX_CONNECT),
link(UNIX-RECVFROM)(ADDRESS_UNIX_RECVFROM),
link(UNIX-RECV)(ADDRESS_UNIX_RECV),
link(TCP-LISTEN)(ADDRESS_TCP4_LISTEN)
label(ADDRESS_UNIX_SENDTO)dit(bf(tt(UNIX-SENDTO:)))
Communicates with the specified peer socket, defined by [link()(TYPE_FILENAME)] assuming it is a unixdomain() datagram socket.
It sends packets to and receives packets from that peer socket only.
Please note that it might be necessary to link(bind)(OPTION_BIND) the
local socket to an address (e.g. tt(/tmp/sock1), which must not exist
before).
This address type works well with socat UNIX-RECVFROM and UNIX-RECV address
peers.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(NAMED)(GROUP_NAMED),link(UNIX)(GROUP_SOCK_UNIX)nl()
Useful options:
link(bind)(OPTION_BIND)nl()
See also:
link(UNIX-RECVFROM)(ADDRESS_UNIX_RECVFROM),
link(UNIX-RECV)(ADDRESS_UNIX_RECV),
link(UNIX-CONNECT)(ADDRESS_UNIX_CONNECT),
link(UDP-SENDTO)(ADDRESS_UDP_SENDTO),
link(IP-SENDTO)(ADDRESS_IP_SENDTO)
label(ADDRESS_UNIX_RECVFROM)dit(bf(tt(UNIX-RECVFROM:)))
Creates a unixdomain() datagram socket [link()(TYPE_FILENAME)].
Receives one packet and may send one or more answer packets to that peer.
This mode is particularly useful with fork option where each arriving packet - from arbitrary peers - is handled by its own sub process.
This address works well with socat UNIX-SENDTO address peers.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(NAMED)(GROUP_NAMED),link(CHILD)(GROUP_CHILD),link(UNIX)(GROUP_SOCK_UNIX) nl()
See the link(note about RECVFROM addresses)(NOTE_RECVFROM).nl()
Useful options:
link(fork)(OPTION_FORK)nl()
link(umask)(OPTION_UMASK)nl()
See also:
link(UNIX-SENDTO)(ADDRESS_UNIX_SENDTO),
link(UNIX-RECV)(ADDRESS_UNIX_RECV),
link(UNIX-LISTEN)(ADDRESS_UNIX_LISTEN),
link(UDP-RECVFROM)(ADDRESS_UDP_RECVFROM),
link(IP-RECVFROM)(ADDRESS_IP_RECVFROM)
label(ADDRESS_UNIX_RECV)dit(bf(tt(UNIX-RECV:)))
Creates a unixdomain() datagram socket [link()(TYPE_FILENAME)].
Receives packets from multiple unspecified peers and merges the data.
No replies are possible, this is a read-only address, see options link(-u)(option_u) and
link(-U)(option_U), and link(dual addresses)(ADDRESS_DUAL).
It can be, e.g., addressed by socat UNIX-SENDTO address peers.
It behaves similar to a syslog server.nl()
Option groups: link(FD)(GROUP_FD),link(SOCKET)(GROUP_SOCKET),link(NAMED)(GROUP_NAMED),link(UNIX)(GROUP_SOCK_UNIX) nl()
Useful options:
link(umask)(OPTION_UMASK)nl()
See also:
link(UNIX-SENDTO)(ADDRESS_UNIX_SENDTO),
link(UNIX-RECVFROM)(ADDRESS_UNIX_RECVFROM),
link(UNIX-LISTEN)(ADDRESS_UNIX_LISTEN),
link(UDP-RECV)(ADDRESS_UDP_RECV),
link(IP-RECV)(ADDRESS_IP_RECV)
label(ADDRESS_UNIX_CLIENT)dit(bf(tt(UNIX-CLIENT: