COMMENT(source: socat.yo) mailto(socat@dest-unreach.org) def(unix)(0)(UN*X) def(unixdomain)(0)(UNIX domain) def(socat)(0)(bf(socat)) def(Socat)(0)(bf(Socat)) def(filan)(0)(bf(filan)) def(Filan)(0)(bf(Filan)) def(procan)(0)(bf(procan)) def(Procan)(0)(bf(Procan)) manpage(socat)(1)()()() htmlcommand() whenhtml( label(CONTENTS) manpagesection(CONTENTS) link(NAME)(NAME)nl() link(SYNOPSIS)(SYNOPSIS)nl() link(DESCRIPTION)(DESCRIPTION)nl() link(OPTIONS)(OPTIONS)nl() link(ADDRESS SPECIFICATIONS)(ADDRESS_SPECIFICATIONS)nl() link(ADDRESS TYPES)(ADDRESS_TYPES)nl() link(ADDRESS OPTIONS)(ADDRESS_OPTIONS)nl() link(DATA VALUES)(VALUES)nl() link(EXAMPLES)(EXAMPLES)nl() link(DIAGNOSTICS)(DIAGNOSTICS)nl() link(FILES)(FILES)nl() link(ENVIRONMENT VARIABLES)(ENVIRONMENT_VARIABLES)nl() link(CREDITS)(CREDITS)nl() link(VERSION)(VERSION)nl() link(BUGS)(BUGS)nl() link(SEE ALSO)(SEEALSO)nl() ) label(NAME) manpagename(socat) (Multipurpose relay (SOcket CAT)) label(SYNOPSIS) manpagesynopsis() tt(socat [options]
)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. 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; this is the default. 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))) 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_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(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.7.5.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)) 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(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(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(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_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() 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() 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:))) Communicates with the specified peer socket, defined by [link()(TYPE_FILENAME)] assuming it is a unixdomain() socket. It first tries to connect and, if that fails, assumes it is a datagram socket, thus supporting both types.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-CONNECT)(ADDRESS_UNIX_CONNECT), link(UNIX-SENDTO)(ADDRESS_UNIX_SENDTO), link(GOPEN)(ADDRESS_GOPEN) label(ADDRESS_VSOCK_CONNECT)dit(bf(tt(VSOCK-CONNECT::))) Establishes a VSOCK stream connection to the specified [link(VSOCK cid)(TYPE_VSOCK_ADDRESS)] and [link(VSOCK port)(TYPE_VSOCK_PORT)].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(connect-timeout)(OPTION_CONNECT_TIMEOUT), link(retry)(OPTION_RETRY), link(readbytes)(OPTION_READBYTES)nl() See also: link(VSOCK-LISTEN)(ADDRESS_VSOCK_LISTEN), label(ADDRESS_VSOCK_LISTEN)dit(bf(tt(VSOCK-LISTEN:))) Listens on [link(VSOCK port)(TYPE_VSOCK_PORT)] and accepts a VSOCK connection. 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(RETRY)(GROUP_RETRY) nl() Useful options: link(fork)(OPTION_FORK), link(bind)(OPTION_BIND), link(max-children)(OPTION_MAX_CHILDREN), link(backlog)(OPTION_BACKLOG), link(su)(OPTION_SUBSTUSER), link(reuseaddr)(OPTION_SO_REUSEADDR), link(retry)(OPTION_RETRY)nl() See also: link(VSOCK-CONNECT)(ADDRESS_VSOCK_CONNECT) dit(bf(tt(ABSTRACT-CONNECT:))) dit(bf(tt(ABSTRACT-LISTEN:))) dit(bf(tt(ABSTRACT-SENDTO:))) dit(bf(tt(ABSTRACT-RECVFROM:))) dit(bf(tt(ABSTRACT-RECV:))) dit(bf(tt(ABSTRACT-CLIENT:))) The ABSTRACT addresses are almost identical to the related UNIX addresses except that they do not address file system based sockets but an alternate unixdomain() address space. To achieve this the socket address strings are prefixed with "\0" internally. This feature is available (only?) on Linux. Option groups are the same as with the related UNIX addresses, except that the ABSTRACT addresses are not member of the NAMED group.nl() Useful options: link(netns)(OPTION_NETNS) enddit() label(ADDRESS_OPTIONS) manpagesection(ADDRESS OPTIONS) Address options can be applied to address specifications to influence the process of opening the addresses and the properties of the resulting data channels. For technical reasons not every option can be applied to every address type; e.g., applying a socket option to a regular file will fail. To catch most useless combinations as early as in the open phase, the concept of em(option groups) was introduced. Each option belongs to one or more option groups. Options can be used only with address types that support at least one of their option groups (but see link(option -g)(option_g)). Address options have data types that their values must conform to. Every address option consists of just a keyword or a keyword followed by "=value", where value must conform to the options type. COMMENT(Options that trigger a call with trivial parameters are described with type BOOL which might be misleading.) Some address options manipulate parameters of system calls; e.g., option sync sets the code(O_SYNC) flag with the code(open()) call. Other options cause a system or library call; e.g., with option `ttl=value' the code(setsockopt(fd, SOL_IP, IP_TTL, value, sizeof(int))) call is applied. Other options set internal socat() variables that are used during data transfer; e.g., `crnl' causes explicit character conversions. A few options have more complex implementations; e.g., su-d (substuser-delayed) inquires some user and group infos, stores them, and applies them later after a possible code(chroot()) call. If multiple options are given to an address, their sequence in the address specification has (almost) no effect on the sequence of their execution/application. Instead, socat() has built in an em(option phase) model that tries to bring the options in a useful order. Some options exist in different forms (e.g., unlink, unlink-early, unlink-late) to control the time of their execution. If the same option is specified more than once within one address specification, with equal or different values, the effect depends on the kind of option. Options resulting in function calls like code(setsockopt()) cause multiple invocations. With options that set parameters for a required call like code(open()) or set internal flags, the value of the last option occurrence is effective. The existence or semantics of many options are system dependent. Socat() usually does NOT try to emulate missing libc or kernel features, it just provides an interface to the underlying system. So, if an operating system lacks a feature, the related option is simply not available on this platform. The following paragraphs introduce just the more common address options. For a more comprehensive reference and to find information about canonical option names, alias names, option phases, and platforms see file file(xio.help). nl() nl() startdit()enddit()nl() label(GROUP_FD)em(bf(FD option group)) This option group contains options that are applied to a unix() style file descriptor, no matter how it was generated. Because all current socat() address types are file descriptor based, these options may be applied to any address. nl() Note: Some of these options are also member of another option group, that provides another, non-fd based mechanism. For these options, it depends on the actual address type and its option groups which mechanism is used. The second, non-fd based mechanism is prioritized. startdit() label(OPTION_CLOEXEC)dit(bf(tt(cloexec[=]))) Sets the code(FD_CLOEXEC) flag with the code(fcntl()) system call to value link()(TYPE_BOOL). If set, the file descriptor is closed on code(exec()) family function calls. Socat() internally handles this flag for the fds it controls, so in most cases there will be no need to apply this option. label(OPTION_SETLK_WR)dit(bf(tt(setlk[=]))) Tries to set a discretionary write lock to the whole file using the code(fcntl(fd, F_SETLK, ...)) system call. If the file is already locked, this call results in an error. On Linux, when the file permissions for group are "S" (g-x,g+s), and the file system is locally mounted with the "mand" option, the lock is mandatory, i.e. prevents other processes from opening the file. label(OPTION_SETLKW_WR)dit(bf(tt(setlkw[=]))) Tries to set a discretionary waiting write lock to the whole file using the code(fcntl(fd, F_SETLKW, ...)) system call. If the file is already locked, this call blocks. See option link(setlk)(OPTION_SETLK_WR) for information about making this lock mandatory. label(OPTION_SETLK_RD)dit(bf(tt(setlk-rd[=]))) Tries to set a discretionary read lock to the whole file using the code(fcntl(fd, F_SETLK, ...)) system call. If the file is already write locked, this call results in an error. See option link(setlk)(OPTION_SETLK_WR) for information about making this lock mandatory. label(OPTION_SETLKW_RD)dit(bf(tt(setlkw-rd[=]))) Tries to set a discretionary waiting read lock to the whole file using the code(fcntl(fd, F_SETLKW, ...)) system call. If the file is already write locked, this call blocks. See option link(setlk)(OPTION_SETLK_WR) for information about making this lock mandatory. label(OPTION_FLOCK_EX)dit(bf(tt(flock-ex[=]))) Tries to set a blocking exclusive advisory lock to the file using the code(flock(fd, LOCK_EX)) system call. Socat() hangs in this call if the file is locked by another process. label(OPTION_FLOCK_EX_NB)dit(bf(tt(flock-ex-nb[=]))) Tries to set a nonblocking exclusive advisory lock to the file using the code(flock(fd, LOCK_EX|LOCK_NB)) system call. If the file is already locked, this option results in an error. label(OPTION_FLOCK_SH)dit(bf(tt(flock-sh[=]))) Tries to set a blocking shared advisory lock to the file using the code(flock(fd, LOCK_SH)) system call. Socat() hangs in this call if the file is locked by another process. label(OPTION_FLOCK_SH_NB)dit(bf(tt(flock-sh-nb[=]))) Tries to set a nonblocking shared advisory lock to the file using the code(flock(fd, LOCK_SH|LOCK_NB)) system call. If the file is already locked, this option results in an error. label(OPTION_LOCK)dit(bf(tt(lock[=]))) Sets a blocking lock on the file. Uses the setlk or flock mechanism depending on availability on the particular platform. If both are available, the POSIX variant (setlkw) is used. label(OPTION_USER)dit(bf(tt(user=))) Sets the link()(TYPE_USER) (owner) of the stream. If the address is member of the NAMED option group, socat() uses the code(chown()) system call after opening the file or binding to the unixdomain() socket (race condition!). Without filesystem entry, socat() sets the user of the stream using the code(fchown()) system call. These calls might require root privilege. label(OPTION_USER_LATE)dit(bf(tt(user-late=))) Sets the owner of the fd to link()(TYPE_USER) with the code(fchown()) system call after opening or connecting the channel. This is useful only on file system entries. label(OPTION_GROUP)dit(bf(tt(group=))) Sets the link()(TYPE_GROUP) of the stream. If the address is member of the NAMED option group, socat() uses the code(chown()) system call after opening the file or binding to the unixdomain() socket (race condition!). Without filesystem entry, socat() sets the group of the stream with the code(fchown()) system call. These calls might require group membership or root privilege. label(OPTION_GROUP_LATE)dit(bf(tt(group-late=))) Sets the group of the fd to link()(TYPE_GROUP) with the code(fchown()) system call after opening or connecting the channel. This is useful only on file system entries. label(OPTION_MODE)dit(bf(tt(mode=))) Sets the [link(mode_t)(TYPE_MODE_T)] (permissions) of the stream. If the address is member of the NAMED option group and uses the code(open()) or code(creat()) call, the mode is applied with these. If the address is member of the NAMED option group without using these system calls, socat() uses the code(chmod()) system call after opening the filesystem entry or binding to the unixdomain() socket (race condition!). Otherwise, socat() sets the mode of the stream using code(fchmod()). These calls might require ownership or root privilege. label(OPTION_PERM_LATE)dit(bf(tt(perm-late=))) Sets the permissions of the fd to value [link(mode_t)(TYPE_MODE_T)] using the code(fchmod()) system call after opening or connecting the channel. This is useful only on file system entries. label(OPTION_APPEND)dit(bf(tt(append[=]))) Always writes data to the actual end of file. If the address is member of the OPEN option group, socat() uses the code(O_APPEND) flag with the code(open()) system call (link(example)(EXAMPLE_OPTION_APPEND)). Otherwise, socat() applies the code(fcntl(fd, F_SETFL, O_APPEND)) call. label(OPTION_NONBLOCK)dit(bf(tt(nonblock[=]))) Tries to open or use file in nonblocking mode. Its only effects are that the code(connect()) call of TCP addresses does not block, and that opening a named pipe for reading does not block. If the address is member of the OPEN option group, socat() uses the code(O_NONBLOCK) flag with the code(open()) system call. Otherwise, socat() applies the code(fcntl(fd, F_SETFL, O_NONBLOCK)) call. COMMENT(label(OPTION_NDELAY)dit(bf(tt(ndelay[=]))) Tries to open or use file in nonblocking mode. Has no effect because socat() works with code(select()).) COMMENT(label(OPTION_ASYNC)dit(bf(tt(async[=]))) Enables SIGIO for this fd. Has no effect, because socat() ignores SIGIO.) label(OPTION_O_BINARY)dit(bf(tt(binary[=]))) Opens the file in binary mode to avoid implicit line terminator conversions (Cygwin). label(OPTION_O_TEXT)dit(bf(tt(text[=]))) Opens the file in text mode to force implicit line terminator conversions (Cygwin). label(OPTION_O_NOINHERIT)dit(bf(tt(noinherit[=]))) Does not keep this file open in a spawned process (Cygwin). label(OPTION_COOL_WRITE)dit(bf(tt(cool-write[=]))) Takes it easy when write fails with EPIPE or ECONNRESET and logs the message with em(notice) level instead of em(error). This prevents the log file from being filled with useless error messages when socat() is used as a high volume server or proxy where clients often abort the connection. Use this option only with option link(fork)(OPTION_FORK) because otherwise it might cause socat() to exit with code 0 even on failure.nl() This option is deprecated, consider using link(option children-shutup)(OPTION_CHILDRED_SHUTUP) instead. label(OPTION_END_CLOSE)dit(bf(tt(end-close[=]))) Changes the (address dependent) method of ending a connection to just close the file descriptors. This is useful when the connection is to be reused by or shared with other processes (link(example)(EXAMPLE_END_CLOSE)).nl() Normally, socket connections will be ended with tt(shutdown(2)) which terminates the socket even if it is shared by multiple processes. tt(close(2)) "unlinks" the socket from the process but keeps it active as long as there are still links from other processes.nl() Similarly, when an address of type EXEC or SYSTEM is ended, socat usually will explicitly kill the sub process. With this option, it will just close the file descriptors. label(OPTION_SHUT_NONE)dit(bf(tt(shut-none[=]))) Changes the (address dependent) method of shutting down the write part of a connection to not do anything. label(OPTION_SHUT_DOWN)dit(bf(tt(shut-down[=]))) Changes the (address dependent) method of shutting down the write part of a connection to NOEXPAND(shutdown(fd, SHUT_WR)). Is only useful with sockets. label(OPTION_SHUT_CLOSE)dit(bf(tt(shut-close[=]))) Changes the (address dependent) method of shutting down the write part of a connection to NOEXPAND(close(fd)). label(OPTION_SHUT_NULL)dit(bf(tt(shut-null[=]))) When one address indicates EOF, socat() will send a zero sized packet to the write channel of the other address to transfer the EOF condition. This is useful with UDP and other datagram protocols. Has been tested against netcat and socat with option link(null-eof)(OPTION_NULL_EOF). label(OPTION_NULL_EOF)dit(bf(tt(null-eof[=]))) Normally socat() will ignore empty (zero size payload) packets arriving on datagram sockets, so it survives port scans. With this option socat() interprets empty datagram packets as EOF indicator (see link(shut-null)(OPTION_SHUT_NULL)). label(OPTION_IOCTL_VOID)dit(bf(tt(ioctl-void=))) Calls tt(ioctl()) with the request value as second argument and NULL as third argument. This option allows utilizing ioctls that are not explicitly implemented in socat. label(OPTION_IOCTL_INT)dit(bf(tt(ioctl-int=:))) Calls tt(ioctl()) with the request value as second argument and the integer value as third argument. label(OPTION_IOCTL_INTP)dit(bf(tt(ioctl-intp=:))) Calls tt(ioctl()) with the request value as second argument and a pointer to the integer value as third argument. label(OPTION_IOCTL_BIN)dit(bf(tt(ioctl-bin=:))) Calls tt(ioctl()) with the request value as second argument and a pointer to the given data value as third argument. This data must be specified in link()(TYPE_DATA) form. label(OPTION_IOCTL_STRING)dit(bf(tt(ioctl-string=:))) Calls tt(ioctl()) with the request value as second argument and a pointer to the given string as third argument. link()(TYPE_DATA) form. enddit() startdit()enddit()nl() label(GROUP_NAMED)em(bf(NAMED option group)) These options work on file system entries.nl() Please note that, with UNIX domain client addresses, this means the bind entry, not the target/peer entry.nl() See also options link(user)(OPTION_USER), link(group)(OPTION_GROUP), and link(mode)(OPTION_MODE). startdit() label(OPTION_USER_EARLY)dit(bf(tt(user-early=))) Changes the link()(TYPE_USER) (owner) of the file system entry before accessing it, using the code(chown()) system call. This call might require root privilege. label(OPTION_GROUP_EARLY)dit(bf(tt(group-early=))) Changes the link()(TYPE_GROUP) of the file system entry before accessing it, using the code(chown()) system call. This call might require group membership or root privilege. label(OPTION_PERM_EARLY)dit(bf(tt(perm-early=))) Changes the [link(mode_t)(TYPE_MODE_T)] of the file system entry before accessing it, using the code(chmod()) system call. This call might require ownership or root privilege. label(OPTION_UMASK)dit(bf(tt(umask=))) Sets the umask of the process to [link(mode_t)(TYPE_MODE_T)] before accessing the file system entry (useful with unixdomain() sockets!). This call might affect all further operations of the socat() process! label(OPTION_UNLINK_EARLY)dit(bf(tt(unlink-early[=]))) Unlinks (removes) the file before opening it and even before applying user-early etc. label(OPTION_UNLINK)dit(bf(tt(unlink[=]))) Unlinks (removes) the file before accessing it, but after user-early etc. label(OPTION_UNLINK_LATE)dit(bf(tt(unlink-late[=]))) Unlinks (removes) the file after opening it to make it inaccessible for other processes after a short race condition. label(OPTION_UNLINK_CLOSE)dit(bf(tt(unlink-close[=]))) Controls removal of the addresses file system entry when closing the address. For link(named pipes)(ADDRESS_NAMED_PIPE), link(UNIX domain sockets)(ADDRESS_UNIX_LISTEN), and the link(symbolic links)(OPTION_SYMBOLIC_LINK) of link(pty addresses)(ADDRESS_PTY), the default is remove (1); for link(created files)(ADDRESS_CREAT), link(opened files)(ADDRESS_OPEN), and link(generic opened files)(ADDRESS_GOPEN) the default is keep (0). Setting this option to 1 removes the entry, 0 keeps it. No value means 1. enddit() startdit()enddit()nl() label(GROUP_OPEN)em(bf(OPEN option group)) The OPEN group options allow setting flags with the code(open()) system call. E.g., option `creat' sets the code(O_CREAT) flag. When the used address does not use code(open()) (e.g.STDIO), the code(fcntl(..., F_SETFL, ...)) call is used instead.nl() See also options link(append)(OPTION_APPEND) and link(nonblock)(OPTION_NONBLOCK). startdit() label(OPTION_O_CREAT)dit(bf(tt(creat[=]))) Creates the file if it does not exist (link(example)(EXAMPLE_OPTION_CREAT)). label(OPTION_DSYNC)dit(bf(tt(dsync[=]))) Blocks code(write()) calls until metainfo is physically written to media. label(OPTION_EXCL)dit(bf(tt(excl[=]))) With option creat, if file exists this is an error. label(OPTION_LARGEFILE)dit(bf(tt(largefile[=]))) On 32 bit systems, allows a file larger than 2^31 bytes. label(OPTION_O_NOATIME)dit(bf(tt(noatime[=]))) Sets the O_NOATIME options, so reads do not change the access timestamp. label(OPTION_NOCTTY)dit(bf(tt(noctty[=]))) Does not make this file the controlling terminal. label(OPTION_NOFOLLOW)dit(bf(tt(nofollow[=]))) Does not follow symbolic links. label(OPTION_NSHARE)dit(bf(tt(nshare[=]))) Does not allow sharing this file with other processes. label(OPTION_RSHARE)dit(bf(tt(rshare[=]))) Does not allow other processes to open this file for writing. label(OPTION_RSYNC)dit(bf(tt(rsync[=]))) Blocks code(write()) until metainfo is physically written to media. label(OPTION_SYNC)dit(bf(tt(sync[=]))) Blocks code(write()) until data is physically written to media. COMMENT(label(OPTION_DEFER)dit(bf(tt(defer[=]))) Temporarily stores write data in paging space.) COMMENT(label(OPTION_DELAY)dit(bf(tt(delay[=]))) Blocks code(open()) until share conditions are fulfilled.) COMMENT(label(OPTION_DIRECT)dit(bf(tt(direct[=])))) COMMENT(label(OPTION_DIRECTORY)dit(bf(tt(directory[=]))) Fails if file is not a directory. Not useful with socat().) label(OPTION_RDONLY)dit(bf(tt(rdonly[=]))) Opens the file for reading only. COMMENT(label(OPTION_RDWR)dit(bf(tt(rdwr[=]))) Opens the file for reading and writing.) label(OPTION_WRONLY)dit(bf(tt(wronly[=]))) Opens the file for writing only. label(OPTION_O_TRUNC)dit(bf(tt(trunc[=]))) Truncates the file to size 0 during opening it. enddit() startdit()enddit()nl() label(GROUP_REG)em(bf(REG and BLK option group)) These options are usually applied to a unix() file descriptor, but their semantics make sense only on a file supporting random access. startdit() label(OPTION_SEEK)dit(bf(tt(seek=))) Applies the code(lseek(fd, , SEEK_SET)) (or code(lseek64)) system call, thus positioning the file pointer absolutely to [link(off_t)(TYPE_OFF) or link(off64_t)(TYPE_OFF64)]. Please note that a missing value defaults to 1, not 0. label(OPTION_SEEK_CUR)dit(bf(tt(seek-cur=))) Applies the code(lseek(fd, , SEEK_CUR)) (or code(lseek64)) system call, thus positioning the file pointer [link(off_t)(TYPE_OFF) or link(off64_t)(TYPE_OFF64)] bytes relatively to its current position (which is usually 0). Please note that a missing value defaults to 1, not 0. label(OPTION_SEEK_END)dit(bf(tt(seek-end=))) Applies the code(lseek(fd, , SEEK_END)) (or code(lseek64)) system call, thus positioning the file pointer [link(off_t)(TYPE_OFF) or link(off64_t)(TYPE_OFF64)] bytes relatively to the files current end. Please note that a missing value defaults to 1, not 0. label(OPTION_FTRUNCATE)dit(bf(tt(ftruncate=))) Applies the code(ftruncate(fd, )) (or code(ftruncate64) if available) system call, thus truncating the file at the position [link(off_t)(TYPE_OFF) or link(off64_t)(TYPE_OFF64)]. Please note that a missing value defaults to 1, not 0. label(OPTION_FS_SECRM_FL)dit(bf(tt(secrm[=]))) label(OPTION_FS_UNRM)dit(bf(tt(unrm[=]))) label(OPTION_FS_COMPR)dit(bf(tt(compr[=]))) label(OPTION_FS_SYNC)dit(bf(tt(fs-sync[=]))) label(OPTION_FS_IMMUTABLE)dit(bf(tt(immutable[=]))) label(OPTION_FS_APPEND)dit(bf(tt(fs-append[=]))) label(OPTION_FS_NODUMP)dit(bf(tt(nodump[=]))) label(OPTION_FS_NOATIME)dit(bf(tt(fs-noatime[=]))) label(OPTION_FS_JOURNAL_DATA)dit(bf(tt(journal-data[=]))) label(OPTION_FS_NOTAIL)dit(bf(tt(notail[=]))) label(OPTION_FS_DIRSYNC)dit(bf(tt(dirsync[=]))) These options change non standard file attributes on operating systems and file systems that support these features, like Linux with ext2fs and successors, xfs, or reiserfs. See man 1 chattr for information on these options. Please note that there might be a race condition between creating the file and applying these options. enddit() startdit()enddit()nl() label(GROUP_PROCESS)em(bf(PROCESS option group)) Options of this group change the process properties instead of just affecting one data channel. For EXEC and SYSTEM addresses and for LISTEN and CONNECT type addresses with option link(fork)(OPTION_FORK), these options apply to the child processes instead of the main socat() process. startdit() label(OPTION_CHROOT)dit(bf(tt(chroot=))) Performs a code(chroot()) operation to link()(TYPE_DIRECTORY) after processing the address (link(example)(EXAMPLE_OPTION_CHROOT)). This call might require root privilege. label(OPTION_CHROOT_EARLY)dit(bf(tt(chroot-early=))) Performs a code(chroot()) operation to link()(TYPE_DIRECTORY) before opening the address. This call might require root privilege. label(OPTION_SETGID)dit(bf(tt(setgid=))) Changes the primary link()(TYPE_GROUP) of the process after processing the address. This call might require root privilege. Please note that this option does not drop other group related privileges. label(OPTION_SETGID_EARLY)dit(bf(tt(setgid-early=))) Like link(setgit)(OPTION_SETGID) but is performed before opening the address. label(OPTION_SETUID)dit(bf(tt(setuid=))) Changes the link()(TYPE_USER) (owner) of the process after processing the address. This call might require root privilege. Please note that this option does not drop group related privileges. Check if option link(su)(OPTION_SUBSTUSER) better fits your needs. label(OPTION_SETUID_EARLY)dit(bf(tt(setuid-early=))) Like link(setuid)(OPTION_SETUID) but is performed before opening the address. label(OPTION_SUBSTUSER)dit(bf(tt(su=))) Changes the link()(TYPE_USER) (owner) and groups of the process after processing the address (link(example)(EXAMPLE_OPTION_SUBSTUSER)). This call might require root privilege. label(OPTION_SUBSTUSER_DELAYED)dit(bf(tt(su-d=))) Short name for tt(substuser-delayed). COMMENT(Short name for bf(tt(substuser-delayed) ).) Changes the link()(TYPE_USER) (owner) and groups of the process after processing the address (link(example)(EXAMPLE_OPTION_SUBSTUSER_DELAYED)). The user and his groups are retrieved em(before) a possible code(chroot()). This call might require root privilege. label(OPTION_SETPGID)dit(bf(tt(setpgid=))) Makes the process a member of the specified process group link()(TYPE_PID_T). If no value is given, or if the value is 0 or 1, the process becomes leader of a new process group. label(OPTION_SETSID)dit(bf(tt(setsid))) Makes the process the leader of a new session (link(example)(EXAMPLE_OPTION_SETSID)). label(OPTION_NETNS)dit(bf(tt(netns=))) Before opening the address it tries to switch to the named network namespace. After opening the address it switches back to the previous namespace. (link(Example with TCP forwarder)(EXAMPLE_OPTION_NETNS), link(example with virtual network connection)(EXAMPLE_TUN_NETNS).nl() Only on Linux; requires root; use option tt(--experimental).nl() enddit() startdit()enddit()nl() label(GROUP_READLINE)em(bf(READLINE option group)) These options apply to the readline address type. startdit() label(OPTION_HISTORY)dit(bf(tt(history=))) Reads and writes history from/to link()(TYPE_FILENAME) (link(example)(EXAMPLE_OPTION_HISTORY)). label(OPTION_NOPROMPT)dit(bf(tt(noprompt))) Since version 1.4.0, socat per default tries to determine a prompt - that is then passed to the readline call - by remembering the last incomplete line of the output. With this option, socat does not pass a prompt to readline, so it begins line editing in the first column of the terminal. label(OPTION_NOECHO)dit(bf(tt(noecho=))) Specifies a regular pattern for a prompt that prevents the following input line from being displayed on the screen and from being added to the history. The prompt is defined as the text that was output to the readline address after the lastest newline character and before an input character was typed. The pattern is a regular expression, e.g. "^[Pp]assword:.*$" or "([Uu]ser:|[Pp]assword:)". See NOEXPAND(regex(7)) for details. (link(example)(EXAMPLE_OPTION_NOECHO)) label(OPTION_PROMPT)dit(bf(tt(prompt=))) Passes the string as prompt to the readline function. readline prints this prompt when stepping through the history. If this string matches a constant prompt issued by an interactive program on the other socat address, consistent look and feel can be achieved. enddit() startdit()enddit()nl() label(GROUP_APPLICATION)em(bf(APPLICATION option group)) This group contains options that work at data level. Note that these options only apply to the "raw" data transferred by socat, but not to protocol data used by addresses like link(PROXY)(ADDRESS_PROXY_CONNECT). startdit() label(OPTION_CR)dit(bf(tt(cr))) Converts the default line termination character NL ('\n', 0x0a) to/from CR ('\r', 0x0d) when writing/reading on this channel. label(OPTION_CRNL)dit(bf(tt(crnl))) Converts the default line termination character NL ('\n', 0x0a) to/from CRNL ("\r\n", 0x0d0a) when writing/reading on this channel (link(example)(EXAMPLE_OPTION_CRNL)). Note: socat simply strips all CR characters. label(OPTION_IGNOREEOF)dit(bf(tt(ignoreeof))) When EOF occurs on this channel, socat() ignores it and tries to read more data (like "tail -f") (link(example)(EXAMPLE_OPTION_IGNOREEOF)). label(OPTION_READBYTES)dit(bf(tt(readbytes=))) socat() reads only so many bytes from this address (the address provides only so many bytes for transfer and pretends to be at EOF afterwards). Must be greater than 0. label(OPTION_LOCKFILE)dit(bf(tt(lockfile=))) If lockfile exists, exits with error. If lockfile does not exist, creates it and continues, unlinks lockfile on exit. label(OPTION_WAITLOCK)dit(bf(tt(waitlock=))) If lockfile exists, waits until it disappears. When lockfile does not exist, creates it and continues, unlinks lockfile on exit. label(OPTION_ESCAPE)dit(bf(tt(escape=))) Specifies the numeric code of a character that triggers EOF on the input stream. It is useful with a terminal in raw mode (link(example)(EXAMPLE_OPTION_ESCAPE)). enddit() startdit()enddit()nl() label(GROUP_SOCKET)em(bf(SOCKET option group)) These options are intended for all kinds of sockets, e.g. IP or unixdomain(). Most are applied with a code(setsockopt()) call. startdit() label(OPTION_BIND)dit(bf(tt(bind=))) Binds the socket to the given socket address using the code(bind()) system call. The form of is socket domain dependent: IP4 and IP6 allow the form [hostname|hostaddress][:(service|port)] (link(example)(EXAMPLE_OPTION_BIND_TCP4)), unixdomain() sockets require link()(TYPE_FILENAME), VSOCK allow the form [cid][:(port)]. label(OPTION_CONNECT_TIMEOUT)dit(bf(tt(connect-timeout=))) Abort the connection attempt after [link(timeval)(TYPE_TIMEVAL)] with error status. label(OPTION_SO_BINDTODEVICE)dit(bf(tt(so-bindtodevice=))) Binds the socket to the given link()(TYPE_INTERFACE). This option might require root privilege. label(OPTION_SO_BROADCAST)dit(bf(tt(broadcast))) For datagram sockets, allows sending to broadcast addresses and receiving packets addressed to broadcast addresses. COMMENT(label(OPTION_BSDCOMPAT)dit(bf(tt(bsdcompat))) Emulates some (old?) bugs of the BSD socket implementation.) label(OPTION_DEBUG)dit(bf(tt(debug))) Enables socket debugging. label(OPTION_DONTROUTE)dit(bf(tt(dontroute))) Only communicates with directly connected peers, does not use routers. label(OPTION_KEEPALIVE)dit(bf(tt(keepalive))) Enables sending keepalives on the socket. label(OPTION_LINGER)dit(bf(tt(linger=))) Blocks code(shutdown()) or code(close()) until data transfers have finished or the given timeout [link(int)(TYPE_INT)] expired. COMMENT(label(OPTION_NOREUSEADDR)dit(bf(tt(noreuseaddr))) Set the code(SO_NOREUSEADDR) socket option.) label(OPTION_OOBINLINE)dit(bf(tt(oobinline))) Places out-of-band data in the input data stream. label(OPTION_PRIORITY)dit(bf(tt(priority=))) Sets the protocol defined [link()(TYPE_INT)] for outgoing packets. label(OPTION_RCVBUF)dit(bf(tt(rcvbuf=))) Sets the size of the receive buffer after the code(socket()) call to [link(int)(TYPE_INT)]. With TCP sockets, this value corresponds to the socket's maximal window size. label(OPTION_RCVBUF_LATE)dit(bf(tt(rcvbuf-late=))) Sets the size of the receive buffer when the socket is already connected to [link(int)(TYPE_INT)]. With TCP sockets, this value corresponds to the socket's maximal window size. label(OPTION_SO_RCVTIMOE)dit(bf(tt(so-rcvtimeo=