/doc/socat.yo
Unknown | 3524 lines | 3187 code | 337 blank | 0 comment | 0 complexity | 1f86a98476e59b506dc7f2cc74b82fcc MD5 | raw file
Possible License(s): GPL-2.0
Large files files are truncated, but you can click here to view the full file
- 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)(Mar 2014)()()
- 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] <address> <address>)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 and error messages are generated; applying
- this option also prints warning messages. See link(DIAGNOSTICS)(DIAGNOSTICS)
- for more information.
- label(option_d_d)dit(bf(tt(-d -d))) Prints fatal, error, warning, and notice messages.
- dit(bf(tt(-d -d -d))) Prints fatal, error, warning, notice, and info messages.
- dit(bf(tt(-d -d -d -d))) Prints fatal, error, warning, notice, info, and debug
- messages.
- dit(bf(tt(-D)))
- Logs information about file descriptors before starting the transfer phase.
- dit(bf(tt(-ly[<facility>])))
- Writes messages to syslog instead of stderr; severity as defined with -d
- option. With optional link(<facility>)(TYPE_FACILITY), the syslog type can
- be selected, default is "daemon". Third party libraries might not obey this
- option.
- dit(bf(tt(-lf))tt( <logfile>))
- Writes messages to <logfile> [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(<progname>))
- 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[<facility>])))
- 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(<facility>)(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_b)dit(bf(tt(-b))tt(<size>))
- Sets the data transfer block <size> [link(size_t)(TYPE_SIZE_T)].
- At most <size> 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_t)dit(bf(tt(-t))tt(<timeout>))
- When one channel has reached EOF, the write part of the other channel is shut
- down. Then, socat() waits <timeout> [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(<timeout>))
- Total inactivity timeout: when socat is already in the transfer loop and
- nothing has happened for <timeout> [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(<lockfile>))
- 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(<lockfile>))
- 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 that 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 that the addresses do not implicitly or explicitly
- specify a version.
- 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:<filename>)))
- Opens link(<filename>)(TYPE_FILENAME) with code(creat()) and uses the file
- descriptor for writing.
- This address type requires write-only context, because a file opened with
- code(creat) cannot be read from. 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()
- <filename> must be a valid existing or not existing path.
- If <filename> is a named pipe, code(creat()) might block;
- if <filename> 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:<command-line>)))
- Forks a sub process that establishes communication with its parent process
- and invokes the specified program with code(execvp()).
- link(<command-line>)(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(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)nl()
- See also: link(SYSTEM)(ADDRESS_SYSTEM)
- label(ADDRESS_FD)dit(bf(tt(FD:<fdnum>)))
- Uses the file descriptor link(<fdnum>)(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:<filename>)))
- (Generic open) This address type tries to handle any file system entry
- except directories usefully. link(<filename>)(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:<host>:<protocol>)))
- 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(<protocol>)(TYPE_PROTOCOL) to send packets
- to <host> [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:<interface>)))
- Communicates with a network connected on an interface using raw packets
- including link level data. link(<interface>)(TYPE_INTERFACE) is the name of
- the network interface. Currently only available on Linux.
- 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:<host>:<protocol>)))
- 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:<host>:<protocol>)))
- 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:<address>:<protocol>)))
- 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(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:<host>:<protocol>)))
- 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:<host>:<protocol>)))
- 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:<protocol>)))
- Opens a raw IP socket of link(<protocol>)(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()
- 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:<protocol>)))
- 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:<protocol>)))
- 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:<protocol>)))
- Opens a raw IP socket of link(<protocol>)(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.
- 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:<protocol>)))
- 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:<protocol>)))
- 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:<filename>)))
- Opens link(<filename>)(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 rarly 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:<host>:<port>)))
- Tries to establish a SSL connection to <port> [link(TCP
- service)(TYPE_TCP_SERVICE)] on
- <host> [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: The server certificate is only checked for validity against
- link(cafile)(OPTION_OPENSSL_CAFILE) or link(capath)(OPTION_OPENSSL_CAPATH),
- but not for match with the server'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(OPENSSL)(GROUP_OPENSSL),link(RETRY)(GROUP_RETRY) nl()
- Useful options:
- link(cipher)(OPTION_OPENSSL_CIPHERLIST),
- link(method)(OPTION_OPENSSL_METHOD),
- link(verify)(OPTION_OPENSSL_VERIFY),
- 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:<port>)))
- Listens on tcp <port> [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(cipher)(OPTION_OPENSSL_CIPHERLIST),
- link(method)(OPTION_OPENSSL_METHOD),
- link(verify)(OPTION_OPENSSL_VERIFY),
- 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_REUSEADDR),
- link(retry)(OPTION_RETRY)nl()
- See also:
- link(OPENSSL)(ADDRESS_OPENSSL_CONNECT),
- link(TCP-LISTEN)(ADDRESS_TCP_LISTEN)
- label(ADDRESS_NAMED_PIPE)dit(bf(tt(PIPE:<filename>)))
- If link(<filename>)(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)
- label(ADDRESS_PROXY_CONNECT)dit(bf(tt(PROXY:<proxy>:<hostname>:<port>)))
- 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. 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)
- 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:<host>:<port>)))
- Establishes an SCTP stream connection to the specified <host> [link(IP
- address)(TYPE_IP_ADDRESS)] and <port> [link(TCP service)(TYPE_TCP_SERVICE)]
- 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(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:<host>:<port>)))
- 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:<host>:<port>)))
- 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:<port>)))
- Listens on <port> [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(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(sctp-maxseg)(OPTION_SCTP_MAXSEG),
- link(sctp-nodelay)(OPTION_SCTP_NODELAY),
- link(su)(OPTION_SUBSTUSER),
- link(reuseaddr)(OPTION_REUSEADDR),
- link(retry)(OPTION_RETRY),
- link(cool-write)(OPTION_COOL_WRITE)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:<port>)))
- 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:<port>)))
- 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:<domain>:<protocol>:<remote-address>)))
- Creates a stream socket using the first and second given socket parameters
- and tt(SOCK_STREAM) (see man 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-int)(OPTION_SETSOCKOPT_INT),
- link(setsockopt-bin)(OPTION_SETSOCKOPT_BIN),
- link(setsockopt-string)(OPTION_SETSOCKOPT_STRING)
- 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:<domain>:<type>:<protocol>:<remote-address>)))
- Creates a datagram socket using the first three given socket parameters (see
- man 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-int)(OPTION_SETSOCKOPT_INT),
- link(setsockopt-bin)(OPTION_SETSOCKOPT_BIN),
- link(setsockopt-string)(OPTION_SETSOCKOPT_STRING)
- 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:<domain>:<protocol>:<local-address>)))
- Creates a stream socket using the first and second given socket parameters
- and tt(SOCK_STREAM) (see man 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-int)(OPTION_SETSOCKOPT_INT),
- link(setsockopt-bin)(OPTION_SETSOCKOPT_BIN),
- link(setsockopt-string)(OPTION_SETSOCKOPT_STRING)
- 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:<domain>:<type>:<protocol>:<local-address>)))
- Creates a socket using the three given socket parameters (see man socket\(2))
- and binds it to <local-address>. 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-int)(OPTION_SETSOCKOPT_INT),
- link(setsockopt-bin)(OPTION_SETSOCKOPT_BIN),
- link(setsockopt-string)(OPTION_SETSOCKOPT_STRING)
- 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:<domain>:<type>:<protocol>:<local-address>)))
- Creates a socket using the three given socket parameters (see man socket\(2))
- and binds it to <local-address>. 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()
- 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-int)(OPTION_SETSOCKOPT_INT),
- link(setsockopt-bin)(OPTION_SETSOCKOPT_BIN),
- link(setsockopt-string)(OPTION_SETSOCKOPT_STRING)
- 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:<domain>:<type>:<protocol>:<remote-address>)))
- Creates a socket using the three given socket parameters (see man
- 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-int)(OPTION_SETSOCKOPT_INT),
- link(setsockopt-bin)(OPTION_SETSOCKOPT_BIN),
- link(setsockopt-string)(OPTION_SETSOCKOPT_STRING)
- 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_SOCKS4)dit(bf(tt(SOCKS4:<socks-server>:<host>:<port>)))
- Connects via <socks-server> [link(IP address)(TYPE_IP_ADDRESS)]
- to <host> [link(IPv4 address)(TYPE_IPV4_ADDRESS)]
- on <port> [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(SOCKS4A)(ADDRESS_SOCKS4A),
- link(PROXY)(ADDRESS_PROXY_CONNECT),
- link(TCP)(ADDRESS_TCP_CONNECT)
- label(ADDRESS_SOCKS4A)dit(bf(tt(SOCKS4A:<socks-server>:<host>:<port>)))
- 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_STDERR)dit(bf(tt(STDERR)))
- Uses file descriptor 2.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()
- 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()
- 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_SYSTEM)dit(bf(tt(SYSTEM:<shell-command>)))
- Forks a sub process that establishes communication with its parent process
- and invokes the specified program with code(system()). Please note that
- <shell-command> [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(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)
- label(ADDRESS_TCP_CONNECT)dit(bf(tt(TCP:<host>:<port>)))
- Connects to <port> [link(TCP service)(TYPE_TCP_SERVICE)] on
- <host> [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(crnl)(OPTION_CRNL),
- link(bind)(OPTION_BIND),
- link(pf)(OPTION_PROTOCOL_FAMILY),
- link(connect-timeout)(OPTION_CONNECT_TIMEOUT),
- link(tos)(OPTION_TOS),
- link(mtudiscover)(OPTION_MTUDISCOVER),
- link(mss)(OPTION_MSS),
- link(nodelay)(OPTION_NODELAY),
- link(nonblock)(OPTION_NONBLOCK),
- link(sourceport)(OPTION_SOURCEPORT),
- link(retry)(OPTION_RETRY),
- 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:<host>:<port>)))
- 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:<host>:<port>)))
- 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:<port>)))
- Listens on <port> [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(mss)(OPTION_MSS),
- link(su)(OPTION_SUBSTUSER),
- link(reuseaddr)(OPTION_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:<port>)))
- 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:<port>)))
- 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[:<if-addr>/<bits>])))
- Creates a Linux TUN/TAP device and optionally assignes it the address and
- …
Large files files are truncated, but you can click here to view the full file