{
    "mode": "man",
    "parameter": "socat",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/socat/1/json",
    "generated": "2026-05-30T07:09:10Z",
    "synopsis": "socat [options] <address> <address>\nsocat -V\nsocat -h[h[h]] | -?[?[?]]\nfilan\nprocan",
    "sections": {
        "NAME": {
            "content": "socat - Multipurpose relay (SOcket CAT)\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "socat [options] <address> <address>\nsocat -V\nsocat -h[h[h]] | -?[?[?]]\nfilan\nprocan\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Socat  is  a  command  line based utility that establishes two bidirectional byte streams and\ntransfers data between them. Because the streams can be constructed from a large set of  dif‐\nferent  types  of data sinks and sources (see address types), and because lots of address op‐\ntions may be applied to the streams, socat can be used for many different purposes.\n\nFilan is a utility that prints information about its active file descriptors  to  stdout.  It\nhas  been written for debugging socat, but might be useful for other purposes too. Use the -h\noption to find more infos.\n\nProcan is a utility that prints information about process parameters to stdout. It  has  been\nwritten  to better understand some UNIX process properties and for debugging socat, but might\nbe useful for other purposes too.\n\nThe life cycle of a socat instance typically consists of four phases.\n\nIn the init phase, the command line options are parsed and logging is initialized.\n\nDuring the open phase, socat opens the first address and afterwards the second address. These\nsteps are usually blocking; thus, especially for complex address types like socks, connection\nrequests or authentication dialogs must be completed before the next step is started.\n\nIn the transfer phase, socat watches both streams’ read and write file  descriptors  via  se‐\nlect()  , and, when data is available on one side and can be written to the other side, socat\nreads it, performs newline character conversions if required, and  writes  the  data  to  the\nwrite  file  descriptor of the other stream, then continues waiting for more data in both di‐\nrections.\n\nWhen one of the streams effectively reaches EOF, the closing phase  begins.  Socat  transfers\nthe  EOF  condition to the other stream, i.e. tries to shutdown only its write stream, giving\nit a chance to terminate gracefully. For a defined time socat continues to transfer  data  in\nthe other direction, but then closes all remaining channels and terminates.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "Socat  provides some command line options that modify the behaviour of the program. They have\nnothing to do with so called address options that are used as  parts  of  address  specifica‐\ntions.\n",
            "subsections": [
                {
                    "name": "-V",
                    "content": "",
                    "flag": "-V"
                },
                {
                    "name": "-h | -?",
                    "content": "Print  a  help  text  to  stdout describing command line options and available address\ntypes, and exit.\n",
                    "flag": "-?"
                },
                {
                    "name": "-hh | -??",
                    "content": "Like -h, plus a list of the short names of all available address options. Some options\nare  platform  dependend, so this output is helpful for checking the particular imple‐\nmentation.\n"
                },
                {
                    "name": "-hhh | -???",
                    "content": "Like -hh, plus a list of all available address option names.\n"
                },
                {
                    "name": "-d",
                    "content": "also prints warning messages. See DIAGNOSTICS for more information.\n",
                    "flag": "-d"
                },
                {
                    "name": "-d -d",
                    "content": "",
                    "flag": "-d"
                },
                {
                    "name": "-d -d -d",
                    "content": "Prints fatal, error, warning, notice, and info messages.\n",
                    "flag": "-d"
                },
                {
                    "name": "-d -d -d -d",
                    "content": "Prints fatal, error, warning, notice, info, and debug messages.\n",
                    "flag": "-d"
                },
                {
                    "name": "-D",
                    "content": "",
                    "flag": "-D"
                },
                {
                    "name": "-ly[<facility>]",
                    "content": "Writes  messages to syslog instead of stderr; severity as defined with -d option. With\noptional <facility>, the syslog type can be selected, default is \"daemon\". Third party\nlibraries might not obey this option.\n"
                },
                {
                    "name": "-lf<logfile>",
                    "content": "Writes messages to <logfile> [filename] instead of stderr. Some third party libraries,\nin particular libwrap, might not obey this option.\n"
                },
                {
                    "name": "-ls",
                    "content": "obey this option, in particular libwrap appears to only log to syslog.\n"
                },
                {
                    "name": "-lp<progname>",
                    "content": "Overrides  the  program name printed in error messages and used for constructing envi‐\nronment variable names.\n"
                },
                {
                    "name": "-lu",
                    "content": "logging to syslog.\n"
                },
                {
                    "name": "-lm[<facility>]",
                    "content": "Mixed  log  mode. During startup messages are printed to stderr; when socat starts the\ntransfer phase loop or daemon mode (i.e. after opening all streams and before starting\ndata  transfer,  or,  with listening sockets with fork option, before the first accept\ncall), it switches logging to syslog.  With optional <facility>, the syslog  type  can\nbe selected, default is \"daemon\".\n"
                },
                {
                    "name": "-lh",
                    "content": "the value retrieved with uname() if HOSTNAME is not set.\n"
                },
                {
                    "name": "-v",
                    "content": "output format is text with some conversions for readability, and prefixed with \"> \" or\n\"< \" indicating flow directions.\n",
                    "flag": "-v"
                },
                {
                    "name": "-x",
                    "content": "output  format  is hexadecimal, prefixed with \"> \" or \"< \" indicating flow directions.\nCan be combined with -v .\n",
                    "flag": "-x"
                },
                {
                    "name": "-r <file>",
                    "content": "Dumps the raw (binary) data flowing from left to right address to the given file.\n",
                    "flag": "-r",
                    "arg": "<file>"
                },
                {
                    "name": "-R <file>",
                    "content": "Dumps the raw (binary) data flowing from right to left address to the given file.\n",
                    "flag": "-R",
                    "arg": "<file>"
                },
                {
                    "name": "-b<size>",
                    "content": "Sets the data transfer block <size> [sizet].  At most <size>  bytes  are  transferred\nper step. Default is 8192 bytes.\n"
                },
                {
                    "name": "-s",
                    "content": "ning when some option could not be applied. With this option, socat is sloppy with er‐\nrors and tries to continue. Even with this option, socat will exit on fatals, and will\nabort connection attempts when security checks failed.\n",
                    "flag": "-s"
                },
                {
                    "name": "-t<timeout>",
                    "content": "When one channel has reached EOF, the write part of the other channel  is  shut  down.\nThen,  socat waits <timeout> [timeval] seconds before terminating. Default is 0.5 sec‐\nonds. This timeout only applies to addresses where write and read part can  be  closed\nindependently.  When during the timeout interval the read part gives EOF, socat termi‐\nnates without awaiting the timeout.\n"
                },
                {
                    "name": "-T<timeout>",
                    "content": "Total inactivity timeout: when socat is already in the transfer loop and  nothing  has\nhappened  for  <timeout> [timeval] seconds (no data arrived, no interrupt occurred...)\nthen it terminates.  Useful with protocols like UDP that cannot transfer EOF.\n"
                },
                {
                    "name": "-u",
                    "content": "address is only used for writing (example).\n",
                    "flag": "-u"
                },
                {
                    "name": "-U",
                    "content": "writing, and the second address is only used for reading.\n",
                    "flag": "-U"
                },
                {
                    "name": "-g",
                    "content": "given  address  environment.  Use it if you want to force, e.g., appliance of a socket\noption to a serial device.\n",
                    "flag": "-g"
                },
                {
                    "name": "-L<lockfile>",
                    "content": "If lockfile exists, exits with error. If lockfile does not exist, creates it and  con‐\ntinues, unlinks lockfile on exit.\n"
                },
                {
                    "name": "-W<lockfile>",
                    "content": "If  lockfile  exists, waits until it disappears. When lockfile does not exist, creates\nit and continues, unlinks lockfile on exit.\n"
                },
                {
                    "name": "-4",
                    "content": "version; this is the default.\n",
                    "flag": "-4"
                },
                {
                    "name": "-6",
                    "content": "version.\n\n",
                    "flag": "-6"
                }
            ]
        },
        "ADDRESS SPECIFICATIONS": {
            "content": "With the address command line arguments, the user gives socat instructions and the  necessary\ninformation for establishing the byte streams.\n\nAn  address  specification usually consists of an address type keyword, zero or more required\naddress parameters separated by ’:’ from the keyword and from each other, and  zero  or  more\naddress options separated by ’,’.\n\nThe  keyword specifies the address type (e.g., TCP4, OPEN, EXEC). For some keywords there ex‐\nist synonyms (’-’ for STDIO, TCP for TCP4). Keywords are case insensitive.  For a few special\naddress  types, the keyword may be omitted: Address specifications starting with a number are\nassumed to be FD (raw file descriptor) addresses; if a ’/’ is found before the first  ’:’  or\n’,’, GOPEN (generic file open) is assumed.\n\nThe required number and type of address parameters depend on the address type. E.g., TCP4 re‐\nquires a server specification (name or address), and a port specification (number or  service\nname).\n\nZero  or  more  address options may be given with each address. They influence the address in\nsome ways.  Options consist of an option keyword or an option keyword and a value,  separated\nby ’=’. Option keywords are case insensitive.  For filtering the options that are useful with\nan address type, each option is member of one option group. For each address type there is  a\nset  of  option  groups allowed. Only options belonging to one of these address groups may be\nused (except with option -g).\n\nAddress specifications following the above schema are also called single  address  specifica‐\ntions.   Two  single  addresses can be combined with \"!!\" to form a dual type address for one\nchannel. Here, the first address is used by socat for reading data, and  the  second  address\nfor  writing  data.  There is no way to specify an option only once for being applied to both\nsingle addresses.\n\nUsually, addresses are opened in read/write mode. When an address is part of a  dual  address\nspecification,  or when option -u or -U is used, an address might be used only for reading or\nfor writing. Considering this is important with some address types.\n\nWith socat version 1.5.0 and higher, the lexical analysis tries to handle quotes  and  paren‐\nthesis  meaningfully and allows escaping of special characters.  If one of the characters ( {\n[ ’ is found, the corresponding closing character - ) } ] ’ - is looked for; they may also be\nnested. Within these constructs, socats special characters and strings : , !! are not handled\nspecially. All those characters and strings can be escaped with \\ or within \"\"\n",
            "subsections": []
        },
        "ADDRESS TYPES": {
            "content": "This section describes the available address types with their keywords, parameters,  and  se‐\nmantics.\n",
            "subsections": [
                {
                    "name": "CREATE:<filename>",
                    "content": "Opens  <filename> with creat() and uses the file descriptor for writing.  This address\ntype requires write-only context, because a file opened  with  creat  cannot  be  read\nfrom.\nFlags  like OLARGEFILE cannot be applied. If you need them use OPEN with options cre‐\nate,create.\n<filename> must be a valid existing or not existing path.  If <filename>  is  a  named\npipe, creat() might block; if <filename> refers to a socket, this is an error.\nOption groups: FD,REG,NAMED\nUseful options: mode, user, group, unlink-early, unlink-late, append\nSee also: OPEN, GOPEN\n"
                },
                {
                    "name": "EXEC:<command-line>",
                    "content": "Forks a sub process that establishes communication with its parent process and invokes\nthe specified program with execvp() .  <command-line> is a simple command  with  argu‐\nments  separated  by single spaces. If the program name contains a ’/’, the part after\nthe last ’/’ is taken as ARGV[0]. If the program name is a relative path, the execvp()\nsemantics for finding the program via $PATH apply. After successful program start, so‐‐\ncat writes data to stdin of the process and reads from its stdout using a UNIX  domain\nsocket generated by socketpair() per default. (example)\nOption groups: FD,SOCKET,EXEC,FORK,TERMIOS\nUseful  options:  path, fdin, fdout, chroot, su, su-d, nofork, pty, stderr, ctty, set‐\nsid, pipes, login, sigint, sigquit\nSee also: SYSTEM\n"
                },
                {
                    "name": "FD:<fdnum>",
                    "content": "Uses the file descriptor <fdnum>. It must already exist as valid UN*X file descriptor.\nOption groups: FD (TERMIOS,REG,SOCKET)\nSee also: STDIO, STDIN, STDOUT, STDERR\n"
                },
                {
                    "name": "GOPEN:<filename>",
                    "content": "(Generic open) This address type tries to handle any file system entry except directo‐\nries  usefully.  <filename>  may be a relative or absolute path. If it already exists,\nits type is checked.  In case of a UNIX domain socket, socat connects;  if  connecting\nfails, socat assumes a datagram socket and uses sendto() calls.  If the entry is not a\nsocket, socat opens it applying the OAPPEND flag.  If it does not exist, it is opened\nwith flag OCREAT as a regular file (example).\nOption groups: FD,REG,SOCKET,NAMED,OPEN\nSee also: OPEN, CREATE, UNIX-CONNECT\n"
                },
                {
                    "name": "IP-SENDTO:<host>:<protocol>",
                    "content": "Opens  a raw IP socket. Depending on host specification or option pf, IP protocol ver‐\nsion 4 or 6 is used. It uses <protocol> to send packets to <host> [IP address] and re‐\nceives packets from host, ignores packets from other hosts.  Protocol 255 uses the raw\nsocket with the IP header being part of the data.\nOption groups: FD,SOCKET,IP4,IP6\nUseful options: pf, ttl\nSee also: IP4-SENDTO, IP6-SENDTO, IP-RECVFROM, IP-RECV, UDP-SENDTO, UNIX-SENDTO\n"
                },
                {
                    "name": "INTERFACE:<interface>",
                    "content": "Communicates with a network connected on an interface using raw packets including link\nlevel data. <interface> is the name of the network interface. Currently only available\non Linux.  Option groups: FD,SOCKET\nUseful options: pf, type\nSee also: ip-recv\n"
                },
                {
                    "name": "IP4-SENDTO:<host>:<protocol>",
                    "content": "Like IP-SENDTO, but always uses IPv4.\nOption groups: FD,SOCKET,IP4\n"
                },
                {
                    "name": "IP6-SENDTO:<host>:<protocol>",
                    "content": "Like IP-SENDTO, but always uses IPv6.\nOption groups: FD,SOCKET,IP6\n\n"
                },
                {
                    "name": "IP-DATAGRAM:<address>:<protocol>",
                    "content": "Sends outgoing data to the specified address which may in particular be a broadcast or\nmulticast  address.  Packets  arriving on the local socket are checked if their source\naddresses match RANGE or TCPWRAP options. This address type can for  example  be  used\nfor implementing symmetric or asymmetric broadcast or multicast communications.\nOption groups: FD, SOCKET, IP4, IP6, RANGE\nUseful  options: bind, range, tcpwrap, broadcast, ip-multicast-loop, ip-multicast-ttl,\nip-multicast-if, ip-add-membership, ip-add-source-membership, ttl, tos, pf\nSee also: IP4-DATAGRAM, IP6-DATAGRAM, IP-SENDTO, IP-RECVFROM, IP-RECV, UDP-DATAGRAM\n"
                },
                {
                    "name": "IP4-DATAGRAM:<host>:<protocol>",
                    "content": "Like IP-DATAGRAM, but always uses IPv4.  (example)\nOption groups: FD,SOCKET,IP4,RANGE\n"
                },
                {
                    "name": "IP6-DATAGRAM:<host>:<protocol>",
                    "content": "Like IP-DATAGRAM, but always uses IPv6. Please note that IPv6  does  not  know  broad‐\ncasts.\nOption groups: FD,SOCKET,IP6,RANGE\n\n"
                },
                {
                    "name": "IP-RECVFROM:<protocol>",
                    "content": "Opens  a raw IP socket of <protocol>. Depending on option pf, IP protocol version 4 or\n6 is used. It receives one packet from an unspecified peer and may send  one  or  more\nanswer  packets to that peer.  This mode is particularly useful with fork option where\neach arriving packet - from arbitrary peers - is handled by its own sub process.  This\nallows a behaviour similar to typical UDP based servers like ntpd or named.\nPlease  note  that  the reply packets might be fetched as incoming traffic when sender\nand receiver IP address are identical because there is no port number  to  distinguish\nthe sockets.\nThis  address  works well with IP-SENDTO address peers (see above).  Protocol 255 uses\nthe raw socket with the IP header being part of the data.\nSee the note about RECVFROM addresses.\nOption groups: FD,SOCKET,IP4,IP6,CHILD,RANGE\nUseful options: pf, fork, range, ttl, broadcast\nSee also: IP4-RECVFROM, IP6-RECVFROM, IP-SENDTO, IP-RECV, UDP-RECVFROM, UNIX-RECVFROM\n"
                },
                {
                    "name": "IP4-RECVFROM:<protocol>",
                    "content": "Like IP-RECVFROM, but always uses IPv4.\nOption groups: FD,SOCKET,IP4,CHILD,RANGE\n"
                },
                {
                    "name": "IP6-RECVFROM:<protocol>",
                    "content": "Like IP-RECVFROM, but always uses IPv6.\nOption groups: FD,SOCKET,IP6,CHILD,RANGE\n\n"
                },
                {
                    "name": "IP-RECV:<protocol>",
                    "content": "Opens a raw IP socket of <protocol>. Depending on option pf, IP protocol version 4  or\n6  is  used.  It receives packets from multiple unspecified peers and merges the data.\nNo replies are possible.  It can be, e.g., addressed by socat IP-SENDTO address peers.\nProtocol 255 uses the raw socket with the IP header being part of the data.\nOption groups: FD,SOCKET,IP4,IP6,RANGE\nUseful options: pf, range\nSee also: IP4-RECV, IP6-RECV, IP-SENDTO, IP-RECVFROM, UDP-RECV, UNIX-RECV\n"
                },
                {
                    "name": "IP4-RECV:<protocol>",
                    "content": "Like IP-RECV, but always uses IPv4.\nOption groups: FD,SOCKET,IP4,RANGE\n"
                },
                {
                    "name": "IP6-RECV:<protocol>",
                    "content": "Like IP-RECV, but always uses IPv6.\nOption groups: FD,SOCKET,IP6,RANGE\n\n"
                },
                {
                    "name": "OPEN:<filename>",
                    "content": "Opens <filename> using the open() system call (example).  This operation fails on UNIX\ndomain sockets.\nNote: This address type is rarely useful in bidirectional mode.\nOption groups: FD,REG,NAMED,OPEN\nUseful options: creat, excl, noatime, nofollow, append, rdonly,  wronly,  lock,  read‐\nbytes, ignoreeof\nSee also: CREATE, GOPEN, UNIX-CONNECT\n"
                },
                {
                    "name": "OPENSSL:<host>:<port>",
                    "content": "Tries to establish a SSL connection to <port> [TCP service] on <host> [IP address] us‐\ning TCP/IP version 4 or 6 depending on address specification, name resolution, or  op‐\ntion pf.\nNOTE:  Up  to  version  1.7.2.4  the  server certificate was only checked for validity\nagainst the system certificate store or cafile or capath, but not for match  with  the\nserver’s name or its IP address.  Since version 1.7.3.0 socat checks the peer certifi‐\ncate for match with the <host> parameter or the value of  the  openssl-commonname  op‐\ntion.   Socat  tries  to match it against the certificates subject commonName, and the\ncertificates extension subjectAltName DNS names. Wildcards in the certificate are sup‐\nported.\nOption groups: FD,SOCKET,IP4,IP6,TCP,OPENSSL,RETRY\nUseful  options:  cipher,  verify,  commonname, cafile, capath, certificate, key, com‐\npress, bind, pf, connect-timeout, sourceport, retry\nSee also: OPENSSL-LISTEN, TCP\n"
                },
                {
                    "name": "OPENSSL-LISTEN:<port>",
                    "content": "Listens on tcp <port> [TCP service].  The IP version is 4 or the  one  specified  with\npf. When a connection is accepted, this address behaves as SSL server.\nNote: You probably want to use the certificate option with this address.\nNOTE:  The  client  certificate is only checked for validity against cafile or capath,\nbut not for match with the client’s name or its IP address!\nOption groups: FD,SOCKET,IP4,IP6,TCP,LISTEN,OPENSSL,CHILD,RANGE,RETRY\nUseful options: pf, cipher, verify, commonname, cafile, capath, certificate, key, com‐\npress, fork, bind, range, tcpwrap, su, reuseaddr, retry\nSee also: OPENSSL, TCP-LISTEN\n"
                },
                {
                    "name": "OPENSSL-DTLS-CLIENT:<host>:<port>",
                    "content": "Tries  to  establish  a DTLS connection to <port> [UDP service] on <host> [IP address]\nusing UDP/IP version 4 or 6 depending on address specification,  name  resolution,  or\noption pf.\nSocat  checks the peer certificates subjectAltName or commonName against the addresses\noption openssl-commonname or the host name.  Wildcards in  the  certificate  are  sup‐\nported.\nUse  socat  option  -b to make datagrams small enough to fit with overhead on the net‐\nwork. Use option -T to prevent indefinite hanging when peer went down quietly.\nOption groups: FD,SOCKET,IP4,IP6,OPENSSL,RETRY\nUseful options: cipher, verify, commonname, cafile,  capath,  certificate,  key,  com‐\npress, bind, pf, sourceport, retry\nSee also: OPENSSL-DTLS-SERVER, OPENSSL-CONNECT, UDP-CONNECT\n"
                },
                {
                    "name": "OPENSSL-DTLS-SERVER:<port>",
                    "content": "Listens  on  UDP  <port> [UDP service].  The IP version is 4 or the one specified with\npf. When a connection is accepted, this address behaves as DTLS server.\nNote: You probably want to use the certificate option with this address.\nNOTE: The client certificate is only checked for validity against  cafile  or  capath,\nbut  not  for  match with the client’s name or its IP address!  Use socat option -b to\nmake datagrams small enough to fit with overhead on the network.   Use  option  -T  to\nprevent indefinite hanging when peer went down quietly.\nOption groups: FD,SOCKET,IP4,IP6,LISTEN,OPENSSL,CHILD,RANGE,RETRY\nUseful options: pf, cipher, verify, commonname, cafile, capath, certificate, key, com‐\npress, fork, bind, range, tcpwrap, su, reuseaddr, retry\nSee also: OPENSSL-DTLS-CLIENT, OPENSSL-LISTEN, UDP-LISTEN\n"
                },
                {
                    "name": "PIPE:<filename>",
                    "content": "If <filename> already exists, it is opened.  If it does not exist,  a  named  pipe  is\ncreated and opened. Beginning with socat version 1.4.3, the named pipe is removed when\nthe address is closed (but see option unlink-close\nNote: When a pipe is used for both reading and writing, it works as echo service.\nNote: When a pipe is used for both reading and writing, and socat tries to write  more\nbytes  than  the  pipe can buffer (Linux 2.4: 2048 bytes), socat might block. Consider\nusing socat option, e.g., -b 2048\nOption groups: FD,NAMED,OPEN\nUseful options: rdonly, nonblock, group, user, mode, unlink-early\nSee also: unnamed pipe\n\nPIPE   Creates an unnamed pipe and uses it for reading and writing. It works as an echo,  be‐\ncause everything written to it appeares immediately as read data.\nNote:  When  socat  tries to write more bytes than the pipe can queue (Linux 2.4: 2048\nbytes), socat might block. Consider, e.g., using option -b 2048\nOption groups: FD\nSee also: named pipe\n"
                },
                {
                    "name": "PROXY:<proxy>:<hostname>:<port>",
                    "content": "Connects to an HTTP proxy server on port 8080 using TCP/IP  version 4 or  6  depending\non  address  specification, name resolution, or option pf, and sends a CONNECT request\nfor hostname:port. If the proxy grants access and succeeds to connect to  the  target,\ndata  transfer  between socat and the target can start. Note that the traffic need not\nbe HTTP but can be an arbitrary protocol.\nOption groups: FD,SOCKET,IP4,IP6,TCP,HTTP,RETRY\nUseful options: proxyport, ignorecr, proxyauth, resolve, crnl, bind,  connect-timeout,\nmss, sourceport, retry\nSee also: SOCKS, TCP\n\nPTY    Generates  a  pseudo terminal (pty) and uses its master side. Another process may open\nthe pty’s slave side using it like a serial line or terminal.  (example). If both  the\nptmx and the openpty mechanisms are available, ptmx is used (POSIX).\nOption groups: FD,NAMED,PTY,TERMIOS\nUseful options: link, openpty, wait-slave, mode, user, group\nSee also: UNIX-LISTEN, PIPE, EXEC, SYSTEM\n\nREADLINE\nUses GNU readline and history on stdio to allow editing and reusing input lines (exam‐\nple).\nDue to licensing restrictions the readline feature is disabled in Debian.  See BUGS.\nYou can use STDIO instead.\n"
                },
                {
                    "name": "SCTP-CONNECT:<host>:<port>",
                    "content": "Establishes an SCTP stream connection to the specified <host> [IP address] and  <port>\n[TCP service] using IP version 4 or 6 depending on address specification, name resolu‐\ntion, or option pf.\nOption groups: FD,SOCKET,IP4,IP6,SCTP,CHILD,RETRY\nUseful options: bind, pf, connect-timeout, tos, mtudiscover,  sctp-maxseg,  sctp-node‐\nlay, nonblock, sourceport, retry, readbytes\nSee also: SCTP4-CONNECT, SCTP6-CONNECT, SCTP-LISTEN, TCP-CONNECT\n"
                },
                {
                    "name": "SCTP4-CONNECT:<host>:<port>",
                    "content": "Like SCTP-CONNECT, but only supports IPv4 protocol.\nOption groups: FD,SOCKET,IP4,SCTP,CHILD,RETRY\n"
                },
                {
                    "name": "SCTP6-CONNECT:<host>:<port>",
                    "content": "Like SCTP-CONNECT, but only supports IPv6 protocol.\nOption groups: FD,SOCKET,IP6,SCTP,CHILD,RETRY\n"
                },
                {
                    "name": "SCTP-LISTEN:<port>",
                    "content": "Listens on <port> [TCP service] and accepts an SCTP connection. The IP version is 4 or\nthe one specified with address option pf, socat option (-4, -6), or environment  vari‐\nable  SOCATDEFAULTLISTENIP.   Note that opening this address usually blocks until a\nclient connects.\nOption groups: FD,SOCKET,LISTEN,CHILD,RANGE,IP4,IP6,SCTP,RETRY\nUseful options: crnl, fork, bind,  range,  tcpwrap,  pf,  max-children,  backlog,  ac‐\ncept-timeout, sctp-maxseg, sctp-nodelay, su, reuseaddr, retry, cool-write\nSee also: SCTP4-LISTEN, SCTP6-LISTEN, TCP-LISTEN, SCTP-CONNECT\n"
                },
                {
                    "name": "SCTP4-LISTEN:<port>",
                    "content": "Like SCTP-LISTEN, but only supports IPv4 protocol.\nOption groups: FD,SOCKET,LISTEN,CHILD,RANGE,IP4,SCTP,RETRY\n"
                },
                {
                    "name": "SCTP6-LISTEN:<port>",
                    "content": "Like SCTP-LISTEN, but only supports IPv6 protocol.\nOption groups: FD,SOCKET,LISTEN,CHILD,RANGE,IP6,SCTP,RETRY\n"
                },
                {
                    "name": "SOCKET-CONNECT:<domain>:<protocol>:<remote-address>",
                    "content": "Creates  a  stream  socket  using  the  first  and  second given socket parameters and\nSOCKSTREAM (see man socket(2)) and connects to the remote-address.   The  two  socket\nparameters  have to be specified by int numbers. Consult your OS documentation and in‐\nclude files to find the appropriate values. The remote-address must be the data repre‐\nsentation of a sockaddr structure without safamily and (BSD) salen components.\nPlease  note  that you can - beyond the options of the specified groups - also use op‐\ntions of higher level protocols when you apply socat option -g.\nOption groups: FD,SOCKET,CHILD,RETRY\nUseful options: bind, setsockopt,\nSee also: TCP, UDP-CONNECT, UNIX-CONNECT, SOCKET-LISTEN, SOCKET-SENDTO\n"
                },
                {
                    "name": "SOCKET-DATAGRAM:<domain>:<type>:<protocol>:<remote-address>",
                    "content": "Creates a datagram socket using the first  three  given  socket  parameters  (see  man\nsocket(2))  and sends outgoing data to the remote-address. The three socket parameters\nhave to be specified by int numbers. Consult your OS documentation and  include  files\nto  find the appropriate values. The remote-address must be the data representation of\na sockaddr structure without safamily and (BSD) salen components.\nPlease note that you can - beyond the options of the specified groups - also  use  op‐\ntions of higher level protocols when you apply socat option -g.\nOption groups: FD,SOCKET,RANGE\nUseful options: bind, range, setsockopt,\nSee also: UDP-DATAGRAM, IP-DATAGRAM, SOCKET-SENDTO, SOCKET-RECV, SOCKET-RECVFROM\n"
                },
                {
                    "name": "SOCKET-LISTEN:<domain>:<protocol>:<local-address>",
                    "content": "Creates  a  stream  socket  using  the  first  and  second given socket parameters and\nSOCKSTREAM (see man socket(2)) and waits for incoming connections  on  local-address.\nThe  two  socket parameters have to be specified by int numbers. Consult your OS docu‐\nmentation and include files to find the appropriate values. The local-address must  be\nthe  data  representation  of  a sockaddr structure without safamily and (BSD) salen\ncomponents.\nPlease note that you can - beyond the options of the specified groups - also  use  op‐\ntions of higher level protocols when you apply socat option -g.\nOption groups: FD,SOCKET,LISTEN,RANGE,CHILD,RETRY\nUseful options: setsockopt, setsockopt-listen,\nSee also: TCP, UDP-CONNECT, UNIX-CONNECT, SOCKET-LISTEN, SOCKET-SENDTO, SOCKET-SENDTO\n"
                },
                {
                    "name": "SOCKET-RECV:<domain>:<type>:<protocol>:<local-address>",
                    "content": "Creates a socket using the three given socket parameters (see man socket(2)) and binds\nit to <local-address>. Receives arriving data. The three parameters have to be  speci‐\nfied  by  int numbers. Consult your OS documentation and include files to find the ap‐\npropriate values. The local-address must be the  data  representation  of  a  sockaddr\nstructure without safamily and (BSD) salen components.\nOption groups: FD,SOCKET,RANGE\nUseful options: range, setsockopt, setsockopt-listen\nSee    also:    UDP-RECV,    IP-RECV,   UNIX-RECV,   SOCKET-DATAGRAM,   SOCKET-SENDTO,\nSOCKET-RECVFROM\n"
                },
                {
                    "name": "SOCKET-RECVFROM:<domain>:<type>:<protocol>:<local-address>",
                    "content": "Creates a socket using the three given socket parameters (see man socket(2)) and binds\nit  to  <local-address>.  Receives arriving data and sends replies back to the sender.\nThe first three parameters have to be specified as int numbers. Consult your OS  docu‐\nmentation  and include files to find the appropriate values. The local-address must be\nthe data representation of a sockaddr structure without  safamily  and  (BSD)  salen\ncomponents.\nSee the note about RECVFROM addresses.\nOption groups: FD,SOCKET,CHILD,RANGE\nUseful options: fork, range, setsockopt, setsockopt-listen\nSee  also:  UDP-RECVFROM,  IP-RECVFROM, UNIX-RECVFROM, SOCKET-DATAGRAM, SOCKET-SENDTO,\nSOCKET-RECV\n"
                },
                {
                    "name": "SOCKET-SENDTO:<domain>:<type>:<protocol>:<remote-address>",
                    "content": "Creates a socket using the three given socket parameters (see  man  socket(2)).  Sends\noutgoing data to the given address and receives replies.  The three parameters have to\nbe specified as int numbers. Consult your OS documentation and include files  to  find\nthe  appropriate values. The remote-address must be the data representation of a sock‐\naddr structure without safamily and (BSD) salen components.\nOption groups: FD,SOCKET\nUseful options: bind, setsockopt, setsockopt-listen\nSee   also:   UDP-SENDTO,   IP-SENDTO,   UNIX-SENDTO,   SOCKET-DATAGRAM,   SOCKET-RECV\nSOCKET-RECVFROM\n"
                },
                {
                    "name": "SOCKS4:<socks-server>:<host>:<port>",
                    "content": "Connects  via <socks-server> [IP address] to <host> [IPv4 address] on <port> [TCP ser‐\nvice], using socks version 4 protocol over IP version 4  or  6  depending  on  address\nspecification, name resolution, or option pf (example).\nOption groups: FD,SOCKET,IP4,IP6,TCP,SOCKS4,RETRY\nUseful options: socksuser, socksport, sourceport, pf, retry\nSee also: SOCKS4A, PROXY, TCP\n"
                },
                {
                    "name": "SOCKS4A:<socks-server>:<host>:<port>",
                    "content": "like  SOCKS4, but uses socks protocol version 4a, thus leaving host name resolution to\nthe socks server.\nOption groups: FD,SOCKET,IP4,IP6,TCP,SOCKS4,RETRY\n\nSTDERR Uses file descriptor 2.\nOption groups: FD (TERMIOS,REG,SOCKET)\nSee also: FD\n\nSTDIN  Uses file descriptor 0.\nOption groups: FD (TERMIOS,REG,SOCKET)\nUseful options: readbytes\nSee also: FD\n\nSTDIO  Uses file descriptor 0 for reading, and 1 for writing.\nOption groups: FD (TERMIOS,REG,SOCKET)\nUseful options: readbytes\nSee also: FD\n\nSTDOUT Uses file descriptor 1.\nOption groups: FD (TERMIOS,REG,SOCKET)\nSee also: FD\n"
                },
                {
                    "name": "SYSTEM:<shell-command>",
                    "content": "Forks a sub process that establishes communication with its parent process and invokes\nthe  specified  program with system() . Please note that <shell-command> [string] must\nnot contain ’,’ or \"!!\", and that shell meta characters may have to be protected.  Af‐\nter successful program start, socat writes data to stdin of the process and reads from\nits stdout.\nOption groups: FD,SOCKET,EXEC,FORK,TERMIOS\nUseful options: path, fdin, fdout, chroot, su, su-d, nofork, pty, stderr,  ctty,  set‐\nsid, pipes, sigint, sigquit\nSee also: EXEC\n"
                },
                {
                    "name": "TCP:<host>:<port>",
                    "content": "Connects  to  <port>  [TCP service] on <host> [IP address] using TCP/IP version 4 or 6\ndepending on address specification, name resolution, or option pf.\nOption groups: FD,SOCKET,IP4,IP6,TCP,RETRY\nUseful options: crnl, bind, pf, connect-timeout, tos, mtudiscover, mss, nodelay,  non‐\nblock, sourceport, retry, readbytes\nSee also: TCP4, TCP6, TCP-LISTEN, UDP, SCTP-CONNECT, UNIX-CONNECT\n"
                },
                {
                    "name": "TCP4:<host>:<port>",
                    "content": "Like TCP, but only supports IPv4 protocol (example).\nOption groups: FD,SOCKET,IP4,TCP,RETRY\n"
                },
                {
                    "name": "TCP6:<host>:<port>",
                    "content": "Like TCP, but only supports IPv6 protocol.\nOption groups: FD,SOCKET,IP6,TCP,RETRY\n"
                },
                {
                    "name": "TCP-LISTEN:<port>",
                    "content": "Listens  on  <port> [TCP service] and accepts a TCP/IP connection. The IP version is 4\nor the one specified with address option pf, socat option  (-4,  -6),  or  environment\nvariable SOCATDEFAULTLISTENIP.  Note that opening this address usually blocks until\na client connects.\nOption groups: FD,SOCKET,LISTEN,CHILD,RANGE,IP4,IP6,TCP,RETRY\nUseful options: crnl, fork, bind,  range,  tcpwrap,  pf,  max-children,  backlog,  ac‐\ncept-timeout, mss, su, reuseaddr, retry, cool-write\nSee also: TCP4-LISTEN, TCP6-LISTEN, UDP-LISTEN, SCTP-LISTEN, UNIX-LISTEN, OPENSSL-LIS‐\nTEN, TCP-CONNECT\n"
                },
                {
                    "name": "TCP4-LISTEN:<port>",
                    "content": "Like TCP-LISTEN, but only supports IPv4 protocol (example).\nOption groups: FD,SOCKET,LISTEN,CHILD,RANGE,IP4,TCP,RETRY\n"
                },
                {
                    "name": "TCP6-LISTEN:<port>",
                    "content": "Like TCP-LISTEN, but only supports IPv6 protocol.\nAdditional useful option: ipv6only\nOption groups: FD,SOCKET,LISTEN,CHILD,RANGE,IP6,TCP,RETRY\n"
                },
                {
                    "name": "TUN[:<if-addr>/<bits>]",
                    "content": "Creates a Linux TUN/TAP device and optionally assignes  it  the  address  and  netmask\ngiven  by  the  parameters. The resulting network interface is almost ready for use by\nother processes; socat serves its \"wire side\". This address requires  read  and  write\naccess  to  the tunnel cloning device, usually /dev/net/tun , as well as permission to\nset some ioctl()s.  Option iff-up is required to immediately activate the interface!\nNote: If you intend to transfer packets between two Socat \"wire sides\" you need a pro‐\ntocol that keeps packet boundaries, e.g.UDP; TCP might work with option nodelay.\nOption groups: FD,NAMED,OPEN,TUN\nUseful options: iff-up, tun-device, tun-name, tun-type, iff-no-pi\nSee also: ip-recv\n"
                },
                {
                    "name": "UDP:<host>:<port>",
                    "content": "Connects  to  <port>  [UDP service] on <host> [IP address] using UDP/IP version 4 or 6\ndepending on address specification, name resolution, or option pf.\nPlease note that, due to UDP protocol properties, no real connection  is  established;\ndata  has  to be sent for `connecting’ to the server, and no end-of-file condition can\nbe transported.\nOption groups: FD,SOCKET,IP4,IP6\nUseful options: ttl, tos, bind, sourceport, pf\nSee also: UDP4, UDP6, UDP-LISTEN, TCP, IP\n"
                },
                {
                    "name": "UDP4:<host>:<port>",
                    "content": "Like UDP, but only supports IPv4 protocol.\nOption groups: FD,SOCKET,IP4\n"
                },
                {
                    "name": "UDP6:<host>:<port>",
                    "content": "Like UDP, but only supports IPv6 protocol.\nOption groups: FD,SOCKET,IP6\n"
                },
                {
                    "name": "UDP-DATAGRAM:<address>:<port>",
                    "content": "Sends outgoing data to the specified address which may in particular be a broadcast or\nmulticast  address.  Packets  arriving on the local socket are checked for the correct\nremote port only when option sourceport is used (this is a change with  Socat  version\n1.7.4.0)  and  if  their source addresses match RANGE or TCPWRAP options. This address\ntype can for example be used for implementing symmetric  or  asymmetric  broadcast  or\nmulticast communications.\nOption groups: FD,SOCKET,IP4,IP6,RANGE\nUseful  options: bind, range, tcpwrap, broadcast, ip-multicast-loop, ip-multicast-ttl,\nip-multicast-if, ip-add-membership, ip-add-source-membership, ttl, tos, sourceport, pf\nSee also: UDP4-DATAGRAM, UDP6-DATAGRAM, UDP-SENDTO, UDP-RECVFROM,  UDP-RECV,  UDP-CON‐\nNECT, UDP-LISTEN, IP-DATAGRAM\n"
                },
                {
                    "name": "UDP4-DATAGRAM:<address>:<port>",
                    "content": "Like UDP-DATAGRAM, but only supports IPv4 protocol (example1, example2).\nOption groups: FD,SOCKET,IP4, RANGE\n"
                },
                {
                    "name": "UDP6-DATAGRAM:<address>:<port>",
                    "content": "Like UDP-DATAGRAM, but only supports IPv6 protocol.\nOption groups: FD,SOCKET,IP6,RANGE\n"
                },
                {
                    "name": "UDP-LISTEN:<port>",
                    "content": "Waits  for  a  UDP/IP  packet  arriving on <port> [UDP service] and `connects’ back to\nsender.  The accepted IP version is 4 or the one specified  with  option  pf.   Please\nnote that, due to UDP protocol properties, no real connection is established; data has\nto arrive from the peer first, and no end-of-file condition can be  transported.  Note\nthat opening this address usually blocks until a client connects.\nOption groups: FD,SOCKET,LISTEN,CHILD,RANGE,IP4,IP6\nUseful options: fork, bind, range, pf\nSee also: UDP, UDP4-LISTEN, UDP6-LISTEN, TCP-LISTEN\n"
                },
                {
                    "name": "UDP4-LISTEN:<port>",
                    "content": "Like UDP-LISTEN, but only support IPv4 protocol.\nOption groups: FD,SOCKET,LISTEN,CHILD,RANGE,IP4\n"
                },
                {
                    "name": "UDP6-LISTEN:<port>",
                    "content": "Like UDP-LISTEN, but only support IPv6 protocol.\nOption groups: FD,SOCKET,LISTEN,CHILD,RANGE,IP6\n"
                },
                {
                    "name": "UDP-SENDTO:<host>:<port>",
                    "content": "Communicates with the specified peer socket, defined by <port> [UDP service] on <host>\n[IP address], using UDP/IP version 4 or 6 depending  on  address  specification,  name\nresolution,  or  option  pf.  It  sends packets to and receives packets from that peer\nsocket only.  This address effectively implements a datagram client.   It  works  well\nwith socat UDP-RECVFROM and UDP-RECV address peers.\nOption groups: FD,SOCKET,IP4,IP6\nUseful options: ttl, tos, bind, sourceport, pf\nSee  also:  UDP4-SENDTO, UDP6-SENDTO, UDP-RECVFROM, UDP-RECV, UDP-CONNECT, UDP-LISTEN,\nIP-SENDTO\n"
                },
                {
                    "name": "UDP4-SENDTO:<host>:<port>",
                    "content": "Like UDP-SENDTO, but only supports IPv4 protocol.\nOption groups: FD,SOCKET,IP4\n"
                },
                {
                    "name": "UDP6-SENDTO:<host>:<port>",
                    "content": "Like UDP-SENDTO, but only supports IPv6 protocol.\nOption groups: FD,SOCKET,IP6\n"
                },
                {
                    "name": "UDP-RECVFROM:<port>",
                    "content": "Creates a UDP socket on <port> [UDP service] using UDP/IP version 4 or 6 depending  on\noption  pf.   It receives one packet from an unspecified peer and may send one or more\nanswer packets to that peer. This mode is particularly useful with fork  option  where\neach  arriving packet - from arbitrary peers - is handled by its own sub process. This\nallows a behaviour similar to typical UDP based servers like ntpd or named.  This  ad‐\ndress works well with socat UDP-SENDTO address peers.\nNote:  When  the  second address fails before entering the transfer loop the packet is\ndropped. Use option retry or forever on the second address to avoid data loss.\nOption groups: FD,SOCKET,IP4,IP6,CHILD,RANGE\nUseful options: fork, ttl, tos, bind, sourceport, pf\nSee also: UDP4-RECVFROM, UDP6-RECVFROM, UDP-SENDTO, UDP-RECV, UDP-CONNECT, UDP-LISTEN,\nIP-RECVFROM, UNIX-RECVFROM\n"
                },
                {
                    "name": "UDP4-RECVFROM:<port>",
                    "content": "Like UDP-RECVFROM, but only supports IPv4 protocol.\nOption groups: FD,SOCKET,IP4,CHILD,RANGE\n"
                },
                {
                    "name": "UDP6-RECVFROM:<port>",
                    "content": "Like UDP-RECVFROM, but only supports IPv6 protocol.\nOption groups: FD,SOCKET,IP6,CHILD,RANGE\n"
                },
                {
                    "name": "UDP-RECV:<port>",
                    "content": "Creates  a UDP socket on <port> [UDP service] using UDP/IP version 4 or 6 depending on\noption pf.  It receives packets from multiple unspecified peers and merges  the  data.\nNo  replies are possible. It works well with, e.g., socat UDP-SENDTO address peers; it\nbehaves similar to a syslog server.\nNote: if you need the fork option, use UDP-RECVFROM in unidirectional mode  (with  op‐\ntion -u) instead.\nOption groups: FD,SOCKET,IP4,IP6,RANGE\nUseful options: pf, bind, sourceport, ttl, tos\nSee  also:  UDP4-RECV,  UDP6-RECV,  UDP-SENDTO, UDP-RECVFROM, UDP-CONNECT, UDP-LISTEN,\nIP-RECV, UNIX-RECV\n"
                },
                {
                    "name": "UDP4-RECV:<port>",
                    "content": "Like UDP-RECV, but only supports IPv4 protocol.\nOption groups: FD,SOCKET,IP4,RANGE\n"
                },
                {
                    "name": "UDP6-RECV:<port>",
                    "content": "Like UDP-RECV, but only supports IPv6 protocol.\nOption groups: FD,SOCKET,IP6,RANGE\n"
                },
                {
                    "name": "UNIX-CONNECT:<filename>",
                    "content": "Connects to <filename> assuming it is a UNIX domain socket.  If  <filename>  does  not\nexist,  this is an error; if <filename> is not a UNIX domain socket, this is an error;\nif <filename> is a UNIX domain socket, but no process is listening, this is an error.\nOption groups: FD,SOCKET,NAMED,RETRY,UNIX\n) Useful options: bind\nSee also: UNIX-LISTEN, UNIX-SENDTO, TCP\n"
                },
                {
                    "name": "UNIX-LISTEN:<filename>",
                    "content": "Listens on <filename> using a UNIX domain stream socket and accepts a connection.   If\n<filename>  exists and is not a socket, this is an error.  If <filename> exists and is\na UNIX domain socket, binding to the address fails (use option  unlink-early!).   Note\nthat  opening this address usually blocks until a client connects.  Beginning with so‐\ncat version 1.4.3, the file system entry is removed when this address is  closed  (but\nsee option unlink-close) (example).\nOption groups: FD,SOCKET,NAMED,LISTEN,CHILD,RETRY,UNIX\nUseful options: fork, umask, mode, user, group, unlink-early\nSee also: UNIX-CONNECT, UNIX-RECVFROM, UNIX-RECV, TCP-LISTEN\n"
                },
                {
                    "name": "UNIX-SENDTO:<filename>",
                    "content": "Communicates  with the specified peer socket, defined by [<filename>] assuming it is a\nUNIX domain datagram socket.  It sends packets to and receives packets from that  peer\nsocket  only.   Please  note that it might be necessary to bind the local socket to an\naddress (e.g. /tmp/sock1, which must not exist before).  This address type works  well\nwith socat UNIX-RECVFROM and UNIX-RECV address peers.\nOption groups: FD,SOCKET,NAMED,UNIX\nUseful options: bind\nSee also: UNIX-RECVFROM, UNIX-RECV, UNIX-CONNECT, UDP-SENDTO, IP-SENDTO\n"
                },
                {
                    "name": "UNIX-RECVFROM:<filename>",
                    "content": "Creates  a UNIX domain datagram socket [<filename>].  Receives one packet and may send\none or more answer packets to that peer.  This mode is particularly useful  with  fork\noption  where  each arriving packet - from arbitrary peers - is handled by its own sub\nprocess.  This address works well with socat UNIX-SENDTO address peers.\nOption groups: FD,SOCKET,NAMED,CHILD,UNIX\nSee the note about RECVFROM addresses.\nUseful options: fork\nSee also: UNIX-SENDTO, UNIX-RECV, UNIX-LISTEN, UDP-RECVFROM, IP-RECVFROM\n"
                },
                {
                    "name": "UNIX-RECV:<filename>",
                    "content": "Creates a UNIX domain datagram socket [<filename>].  Receives  packets  from  multiple\nunspecified  peers and merges the data.  No replies are possible. It can be, e.g., ad‐\ndressed by socat UNIX-SENDTO address peers.  It behaves similar to a syslog server.\nOption groups: FD,SOCKET,NAMED,UNIX\nSee also: UNIX-SENDTO, UNIX-RECVFROM, UNIX-LISTEN, UDP-RECV, IP-RECV\n"
                },
                {
                    "name": "UNIX-CLIENT:<filename>",
                    "content": "Communicates with the specified peer socket, defined by [<filename>] assuming it is  a\nUNIX  domain  socket.   It  first tries to connect and, if that fails, assumes it is a\ndatagram socket, thus supporting both types.\nOption groups: FD,SOCKET,NAMED,UNIX\nUseful options: bind\nSee also: UNIX-CONNECT, UNIX-SENDTO, GOPEN\n"
                },
                {
                    "name": "VSOCK-CONNECT:<cid>:<port>",
                    "content": "Establishes a VSOCK stream connection to the specified <cid> [VSOCK  cid]  and  <port>\n[VSOCK port].\nOption groups: FD,SOCKET,CHILD,RETRY\nUseful options: bind, pf, connect-timeout, retry, readbytes\nSee also: VSOCK-LISTEN,\n"
                },
                {
                    "name": "VSOCK-LISTEN:<port>",
                    "content": "Listens on <port> [VSOCK port] and accepts a VSOCK connection.  Note that opening this\naddress usually blocks until a client connects.\nOption groups: FD,SOCKET,LISTEN,CHILD,RETRY\nUseful  options:  fork,  bind,  pf,  max-children,  backlog,  su,  reuseaddr,   retry,\ncool-write\nSee also: VSOCK-CONNECT\n"
                },
                {
                    "name": "ABSTRACT-CONNECT:<string>",
                    "content": ""
                },
                {
                    "name": "ABSTRACT-LISTEN:<string>",
                    "content": ""
                },
                {
                    "name": "ABSTRACT-SENDTO:<string>",
                    "content": ""
                },
                {
                    "name": "ABSTRACT-RECVFROM:<string>",
                    "content": ""
                },
                {
                    "name": "ABSTRACT-RECV:<string>",
                    "content": ""
                },
                {
                    "name": "ABSTRACT-CLIENT:<string>",
                    "content": "The  ABSTRACT addresses are almost identical to the related UNIX addresses except that\nthey do not address file system based sockets but an  alternate  UNIX  domain  address\nspace.  To  achieve this the socket address strings are prefixed with \"\\0\" internally.\nThis feature is available (only?) on Linux.  Option groups are the same  as  with  the\nrelated UNIX addresses, except that the ABSTRACT addresses are not member of the NAMED\ngroup.\n\n"
                }
            ]
        },
        "ADDRESS OPTIONS": {
            "content": "Address options can be applied to address specifications to influence the process of  opening\nthe addresses and the properties of the resulting data channels.\n\nFor technical reasons not every option can be applied to every address type; e.g., applying a\nsocket option to a regular file will fail. To catch most useless combinations as early as  in\nthe  open  phase,  the concept of option groups was introduced. Each option belongs to one or\nmore option groups. Options can be used only with address types that support at least one  of\ntheir option groups (but see option -g).\n\nAddress options have data types that their values must conform to.  Every address option con‐\nsists of just a keyword or a keyword followed by \"=value\", where value must  conform  to  the\noptions  type.  Some address options manipulate parameters of system calls; e.g., option sync\nsets the OSYNC flag with the open() call.  Other options cause a  system  or  library  call;\ne.g.,  with option `ttl=value’ the setsockopt(fd, SOLIP, IPTTL, value, sizeof(int)) call is\napplied.  Other options set internal socat variables that  are  used  during  data  transfer;\ne.g.,  `crnl’  causes explicit character conversions.  A few options have more complex imple‐\nmentations; e.g., su-d (substuser-delayed) inquires some user and group infos,  stores  them,\nand applies them later after a possible chroot() call.\n\nIf  multiple options are given to an address, their sequence in the address specification has\n(almost) no effect on the sequence of their execution/application. Instead, socat  has  built\nin  an option phase model that tries to bring the options in a useful order. Some options ex‐\nist in different forms (e.g., unlink, unlink-early, unlink-late) to control the time of their\nexecution.\n\nIf  the  same option is specified more than once within one address specification, with equal\nor different values, the effect depends on the kind of option. Options resulting in  function\ncalls  like  setsockopt()  cause multiple invocations. With options that set parameters for a\nrequired call like open() or set internal flags, the value of the last option  occurrence  is\neffective.\n\nThe  existence  or semantics of many options are system dependent. Socat usually does NOT try\nto emulate missing libc or kernel features, it just provides an interface to  the  underlying\nsystem.  So,  if an operating system lacks a feature, the related option is simply not avail‐\nable on this platform.\n\nThe following paragraphs introduce just the more common address options. For a  more  compre‐\nhensive  reference  and to find information about canonical option names, alias names, option\nphases, and platforms see file xio.help.\n\n",
            "subsections": [
                {
                    "name": "FD option group",
                    "content": "This option group contains options that are applied to a UN*X style file descriptor, no  mat‐\nter how it was generated.  Because all current socat address types are file descriptor based,\nthese options may be applied to any address.\nNote: Some of these options are also member of another option group, that  provides  another,\nnon-fd based mechanism.  For these options, it depends on the actual address type and its op‐\ntion groups which mechanism is used. The second, non-fd based mechanism is prioritized.\n"
                },
                {
                    "name": "cloexec=<bool>",
                    "content": "Sets the FDCLOEXEC flag with the fcntl() system call to value  <bool>.  If  set,  the\nfile  descriptor  is  closed on exec() family function calls. Socat internally handles\nthis flag for the fds it controls, so in most cases there will be  no  need  to  apply\nthis option.\n\nsetlk  Tries to set a discretionary write lock to the whole file using the fcntl(fd, FSETLK,\n...)  system call. If the file is already locked, this call results in an  error.   On\nLinux,  when  the file permissions for group are \"S\" (g-x,g+s), and the file system is\nlocally mounted with the \"mand\" option, the lock is  mandatory,  i.e.  prevents  other\nprocesses from opening the file.\n\nsetlkw Tries  to set a discretionary waiting write lock to the whole file using the fcntl(fd,\nFSETLKW, ...)  system call. If the file is already locked, this call blocks.  See op‐\ntion setlk for information about making this lock mandatory.\n"
                },
                {
                    "name": "setlk-rd",
                    "content": "Tries  to set a discretionary read lock to the whole file using the fcntl(fd, FSETLK,\n...)  system call. If the file is already write locked, this call results in an error.\nSee option setlk for information about making this lock mandatory.\n"
                },
                {
                    "name": "setlkw-rd",
                    "content": "Tries  to  set a discretionary waiting read lock to the whole file using the fcntl(fd,\nFSETLKW, ...)  system call. If the file is already write locked,  this  call  blocks.\nSee option setlk for information about making this lock mandatory.\n"
                },
                {
                    "name": "flock-ex",
                    "content": "Tries  to  set  a  blocking  exclusive  advisory  lock to the file using the flock(fd,\nLOCKEX) system call. Socat hangs in this call  if  the  file  is  locked  by  another\nprocess.\n"
                },
                {
                    "name": "flock-ex-nb",
                    "content": "Tries  to  set  a  nonblocking exclusive advisory lock to the file using the flock(fd,\nLOCKEX|LOCKNB) system call. If the file is already locked, this option results in an\nerror.\n"
                },
                {
                    "name": "flock-sh",
                    "content": "Tries  to set a blocking shared advisory lock to the file using the flock(fd, LOCKSH)\nsystem call. Socat hangs in this call if the file is locked by another process.\n"
                },
                {
                    "name": "flock-sh-nb",
                    "content": "Tries to set a nonblocking shared advisory  lock  to  the  file  using  the  flock(fd,\nLOCKSH|LOCKNB) system call. If the file is already locked, this option results in an\nerror.\n\nlock   Sets a blocking lock on the file. Uses the  setlk  or  flock  mechanism  depending  on\navailability  on  the  particular  platform.  If both are available, the POSIX variant\n(setlkw) is used.\n"
                },
                {
                    "name": "user=<user>",
                    "content": "Sets the <user> (owner) of the stream.  If the address is member of the  NAMED  option\ngroup,  socat  uses  the  chown() system call after opening the file or binding to the\nUNIX domain socket (race condition!).  Without filesystem entry, socat sets  the  user\nof  the  stream using the fchown() system call.  These calls might require root privi‐\nlege.\n"
                },
                {
                    "name": "user-late=<user>",
                    "content": "Sets the owner of the fd to <user> with the fchown() system call after opening or con‐\nnecting the channel.  This is useful only on file system entries.\n"
                },
                {
                    "name": "group=<group>",
                    "content": "Sets  the  <group> of the stream.  If the address is member of the NAMED option group,\nsocat uses the chown() system call after opening the file or binding to the  UNIX  do‐\nmain  socket (race condition!).  Without filesystem entry, socat sets the group of the\nstream with the fchown() system call.  These calls might require group  membership  or\nroot privilege.\n"
                },
                {
                    "name": "group-late=<group>",
                    "content": "Sets  the  group  of  the fd to <group> with the fchown() system call after opening or\nconnecting the channel.  This is useful only on file system entries.\n"
                },
                {
                    "name": "mode=<mode>",
                    "content": "Sets the <mode> [modet] (permissions) of the stream.  If the address is member of the\nNAMED  option  group  and  uses  the  open() or creat() call, the mode is applied with\nthese.  If the address is member of the NAMED option group without using these  system\ncalls,  socat uses the chmod() system call after opening the filesystem entry or bind‐\ning to the UNIX domain socket (race condition!).  Otherwise, socat sets  the  mode  of\nthe stream using fchmod() .  These calls might require ownership or root privilege.\n"
                },
                {
                    "name": "perm-late=<mode>",
                    "content": "Sets the permissions of the fd to value <mode> [modet] using the fchmod() system call\nafter opening or connecting the channel.  This is useful only on file system entries.\n"
                },
                {
                    "name": "append=<bool>",
                    "content": "Always writes data to the actual end of file.  If the address is member  of  the  OPEN\noption  group,  socat  uses  the  OAPPEND flag with the open() system call (example).\nOtherwise, socat applies the fcntl(fd, FSETFL, OAPPEND) call.\n"
                },
                {
                    "name": "nonblock=<bool>",
                    "content": "Tries to open or use file in nonblocking mode. Its only effects are that the connect()\ncall  of  TCP addresses does not block, and that opening a named pipe for reading does\nnot block.  If the address is member of the OPEN option group, socat uses  the  ONON‐\nBLOCK  flag  with  the  open()  system  call.   Otherwise, socat applies the fcntl(fd,\nFSETFL, ONONBLOCK) call.\n\nbinary Opens the file in binary mode to avoid implicit line terminator conversions (Cygwin).\n\ntext   Opens the file in text mode to force implicit line terminator conversions (Cygwin).\n"
                },
                {
                    "name": "noinherit",
                    "content": "Does not keep this file open in a spawned process (Cygwin).\n"
                },
                {
                    "name": "cool-write",
                    "content": "Takes it easy when write fails with EPIPE or ECONNRESET and logs the message with  no‐\ntice  level  instead of error.  This prevents the log file from being filled with use‐\nless error messages when socat is used as a high volume server or proxy where  clients\noften abort the connection.\nThis option is experimental.\n"
                },
                {
                    "name": "end-close",
                    "content": "Changes  the  (address dependent) method of ending a connection to just close the file\ndescriptors. This is useful when the connection is to be  reused  by  or  shared  with\nother processes (example).\nNormally,  socket  connections  will  be  ended  with shutdown(2) which terminates the\nsocket even if it is shared by multiple processes.  close(2) \"unlinks\" the socket from\nthe process but keeps it active as long as there are still links from other processes.\nSimilarly, when an address of type EXEC or SYSTEM is ended, socat usually will explic‐\nitly kill the sub process. With this option, it will just close the file descriptors.\n"
                },
                {
                    "name": "shut-none",
                    "content": "Changes the (address dependent) method of shutting down the write part of a connection\nto not do anything.\n"
                },
                {
                    "name": "shut-down",
                    "content": "Changes the (address dependent) method of shutting down the write part of a connection\nto shutdown(fd, SHUTWR). Is only useful with sockets.\n"
                },
                {
                    "name": "shut-close",
                    "content": "Changes the (address dependent) method of shutting down the write part of a connection\nto close(fd).\n"
                },
                {
                    "name": "shut-null",
                    "content": "When one address indicates EOF, socat will send a zero sized packet to the write chan‐\nnel of the other address to transfer the EOF condition. This is useful  with  UDP  and\nother  datagram  protocols.  Has  been  tested  against  netcat  and socat with option\nnull-eof.\n"
                },
                {
                    "name": "null-eof",
                    "content": "Normally socat will ignore empty (zero size  payload)  packets  arriving  on  datagram\nsockets,  so  it survives port scans. With this option socat interprets empty datagram\npackets as EOF indicator (see shut-null).\n"
                },
                {
                    "name": "ioctl-void=<request>",
                    "content": "Calls ioctl() with the request value as second argument and NULL  as  third  argument.\nThis option allows utilizing ioctls that are not explicitly implemented in socat.\n"
                },
                {
                    "name": "ioctl-int=<request>:<value>",
                    "content": "Calls ioctl() with the request value as second argument and the integer value as third\nargument.\n"
                },
                {
                    "name": "ioctl-intp=<request>:<value>",
                    "content": "Calls ioctl() with the request value as second argument and a pointer to  the  integer\nvalue as third argument.\n"
                },
                {
                    "name": "ioctl-bin=<request>:<value>",
                    "content": "Calls  ioctl()  with  the  request value as second argument and a pointer to the given\ndata value as third argument. This data must be specified in <dalan> form.\n"
                },
                {
                    "name": "ioctl-string=<request>:<value>",
                    "content": "Calls ioctl() with the request value as second argument and a  pointer  to  the  given\nstring as third argument.  <dalan> form.\n\n"
                },
                {
                    "name": "NAMED option group",
                    "content": "These options work on file system entries.\nPlease  note that, with UNIX domain client addresses, this means the bind entry, not the tar‐\nget/peer entry.\nSee also options user, group, and mode.\n"
                },
                {
                    "name": "user-early=<user>",
                    "content": "Changes the <user> (owner) of the file system entry before  accessing  it,  using  the\nchown() system call. This call might require root privilege.\n"
                },
                {
                    "name": "group-early=<group>",
                    "content": "Changes  the  <group>  of the file system entry before accessing it, using the chown()\nsystem call. This call might require group membership or root privilege.\n"
                },
                {
                    "name": "perm-early=<mode>",
                    "content": "Changes the <mode> [modet] of the file system entry before accessing  it,  using  the\nchmod() system call. This call might require ownership or root privilege.\n"
                },
                {
                    "name": "umask=<mode>",
                    "content": "Sets  the umask of the process to <mode> [modet] before accessing the file system en‐\ntry (useful with UNIX domain sockets!). This call might affect all further  operations\nof the socat process!\n"
                },
                {
                    "name": "unlink-early",
                    "content": "Unlinks (removes) the file before opening it and even before applying user-early etc.\n\nunlink Unlinks (removes) the file before accessing it, but after user-early etc.\n"
                },
                {
                    "name": "unlink-late",
                    "content": "Unlinks  (removes)  the  file  after opening it to make it inaccessible for other pro‐\ncesses after a short race condition.\n"
                },
                {
                    "name": "unlink-close",
                    "content": "Removes the addresses file system entry when closing the address.   For  named  pipes,\nUNIX  domain  sockets,  and the symbolic links of pty addresses, the default is 1; for\ncreated files, opened files, and generic opened files the default is 0.\n\n"
                },
                {
                    "name": "OPEN option group",
                    "content": "The OPEN group options allow setting flags with the open() system call.  E.g., option `creat’\nsets the OCREAT flag.\nSee also options append and nonblock.\n"
                },
                {
                    "name": "creat=<bool>",
                    "content": "Creates the file if it does not exist (example).\n"
                },
                {
                    "name": "dsync=<bool>",
                    "content": "Blocks write() calls until metainfo is physically written to media.\n"
                },
                {
                    "name": "excl=<bool>",
                    "content": "With option creat, if file exists this is an error.\n"
                },
                {
                    "name": "largefile=<bool>",
                    "content": "On 32 bit systems, allows a file larger than 2^31 bytes.\n"
                },
                {
                    "name": "noatime",
                    "content": "Sets the ONOATIME options, so reads do not change the access timestamp.\n"
                },
                {
                    "name": "noctty=<bool>",
                    "content": "Does not make this file the controlling terminal.\n"
                },
                {
                    "name": "nofollow=<bool>",
                    "content": "Does not follow symbolic links.\n"
                },
                {
                    "name": "nshare=<bool>",
                    "content": "Does not allow sharing this file with other processes.\n"
                },
                {
                    "name": "rshare=<bool>",
                    "content": "Does not allow other processes to open this file for writing.\n"
                },
                {
                    "name": "rsync=<bool>",
                    "content": "Blocks write() until metainfo is physically written to media.\n"
                },
                {
                    "name": "sync=<bool>",
                    "content": "Blocks write() until data is physically written to media.\n"
                },
                {
                    "name": "rdonly=<bool>",
                    "content": "Opens the file for reading only.\n"
                },
                {
                    "name": "wronly=<bool>",
                    "content": "Opens the file for writing only.\n\ntrunc  Truncates the file to size 0 during opening it.\n\n"
                },
                {
                    "name": "REG and BLK option group",
                    "content": "These  options  are usually applied to a UN*X file descriptor, but their semantics make sense\nonly on a file supporting random access.\n"
                },
                {
                    "name": "seek=<offset>",
                    "content": "Applies the lseek(fd, <offset>, SEEKSET) (or lseek64 ) system call, thus  positioning\nthe file pointer absolutely to <offset> [offt or off64t]. Please note that a missing\nvalue defaults to 1, not 0.\n"
                },
                {
                    "name": "seek-cur=<offset>",
                    "content": "Applies the lseek(fd, <offset>, SEEKCUR) (or lseek64 ) system call, thus  positioning\nthe  file pointer <offset> [offt or off64t] bytes relatively to its current position\n(which is usually 0). Please note that a missing value defaults to 1, not 0.\n"
                },
                {
                    "name": "seek-end=<offset>",
                    "content": "Applies the lseek(fd, <offset>, SEEKEND) (or lseek64 ) system call, thus  positioning\nthe  file  pointer  <offset>  [offt or off64t] bytes relatively to the files current\nend. Please note that a missing value defaults to 1, not 0.\n"
                },
                {
                    "name": "ftruncate=<offset>",
                    "content": "Applies the ftruncate(fd, <offset>) (or ftruncate64 if available)  system  call,  thus\ntruncating  the  file  at the position <offset> [offt or off64t]. Please note that a\nmissing value defaults to 1, not 0.\n"
                },
                {
                    "name": "secrm=<bool>",
                    "content": ""
                },
                {
                    "name": "unrm=<bool>",
                    "content": ""
                },
                {
                    "name": "compr=<bool>",
                    "content": ""
                },
                {
                    "name": "fs-sync=<bool>",
                    "content": ""
                },
                {
                    "name": "immutable=<bool>",
                    "content": ""
                },
                {
                    "name": "fs-append=<bool>",
                    "content": ""
                },
                {
                    "name": "nodump=<bool>",
                    "content": ""
                },
                {
                    "name": "fs-noatime=<bool>",
                    "content": ""
                },
                {
                    "name": "journal-data=<bool>",
                    "content": ""
                },
                {
                    "name": "notail=<bool>",
                    "content": ""
                },
                {
                    "name": "dirsync=<bool>",
                    "content": "These options change non standard file attributes on operating systems and  file  sys‐\ntems that support these features, like Linux with ext2fs and successors, xfs, or reis‐\nerfs. See man 1 chattr for information on these options. Please note that there  might\nbe a race condition between creating the file and applying these options.\n\n"
                },
                {
                    "name": "PROCESS option group",
                    "content": "Options  of this group change the process properties instead of just affecting one data chan‐\nnel.  For EXEC and SYSTEM addresses and for LISTEN and CONNECT  type  addresses  with  option\nFORK, these options apply to the child processes instead of the main socat process.\n"
                },
                {
                    "name": "chroot=<directory>",
                    "content": "Performs  a  chroot() operation to <directory> after processing the address (example).\nThis call might require root privilege.\n"
                },
                {
                    "name": "chroot-early=<directory>",
                    "content": "Performs a chroot() operation to <directory> before opening  the  address.  This  call\nmight require root privilege.\n"
                },
                {
                    "name": "setgid=<group>",
                    "content": "Changes  the  primary  <group>  of the process after processing the address. This call\nmight require root privilege. Please note that this option does not drop  other  group\nrelated privileges.\n"
                },
                {
                    "name": "setgid-early=<group>",
                    "content": "Like setgit but is performed before opening the address.\n"
                },
                {
                    "name": "setuid=<user>",
                    "content": "Changes  the  <user>  (owner)  of  the process after processing the address. This call\nmight require root privilege. Please note that this option does not drop group related\nprivileges. Check if option su better fits your needs.\n"
                },
                {
                    "name": "setuid-early=<user>",
                    "content": "Like setuid but is performed before opening the address.\n"
                },
                {
                    "name": "su=<user>",
                    "content": "Changes the <user> (owner) and groups of the process after processing the address (ex‐\nample). This call might require root privilege.\n"
                },
                {
                    "name": "su-d=<user>",
                    "content": "Short name for substuser-delayed.  Changes  the  <user>  (owner)  and  groups  of  the\nprocess after processing the address (example).  The user and his groups are retrieved\nbefore a possible chroot() . This call might require root privilege.\n\nsetpgid=<pidt>\nMakes the process a member of the specified process group  <pidt>.  If  no  value  is\ngiven, or if the value is 0 or 1, the process becomes leader of a new process group.\n\nsetsid Makes the process the leader of a new session (example).\n\n"
                },
                {
                    "name": "READLINE option group",
                    "content": "Due to licensing restrictions the readline feature is disabled in Debian (see BUGS).\nThese options apply to the readline address type.\n"
                },
                {
                    "name": "history=<filename>",
                    "content": "Reads and writes history from/to <filename> (example).\n"
                },
                {
                    "name": "noprompt",
                    "content": "Since  version  1.4.0,  socat  per  default tries to determine a prompt - that is then\npassed to the readline call - by remembering the last incomplete line of  the  output.\nWith  this option, socat does not pass a prompt to readline, so it begins line editing\nin the first column of the terminal.\n"
                },
                {
                    "name": "noecho=<pattern>",
                    "content": "Specifies a regular pattern for a prompt that prevents the following input  line  from\nbeing  displayed on the screen and from being added to the history.  The prompt is de‐\nfined as the text that was output to the readline address after  the  lastest  newline\ncharacter  and  before  an input character was typed. The pattern is a regular expres‐\nsion, e.g.  \"^[Pp]assword:.*$\" or \"([Uu]ser:|[Pp]assword:)\". See regex(7) for details.\n(example)\n"
                },
                {
                    "name": "prompt=<string>",
                    "content": "Passes the string as prompt to the readline function. readline prints this prompt when\nstepping through the history. If this string matches a constant prompt  issued  by  an\ninteractive  program  on  the  other  socat  address,  consistent look and feel can be\nachieved.\n\n"
                },
                {
                    "name": "APPLICATION option group",
                    "content": "This group contains options that work at data level.  Note that these options only  apply  to\nthe \"raw\" data transferred by socat, but not to protocol data used by addresses like PROXY.\n\ncr     Converts  the  default  line  termination  character NL (’\\n’, 0x0a) to/from CR (’\\r’,\n0x0d) when writing/reading on this channel.\n\ncrnl   Converts the default line termination character NL (’\\n’, 0x0a) to/from CRNL  (\"\\r\\n\",\n0x0d0a) when writing/reading on this channel (example).  Note: socat simply strips all\nCR characters.\n"
                },
                {
                    "name": "ignoreeof",
                    "content": "When EOF occurs on this channel, socat ignores it and tries to read  more  data  (like\n\"tail -f\") (example).\n"
                },
                {
                    "name": "readbytes=<bytes>",
                    "content": "socat  reads  only  so many bytes from this address (the address provides only so many\nbytes for transfer and pretends to be at EOF afterwards).  Must be greater than 0.\n"
                },
                {
                    "name": "lockfile=<filename>",
                    "content": "If lockfile exists, exits with error. If lockfile does not exist, creates it and  con‐\ntinues, unlinks lockfile on exit.\n"
                },
                {
                    "name": "waitlock=<filename>",
                    "content": "If  lockfile  exists, waits until it disappears. When lockfile does not exist, creates\nit and continues, unlinks lockfile on exit.\n"
                },
                {
                    "name": "escape=<int>",
                    "content": "Specifies the numeric code of a character that triggers EOF on the input stream. It is\nuseful with a terminal in raw mode (example).\n\n"
                },
                {
                    "name": "SOCKET option group",
                    "content": "These options are intended for all kinds of sockets, e.g. IP or UNIX domain. Most are applied\nwith a setsockopt() call.\n"
                },
                {
                    "name": "bind=<sockname>",
                    "content": "Binds the socket to the given socket address using the bind() system call. The form of\n<sockname>  is  socket  domain dependent: IP4 and IP6 allow the form [hostname|hostad‐\ndress][:(service|port)] (example), UNIX domain sockets require <filename>, VSOCK allow\nthe form [cid][:(port)].\n"
                },
                {
                    "name": "connect-timeout=<seconds>",
                    "content": "Abort the connection attempt after <seconds> [timeval] with error status.\n"
                },
                {
                    "name": "so-bindtodevice=<interface>",
                    "content": "Binds the socket to the given <interface>.  This option might require root privilege.\n"
                },
                {
                    "name": "broadcast",
                    "content": "For  datagram sockets, allows sending to broadcast addresses and receiving packets ad‐\ndressed to broadcast addresses.\n\ndebug  Enables socket debugging.\n"
                },
                {
                    "name": "dontroute",
                    "content": "Only communicates with directly connected peers, does not use routers.\n"
                },
                {
                    "name": "keepalive",
                    "content": "Enables sending keepalives on the socket.\n"
                },
                {
                    "name": "linger=<seconds>",
                    "content": "Blocks shutdown() or close() until data transfers have finished or the  given  timeout\n[int] expired.\n"
                },
                {
                    "name": "oobinline",
                    "content": "Places out-of-band data in the input data stream.\n"
                },
                {
                    "name": "priority=<priority>",
                    "content": "Sets the protocol defined <priority> [<int>] for outgoing packets.\n"
                },
                {
                    "name": "rcvbuf=<bytes>",
                    "content": "Sets  the  size  of the receive buffer after the socket() call to <bytes> [int].  With\nTCP sockets, this value corresponds to the socket’s maximal window size.\n"
                },
                {
                    "name": "rcvbuf-late=<bytes>",
                    "content": "Sets the size of the receive buffer when the socket is already  connected  to  <bytes>\n[int].  With TCP sockets, this value corresponds to the socket’s maximal window size.\n"
                },
                {
                    "name": "rcvlowat=<bytes>",
                    "content": "Specifies  the minimum number of received bytes [int] until the socket layer will pass\nthe buffered data to socat.\n"
                },
                {
                    "name": "reuseaddr",
                    "content": "Allows other sockets to bind to an address even if parts of it (e.g. the  local  port)\nare already in use by socat (example).\n"
                },
                {
                    "name": "sndbuf=<bytes>",
                    "content": "Sets the size of the send buffer after the socket() call to <bytes> [int].\n"
                },
                {
                    "name": "sndbuf-late=<bytes>",
                    "content": "Sets the size of the send buffer when the socket is connected to <bytes> [int].\n"
                },
                {
                    "name": "sndlowat=<bytes>",
                    "content": "Specifies  the  minimum number of bytes in the send buffer until the socket layer will\nsend the data to <bytes> [int].\n"
                },
                {
                    "name": "pf=<string>",
                    "content": "Forces the use of the specified IP version or protocol. <string> can be something like\n\"ip4\" or \"ip6\". The resulting value is used as first argument to the socket() or sock‐\netpair() calls.  This option affects address resolution and  the  required  syntax  of\nbind and range options.\n"
                },
                {
                    "name": "type=<type>",
                    "content": "Sets  the  type of the socket, specified as second argument to the socket() or socket‐\npair() calls, to <type> [int]. Address resolution is not affected by this option.  Un‐\nder  Linux,  1  means stream oriented socket, 2 means datagram socket, and 3 means raw\nsocket.\n"
                },
                {
                    "name": "protocol",
                    "content": "Sets the protocol of the socket, specified as third argument to the socket() or  sock‐\netpair()  calls,  to  <protocol> [int]. Address resolution is not affected by this op‐\ntion.  6 means TCP, 17 means UDP.\n"
                },
                {
                    "name": "reuseport",
                    "content": "Set the SOREUSEPORT socket option.\n"
                },
                {
                    "name": "so-timestamp",
                    "content": "Sets the SOTIMESTAMP socket option. This enables receiving and logging  of  timestamp\nancillary messages.\n"
                },
                {
                    "name": "setsockopt=<level>:<optname>:<optval>",
                    "content": "Invokes  setsockopt() for the socket with the given parameters. level [int] is used as\nsecond argument to setsockopt() and specifies the layer, e.g. SOLTCP for  TCP  (6  on\nLinux),  or  SOLSOCKET  for the socket layer (1 on Linux). optname [int] is the third\nargument to setsockopt() and tells which socket option is to be set.  For  the  actual\nnumbers  you  might  have to look up the appropriate include files of your system. For\nthe 4th and 5th setsockopt() parameters, value [dalan] specifies an arbitrary sequence\nof  bytes  that are passed to the function per pointer, with the automatically derived\nlength parameter.\n"
                },
                {
                    "name": "setsockopt-int=<level>:<optname>:<optval>",
                    "content": "Like setsockopt, but <optval> is a pointer to int [int]\n"
                },
                {
                    "name": "setsockopt-listen=<level>:<optname>:<optval>",
                    "content": "Like setsockopt, but for listen type addresses it is applied to the  listening  socket\ninstead of the connected socket.\n"
                },
                {
                    "name": "setsockopt-string=<level>:<optname>:<optval>",
                    "content": "Like setsockopt, but <optval> is a string.  This string is passed to the function with\ntrailing null character, and the length parameter is automatically  derived  from  the\ndata.\n\n"
                },
                {
                    "name": "UNIX option group",
                    "content": "These options apply to UNIX domain based addresses.\n"
                },
                {
                    "name": "unix-tightsocklen=[0|1]",
                    "content": "On  socket  operations,  pass  a socket address length that does not include the whole\nstruct sockaddrun record but (besides other components) only the relevant part of the\nfilename or abstract string. Default is 1.\n\n"
                },
                {
                    "name": "IP4 and IP6 option groups",
                    "content": "These options can be used with IPv4 and IPv6 based sockets.\n"
                },
                {
                    "name": "tos=<tos>",
                    "content": "Sets  the  TOS  (type  of  service) field of outgoing packets to <tos> [byte] (see RFC\n791).\n"
                },
                {
                    "name": "ttl=<ttl>",
                    "content": "Sets the TTL (time to live) field of outgoing packets to <ttl> [byte].\n"
                },
                {
                    "name": "ip-options=<data>",
                    "content": "Sets IP options like source routing. Must be given in binary form, recommended  format\nis  a  leading  \"x\"  followed by an even number of hex digits. This option may be used\nmultiple times, data are appended.  E.g., to connect to host 10.0.0.1 via some gateway\nusing  a  loose  source  route,  use  the gateway as address parameter and set a loose\nsource route using the option ip-options=x8307040a000001 .\nIP options are defined in RFC 791.\n"
                },
                {
                    "name": "mtudiscover=<0|1|2>",
                    "content": "Takes 0, 1, 2 to never, want, or always use path MTU discover on this socket.\n"
                },
                {
                    "name": "ip-pktinfo",
                    "content": "Sets the IPPKTINFO socket option. This enables receiving  and  logging  of  ancillary\nmessages containing destination address and interface (Linux) (example).\n"
                },
                {
                    "name": "ip-recverr",
                    "content": "Sets  the  IPRECVERR  socket  option. This enables receiving and logging of ancillary\nmessages containing detailed error information.\n"
                },
                {
                    "name": "ip-recvopts",
                    "content": "Sets the IPRECVOPTS socket option. This enables receiving and logging of  IP  options\nancillary messages (Linux, *BSD).\n"
                },
                {
                    "name": "ip-recvtos",
                    "content": "Sets  the IPRECVTOS socket option. This enables receiving and logging of TOS (type of\nservice) ancillary messages (Linux).\n"
                },
                {
                    "name": "ip-recvttl",
                    "content": "Sets the IPRECVTTL socket option. This enables receiving and logging of TTL (time  to\nlive) ancillary messages (Linux, *BSD).\n"
                },
                {
                    "name": "ip-recvdstaddr",
                    "content": "Sets the IPRECVDSTADDR socket option. This enables receiving and logging of ancillary\nmessages containing destination address (*BSD) (example).\n"
                },
                {
                    "name": "ip-recvif",
                    "content": "Sets the IPRECVIF socket option. This enables receiving and logging of interface  an‐\ncillary messages (*BSD) (example).\n"
                },
                {
                    "name": "ip-add-membership=<multicast-address:interface-address>",
                    "content": ""
                },
                {
                    "name": "ip-add-membership=<multicast-address:interface-name>",
                    "content": ""
                },
                {
                    "name": "ip-add-membership=<multicast-address:interface-index>",
                    "content": ""
                },
                {
                    "name": "ip-add-membership=<multicast-address:interface-address:interface-name>",
                    "content": ""
                },
                {
                    "name": "ip-add-membership=<multicast-address:interface-address:interface-index>",
                    "content": "Makes  the  socket member of the specified multicast group. This is currently only im‐\nplemented for IPv4. The option takes the IP address of the multicast  group  and  info\nabout  the  desired  network interface. The most common syntax is the first one, while\nthe others are only available on systems that provide struct mreqn (Linux).\nThe indices of active network interfaces can be shown using the utility procan.\n"
                },
                {
                    "name": "ip-add-source-membership=<multicast-address:interface-address:source-address>",
                    "content": "Makes the socket member of the specified multicast group  for  the  specified  source,\ni.e.  only  multicast traffic from this address is to be delivered.  This is currently\nonly implemented for IPv4.\n"
                },
                {
                    "name": "ip-multicast-if=<hostname>",
                    "content": "Specifies hostname or address of the network interface to be used for multicast  traf‐\nfic.\n"
                },
                {
                    "name": "ip-multicast-loop=<bool>",
                    "content": "Specifies if outgoing multicast traffic should loop back to the interface.\n"
                },
                {
                    "name": "ip-multicast-ttl=<byte>",
                    "content": "Sets the TTL used for outgoing multicast traffic. Default is 1.\n"
                },
                {
                    "name": "ip-transparent",
                    "content": "Sets the IPTRANSPARENT socket option.  This option might require root privilege.\n"
                },
                {
                    "name": "res-debug",
                    "content": ""
                },
                {
                    "name": "res-aaonly",
                    "content": ""
                },
                {
                    "name": "res-usevc",
                    "content": ""
                },
                {
                    "name": "res-primary",
                    "content": ""
                },
                {
                    "name": "res-igntc",
                    "content": ""
                },
                {
                    "name": "res-recurse",
                    "content": ""
                },
                {
                    "name": "res-defnames",
                    "content": ""
                },
                {
                    "name": "res-stayopen",
                    "content": ""
                },
                {
                    "name": "res-dnsrch",
                    "content": "These  options  set the corresponding resolver (name resolution) option flags.  Append\n\"=0\" to clear a default option. See man resolver(5) for more information on these  op‐\ntions. Note: these options are valid only for the address they are applied to.\n"
                },
                {
                    "name": "IP6 option group",
                    "content": "These  options can only be used on IPv6 based sockets. See IP options for options that can be\napplied to both IPv4 and IPv6 sockets.\n"
                },
                {
                    "name": "ipv6only=<bool>",
                    "content": "Sets the IPV6V6ONLY socket option. If 0, the TCP stack will also  accept  connections\nusing IPv4 protocol on the same port. The default is system dependent.\n"
                },
                {
                    "name": "ipv6-recvdstopts",
                    "content": "Sets  the IPV6RECVDSTOPTS socket option. This enables receiving and logging of ancil‐\nlary messages containing the destination options.\n"
                },
                {
                    "name": "ipv6-recvhoplimit",
                    "content": "Sets the IPV6RECVHOPLIMIT socket option. This enables receiving and logging of ancil‐\nlary messages containing the hoplimit.\n"
                },
                {
                    "name": "ipv6-recvhopopts",
                    "content": "Sets  the IPV6RECVHOPOPTS socket option. This enables receiving and logging of ancil‐\nlary messages containing the hop options.\n"
                },
                {
                    "name": "ipv6-recvpktinfo",
                    "content": "Sets the IPV6RECVPKTINFO socket option. This enables receiving and logging of  ancil‐\nlary messages containing destination address and interface.\n\nipv6-unicast-hops=link(TYPEINT)(<int>)\nSets the IPV6UNICASTHOPS socket option. This sets the hop count limit (TTL) for out‐\ngoing unicast packets.\n"
                },
                {
                    "name": "ipv6-recvrthdr",
                    "content": "Sets the IPV6RECVRTHDR socket option. This enables receiving and logging of ancillary\nmessages containing routing information.\n"
                },
                {
                    "name": "ipv6-tclass",
                    "content": "Sets the IPV6TCLASS socket option. This sets the transfer class of outgoing packets.\n"
                },
                {
                    "name": "ipv6-recvtclass",
                    "content": "Sets  the  IPV6RECVTCLASS socket option. This enables receiving and logging of ancil‐\nlary messages containing the transfer class.\n\n"
                },
                {
                    "name": "TCP option group",
                    "content": "These options may be applied to TCP sockets. They work by invoking setsockopt() with the  ap‐\npropriate parameters.\n\ncork   Doesn’t send packets smaller than MSS (maximal segment size).\n"
                },
                {
                    "name": "defer-accept",
                    "content": "While listening, accepts connections only when data from the peer arrived.\n"
                },
                {
                    "name": "keepcnt=<count>",
                    "content": "Sets the number of keepalives before shutting down the socket to <count> [int].\n"
                },
                {
                    "name": "keepidle=<seconds>",
                    "content": "Sets the idle time before sending the first keepalive to <seconds> [int].\n"
                },
                {
                    "name": "keepintvl=<seconds>",
                    "content": "Sets the interval between two keepalives to <seconds> [int].\n"
                },
                {
                    "name": "linger2=<seconds>",
                    "content": "Sets the time to keep the socket in FIN-WAIT-2 state to <seconds> [int].\n"
                },
                {
                    "name": "mss=<bytes>",
                    "content": "Sets  the  MSS  (maximum  segment size) after the socket() call to <bytes> [int]. This\nvalue is then proposed to the peer with the SYN or SYN/ACK packet (example).\n"
                },
                {
                    "name": "mss-late=<bytes>",
                    "content": "Sets the MSS of the socket after connection has been established to <bytes> [int].\n"
                },
                {
                    "name": "nodelay",
                    "content": "Turns off the Nagle algorithm for measuring the RTT (round trip time).\n"
                },
                {
                    "name": "rfc1323",
                    "content": "Enables RFC1323 TCP options: TCP window scale, round-trip time measurement (RTTM), and\nprotect against wrapped sequence numbers (PAWS) (AIX).\n\nstdurg Enables RFC1122 compliant urgent pointer handling (AIX).\n"
                },
                {
                    "name": "syncnt=<count>",
                    "content": "Sets the maximal number of SYN retransmits during connect to <count> [int].\n\nmd5sig Enables generation of MD5 digests on the packets (FreeBSD).\n\nnoopt  Disables use of TCP options (FreeBSD, MacOSX).\n\nnopush sets the TCPNOPUSH socket option (FreeBSD, MacOSX).\n"
                },
                {
                    "name": "sack-disable",
                    "content": "Disables use the selective acknowledge feature (OpenBSD).\n"
                },
                {
                    "name": "signature-enable",
                    "content": "Enables generation of MD5 digests on the packets (OpenBSD).\n"
                },
                {
                    "name": "abort-threshold=<milliseconds>",
                    "content": "Sets the time to wait for an answer of the peer on an established connection (HP-UX).\n"
                },
                {
                    "name": "conn-abort-threshold=<milliseconds>",
                    "content": "Sets the time to wait for an answer of the server during the initial connect (HP-UX).\n"
                },
                {
                    "name": "keepinit",
                    "content": "Sets  the  time to wait for an answer of the server during connect() before giving up.\nValue in half seconds, default is 150 (75s) (Tru64).\n\npaws   Enables the \"protect against wrapped sequence numbers\" feature (Tru64).\n"
                },
                {
                    "name": "sackena",
                    "content": "Enables selective acknowledge (Tru64).\n"
                },
                {
                    "name": "tsoptena",
                    "content": "Enables the time stamp option that allows RTT recalculation  on  existing  connections\n(Tru64).\n\n"
                },
                {
                    "name": "UDP option group",
                    "content": "This option may be applied to UDP datagram sockets.\n"
                },
                {
                    "name": "udp-ignore-peerport>",
                    "content": "Address UDP-DATAGRAM expects incoming responses to come from the port specified in its\nsecond parameter. With this option, it accepts packets coming from any port.\n\n"
                },
                {
                    "name": "SCTP option group",
                    "content": "These options may be applied to SCTP stream sockets.\n"
                },
                {
                    "name": "sctp-nodelay",
                    "content": "Sets the SCTPNODELAY socket option that disables the Nagle algorithm.\n"
                },
                {
                    "name": "sctp-maxseg=<bytes>",
                    "content": "Sets the SCTPMAXSEG socket option to <bytes> [int].  This value is then  proposed  to\nthe peer with the SYN or SYN/ACK packet.\n\n"
                },
                {
                    "name": "UDP, TCP, and SCTP option group",
                    "content": "Here we find options that are related to the network port mechanism and thus can be used with\nUDP, TCP, and SCTP client and server addresses.\n"
                },
                {
                    "name": "sourceport=<port>",
                    "content": "For outgoing (client) TCP and UDP connections, it sets the source <port> using an  ex‐\ntra  bind()  call.  With TCP or UDP listen addresses, socat immediately shuts down the\nconnection if the  client  does  not  use  this  sourceport.  UDP-RECV,  UDP-RECVFROM,\nUDP-SENDTO, and UDP-DATAGRAM addresses ignore the packet when it does not match.  (ex‐\nample).\n"
                },
                {
                    "name": "lowport",
                    "content": "Outgoing (client) TCP and UDP connections with this option use an unused random source\nport  between  640  and 1023 incl. On UNIX class operating systems, this requires root\nprivilege, and thus indicates that the client process is  authorized  by  local  root.\nTCP  and UDP listen addresses with this option immediately shut down the connection if\nthe client does not use a sourceport <= 1023.  This mechanism can provide limited  au‐\nthorization under some circumstances.\n\n"
                },
                {
                    "name": "SOCKS option group",
                    "content": "When using SOCKS type addresses, some socks specific options can be set.\n"
                },
                {
                    "name": "socksport=<tcp service>",
                    "content": "Overrides the default \"socks\" service or port 1080 for the socks server port with <TCP\nservice>.\n"
                },
                {
                    "name": "socksuser=<user>",
                    "content": "Sends the <user> [string] in the username field to the socks server.  Default  is  the\nactual user name ($LOGNAME or $USER) (example).\n\n"
                },
                {
                    "name": "HTTP option group",
                    "content": "Options that can be provided with HTTP type addresses. The only HTTP address currently imple‐\nmented is proxy-connect.\n"
                },
                {
                    "name": "proxyport=<TCP service>",
                    "content": "Overrides the default HTTP proxy port 8080 with <TCP service>.\n"
                },
                {
                    "name": "ignorecr",
                    "content": "The HTTP protocol requires the use of CR+NL as line terminator. When  a  proxy  server\nviolates  this  standard,  socat might not understand its answer.  This option directs\nsocat to interprete NL as line terminator and to ignore CR in  the  answer.  Neverthe‐\nless, socat sends CR+NL to the proxy.\n"
                },
                {
                    "name": "proxy-authorization=<username>:<password>",
                    "content": "Provide \"basic\" authentication to the proxy server. The argument to the option is used\nwith a \"Proxy-Authorization: Basic\" header in base64 encoded form.\nNote: username and password are visible for every user on the  local  machine  in  the\nprocess  list;  username  and password are transferred to the proxy server unencrypted\n(base64 encoded) and might be sniffed.\n"
                },
                {
                    "name": "proxy-authorization-file=<filename>",
                    "content": "Like option proxy-authorization, but the credentials are read from the file and there‐\nfore not visible in the process list.\n"
                },
                {
                    "name": "resolve",
                    "content": "Per  default,  socat  sends to the proxy a CONNECT request containing the target host‐\nname. With this option, socat resolves the hostname locally and sends the IP  address.\nPlease note that, according to RFC 2396, only name resolution to IPv4 addresses is im‐\nplemented.\n\n"
                },
                {
                    "name": "RANGE option group",
                    "content": "These options check if a connecting client should be granted access. They can be  applied  to\nlistening and receiving network sockets. tcp-wrappers options fall into this group.\n"
                },
                {
                    "name": "range=<address-range>",
                    "content": "After  accepting  a connection, tests if the peer is within range. For IPv4 addresses,\naddress-range takes the form address/bits, e.g.   10.0.0.0/8,  or  address:mask,  e.g.\n10.0.0.0:255.0.0.0  (example); for IPv6, it is [ip6-address]/bits, e.g. [::1]/128.  If\nthe client address does not match, socat refuses  the  connection  attempt,  issues  a\nwarning, and keeps listening/receiving.\n"
                },
                {
                    "name": "tcpwrap[=<name>]",
                    "content": "Uses  Wietse  Venema’s libwrap (tcpd) library to determine if the client is allowed to\nconnect. The configuration files are /etc/hosts.allow and /etc/hosts.deny per default,\nsee  \"man  5  hostsaccess\" for more information. The optional <name> (type string) is\npassed to the wrapper functions as daemon process name  (example).   If  omitted,  the\nbasename  of socats invocation (argv[0]) is passed.  If both tcpwrap and range options\nare applied to an address, both conditions must be fulfilled to allow the connection.\n"
                },
                {
                    "name": "allow-table=<filename>",
                    "content": "Takes the specified file instead of /etc/hosts.allow.\n"
                },
                {
                    "name": "deny-table=<filename>",
                    "content": "Takes the specified file instead of /etc/hosts.deny.\n"
                },
                {
                    "name": "tcpwrap-etc=<directoryname>",
                    "content": "Looks for hosts.allow and hosts.deny in the specified directory. Is overridden by  op‐\ntions hosts-allow and hosts-deny.\n\n"
                },
                {
                    "name": "LISTEN option group",
                    "content": "Options specific to listening sockets.\n"
                },
                {
                    "name": "backlog=<count>",
                    "content": "Sets  the backlog value passed with the listen() system call to <count> [int]. Default\nis 5.\n"
                },
                {
                    "name": "accept-timeout=<seconds>",
                    "content": "End waiting for a connection after <seconds> [timeval] with error status.\n"
                },
                {
                    "name": "max-children=<count>",
                    "content": "Limits the number of concurrent child processes [int].  Default is no limit.\n\n"
                },
                {
                    "name": "CHILD option group",
                    "content": "Options for addresses with multiple connections via child processes.\n\nfork   After establishing a connection, handles its channel in a child process and keeps  the\nparent  process attempting to produce more connections, either by listening or by con‐\nnecting in a loop (example).\nOPENSSL-CONNECT and OPENSSL-LISTEN differ in when they actually fork  off  the  child:\nOPENSSL-LISTEN forks before the SSL handshake, while OPENSSL-CONNECT forks afterwards.\nretry and forever options are not inherited by the child process.\nOn some operating systems (e.g. FreeBSD) this option does not work for UDP-LISTEN  ad‐\ndresses.\n\n"
                },
                {
                    "name": "EXEC option group",
                    "content": "Options for addresses that invoke a program.\n"
                },
                {
                    "name": "path=<string>",
                    "content": "Overrides  the PATH environment variable for searching the program with <string>. This\n$PATH value is effective in the child process too.\n\nlogin  Prefixes argv[0] for the execvp() call with ’-’, thus making a shell behave  as  login\nshell.\n\n"
                },
                {
                    "name": "FORK option group",
                    "content": "EXEC or SYSTEM addresses invoke a program using a child process and transfer data between so‐‐\ncat and the program. The interprocess communication mechanism can be influenced with the fol‐\nlowing  options.  Per  default, a socketpair() is created and assigned to stdin and stdout of\nthe child process, while stderr is inherited from the socat process, and  the  child  process\nuses file descriptors 0 and 1 for communicating with the main socat process.\n\nnofork Does  not  fork a subprocess for executing the program, instead calls execvp() or sys‐\ntem() directly from the actual socat instance. This avoids  the  overhead  of  another\nprocess between the program and its peer, but introduces a lot of restrictions:\n\no      this option can only be applied to the second socat address.\n\no      it cannot be applied to a part of a dual address.\n\no      the first socat address cannot be OPENSSL or READLINE\n\no      socat options -b, -t, -D, -l, -v, -x become useless\n\no      for both addresses, options ignoreeof, cr, and crnl become useless\n\no      for  the second address (the one with option nofork), options append,  cloexec, flock,\nuser, group, mode, nonblock, perm-late, setlk, and setpgid cannot be applied. Some  of\nthese could be used on the first address though.\n\npipes  Creates  a  pair  of  unnamed pipes for interprocess communication instead of a socket\npair.\n"
                },
                {
                    "name": "openpty",
                    "content": "Establishes communication with the sub process using a pseudo  terminal  created  with\nopenpty() instead of the default (socketpair or ptmx).\n\nptmx   Establishes  communication  with  the  sub  process using a pseudo terminal created by\nopening /dev/ptmx or /dev/ptc instead of the default (socketpair).\n\npty    Establishes communication with the sub process using a pseudo terminal  instead  of  a\nsocket pair. Creates the pty with an available mechanism. If openpty and ptmx are both\navailable, it uses ptmx because this is POSIX compliant (example).\n\nctty   Makes the pty the controlling tty of the sub process (example).\n\nstderr Directs stderr of the sub process to its output channel by making stderr  a  dup()  of\nstdout (example).\n"
                },
                {
                    "name": "fdin=<fdnum>",
                    "content": "Assigns  the  sub  processes  input  channel to its file descriptor <fdnum> instead of\nstdin (0). The program started from the subprocess has to use this fd for reading data\nfrom socat (example).\n"
                },
                {
                    "name": "fdout=<fdnum>",
                    "content": "Assigns  the  sub  processes  output channel to its file descriptor <fdnum> instead of\nstdout (1). The program started from the subprocess has to use  this  fd  for  writing\ndata to socat (example).\n"
                },
                {
                    "name": "sighup, sigint, sigquit",
                    "content": "Has  socat  pass  signals of this type to the sub process.  If no address has this op‐\ntion, socat terminates on these signals.\n\n"
                },
                {
                    "name": "TERMIOS option group",
                    "content": "For addresses that work on a tty (e.g., stdio, file:/dev/tty, exec:...,pty), the terminal pa‐\nrameters  defined  in the UN*X termios mechanism are made available as address option parame‐\nters.  Please note that changes of the parameters of your interactive terminal remain  effec‐\ntive  after  socat’s  termination,  so you might have to enter \"reset\" or \"stty sane\" in your\nshell afterwards.  For EXEC and SYSTEM addresses with option PTY, these options apply to  the\npty by the child processes.\n\nb0     Disconnects the terminal.\n\nb19200 Sets the serial line speed to 19200 baud. Some other rates are possible; use something\nlike socat -hh |grep ’ b[1-9]’ to find all speeds supported by your implementation.\nNote: On some operating systems, these options may not be available. Use ispeed or os‐\npeed instead.\n"
                },
                {
                    "name": "echo=<bool>",
                    "content": "Enables or disables local echo.\n"
                },
                {
                    "name": "icanon=<bool>",
                    "content": "Sets or clears canonical mode, enabling line buffering and some special characters.\n\nraw    Sets  raw mode, thus passing input and output almost unprocessed. This option is obso‐\nlete, use option rawer or cfmakeraw instead.\n\nrawer  Makes terminal rawer than raw option. This option implicitly turns  off  echo.  (exam‐\nple).\n"
                },
                {
                    "name": "cfmakeraw",
                    "content": "Sets  raw mode by invoking cfmakeraw() or by simulating this call. This option implic‐\nitly turns off echo.\n"
                },
                {
                    "name": "ignbrk=<bool>",
                    "content": "Ignores or interpretes the BREAK character (e.g., ^C)\n"
                },
                {
                    "name": "brkint=<bool>",
                    "content": ""
                },
                {
                    "name": "bs0",
                    "content": ""
                },
                {
                    "name": "bs1",
                    "content": ""
                },
                {
                    "name": "bsdly=<0|1>",
                    "content": ""
                },
                {
                    "name": "clocal=<bool>",
                    "content": ""
                },
                {
                    "name": "cr0",
                    "content": ""
                },
                {
                    "name": "cr1",
                    "content": ""
                },
                {
                    "name": "cr2",
                    "content": ""
                },
                {
                    "name": "cr3",
                    "content": "Sets the carriage return delay to 0, 1, 2, or 3, respectively.  0 means no delay,  the\nother values are terminal dependent.\n"
                },
                {
                    "name": "crdly=<0|1|2|3>",
                    "content": ""
                },
                {
                    "name": "cread=<bool>",
                    "content": ""
                },
                {
                    "name": "crtscts=<bool>",
                    "content": ""
                },
                {
                    "name": "cs5",
                    "content": ""
                },
                {
                    "name": "cs6",
                    "content": ""
                },
                {
                    "name": "cs7",
                    "content": ""
                },
                {
                    "name": "cs8",
                    "content": "Sets the character size to 5, 6, 7, or 8 bits, respectively.\n"
                },
                {
                    "name": "csize=<0|1|2|3>",
                    "content": ""
                },
                {
                    "name": "cstopb=<bool>",
                    "content": "Sets two stop bits, rather than one.\n"
                },
                {
                    "name": "dsusp=<byte>",
                    "content": "Sets  the  value for the VDSUSP character that suspends the current foreground process\nand reactivates the shell (all except Linux).\n"
                },
                {
                    "name": "echoctl=<bool>",
                    "content": "Echos control characters in hat notation (e.g. ^A)\n"
                },
                {
                    "name": "echoe=<bool>",
                    "content": ""
                },
                {
                    "name": "echok=<bool>",
                    "content": ""
                },
                {
                    "name": "echoke=<bool>",
                    "content": ""
                },
                {
                    "name": "echonl=<bool>",
                    "content": ""
                },
                {
                    "name": "echoprt=<bool>",
                    "content": ""
                },
                {
                    "name": "eof=<byte>",
                    "content": ""
                },
                {
                    "name": "eol=<byte>",
                    "content": ""
                },
                {
                    "name": "eol2=<byte>",
                    "content": ""
                },
                {
                    "name": "erase=<byte>",
                    "content": ""
                },
                {
                    "name": "discard=<byte>",
                    "content": ""
                },
                {
                    "name": "ff0",
                    "content": ""
                },
                {
                    "name": "ff1",
                    "content": ""
                },
                {
                    "name": "ffdly=<bool>",
                    "content": ""
                },
                {
                    "name": "flusho=<bool>",
                    "content": ""
                },
                {
                    "name": "hupcl=<bool>",
                    "content": ""
                },
                {
                    "name": "icrnl=<bool>",
                    "content": ""
                },
                {
                    "name": "iexten=<bool>",
                    "content": ""
                },
                {
                    "name": "igncr=<bool>",
                    "content": ""
                },
                {
                    "name": "ignpar=<bool>",
                    "content": ""
                },
                {
                    "name": "imaxbel=<bool>",
                    "content": ""
                },
                {
                    "name": "inlcr=<bool>",
                    "content": ""
                },
                {
                    "name": "inpck=<bool>",
                    "content": ""
                },
                {
                    "name": "intr=<byte>",
                    "content": ""
                },
                {
                    "name": "isig=<bool>",
                    "content": ""
                },
                {
                    "name": "ispeed=<unsigned-int>",
                    "content": "Set the baud rate for incoming data on this line.\nSee also: ospeed, b19200\n"
                },
                {
                    "name": "istrip=<bool>",
                    "content": ""
                },
                {
                    "name": "iuclc=<bool>",
                    "content": ""
                },
                {
                    "name": "ixany=<bool>",
                    "content": ""
                },
                {
                    "name": "ixoff=<bool>",
                    "content": ""
                },
                {
                    "name": "ixon=<bool>",
                    "content": ""
                },
                {
                    "name": "kill=<byte>",
                    "content": ""
                },
                {
                    "name": "lnext=<byte>",
                    "content": ""
                },
                {
                    "name": "min=<byte>",
                    "content": "nl0    Sets the newline delay to 0.\n"
                },
                {
                    "name": "nl1",
                    "content": ""
                },
                {
                    "name": "nldly=<bool>",
                    "content": ""
                },
                {
                    "name": "noflsh=<bool>",
                    "content": ""
                },
                {
                    "name": "ocrnl=<bool>",
                    "content": ""
                },
                {
                    "name": "ofdel=<bool>",
                    "content": ""
                },
                {
                    "name": "ofill=<bool>",
                    "content": ""
                },
                {
                    "name": "olcuc=<bool>",
                    "content": ""
                },
                {
                    "name": "onlcr=<bool>",
                    "content": ""
                },
                {
                    "name": "onlret=<bool>",
                    "content": ""
                },
                {
                    "name": "onocr=<bool>",
                    "content": ""
                },
                {
                    "name": "opost=<bool>",
                    "content": "Enables or disables output processing; e.g., converts NL to CR-NL.\n"
                },
                {
                    "name": "ospeed=<unsigned-int>",
                    "content": "Set the baud rate for outgoing data on this line.\nSee also: ispeed, b19200\n"
                },
                {
                    "name": "parenb=<bool>",
                    "content": "Enable parity generation on output and parity checking for input.\n"
                },
                {
                    "name": "parmrk=<bool>",
                    "content": ""
                },
                {
                    "name": "parodd=<bool>",
                    "content": ""
                },
                {
                    "name": "pendin=<bool>",
                    "content": ""
                },
                {
                    "name": "quit=<byte>",
                    "content": ""
                },
                {
                    "name": "reprint=<byte>",
                    "content": "sane   Brings the terminal to something like a useful default state.\n"
                },
                {
                    "name": "start=<byte>",
                    "content": ""
                },
                {
                    "name": "stop=<byte>",
                    "content": ""
                },
                {
                    "name": "susp=<byte>",
                    "content": ""
                },
                {
                    "name": "swtc=<byte>",
                    "content": ""
                },
                {
                    "name": "tab0",
                    "content": ""
                },
                {
                    "name": "tab1",
                    "content": ""
                },
                {
                    "name": "tab2",
                    "content": ""
                },
                {
                    "name": "tab3",
                    "content": ""
                },
                {
                    "name": "tabdly=<unsigned-int>",
                    "content": ""
                },
                {
                    "name": "time=<byte>",
                    "content": ""
                },
                {
                    "name": "tostop=<bool>",
                    "content": ""
                },
                {
                    "name": "vt0",
                    "content": ""
                },
                {
                    "name": "vt1",
                    "content": ""
                },
                {
                    "name": "vtdly=<bool>",
                    "content": ""
                },
                {
                    "name": "werase=<byte>",
                    "content": ""
                },
                {
                    "name": "xcase=<bool>",
                    "content": ""
                },
                {
                    "name": "xtabs",
                    "content": ""
                },
                {
                    "name": "i-pop-all",
                    "content": "With UNIX System V STREAMS, removes all drivers from the stack.\n"
                },
                {
                    "name": "i-push=<string>",
                    "content": "With UNIX System V STREAMS, pushes the driver (module) with the  given  name  (string)\nonto  the stack. For example, to make sure that a character device on Solaris supports\ntermios          etc,          use          the           following           options:\ni-pop-all,i-push=ptem,i-push=ldterm,i-push=ttcompat\n\n"
                },
                {
                    "name": "PTY option group",
                    "content": "These options are intended for use with the pty address type.\n"
                },
                {
                    "name": "link=<filename>",
                    "content": "Generates  a symbolic link that points to the actual pseudo terminal (pty). This might\nhelp to solve the problem that ptys are generated  with  more  or  less  unpredictable\nnames,  making  it difficult to directly access the socat generated pty automatically.\nWith this option, the user can specify a \"fix\" point in the file hierarchy that  helps\nhim  to access the actual pty (example).  Beginning with socat version 1.4.3, the sym‐\nbolic link is removed when the address is closed (but see option unlink-close).\n"
                },
                {
                    "name": "wait-slave",
                    "content": "Blocks the open phase until a process opens the slave side of the pty.  Usually, socat\ncontinues  after generating the pty with opening the next address or with entering the\ntransfer loop. With the wait-slave option, socat waits until some  process  opens  the\nslave side of the pty before continuing.  This option only works if the operating sys‐\ntem provides the poll() system call. And it depends on an  undocumented  behaviour  of\npty’s,  so  it does not work on all operating systems. It has successfully been tested\non Linux, FreeBSD, NetBSD, and on Tru64 with openpty.\n"
                },
                {
                    "name": "pty-interval=<seconds>",
                    "content": "When the wait-slave option is set, socat periodically checks the HUP  condition  using\npoll()  to  find if the pty’s slave side has been opened. The default polling interval\nis 1s. Use the pty-interval option [timeval] to change this value.\n\n"
                },
                {
                    "name": "OPENSSL option group",
                    "content": "These options apply to the openssl and openssl-listen address types.\n"
                },
                {
                    "name": "cipher=<cipherlist>",
                    "content": "Selects the list of ciphers that may be used for the connection.  See the man page  of\nciphers  ,  section CIPHER LIST FORMAT, for detailed information about syntax, values,\nand default of <cipherlist>.\nSeveral cipher strings may be given, separated by ’:’.  Some simple cipher strings:\n\n3DES   Uses a cipher suite with triple DES.\n\nMD5    Uses a cipher suite with MD5.\n\naNULL  Uses a cipher suite without authentication.\n\nNULL   Does not use encryption.\n\nHIGH   Uses a cipher suite with \"high\" encryption.  Note that the peer must support  the  se‐\nlected property, or the negotiation will fail.\n"
                },
                {
                    "name": "method=<ssl-method>",
                    "content": "This  option  is  based  on  deprecated functions and is only available when socat was\nbuild with option --with-openssl-method.  Sets the protocol version to be used.  Valid\nstrings (not case sensitive) are:\n\nSSL2   Select SSL protocol version 2.\n\nSSL3   Select SSL protocol version 3.\n\nSSL23  Select the best available SSL or TLS protocol.\n\nTLS1   Select TLS protocol version 1.\n\nTLS1.1 Select TLS protocol version 1.1.\n\nTLS1.2 Select  TLS protocol version 1.2.  When this option is not provided OpenSSL negotiates\nthe mothod with its peer.\n"
                },
                {
                    "name": "verify=<bool>",
                    "content": "Controls check of the peer’s certificate. Default is 1 (true). Disabling verify  might\nopen your socket for everyone, making the encryption useless!\n"
                },
                {
                    "name": "cert=<filename>",
                    "content": "Specifies  the file with the certificate and private key for authentication.  The cer‐\ntificate must be in OpenSSL format (*.pem).  With openssl-listen, use of  this  option\nis  strongly recommended. Except with cipher aNULL, \"no shared ciphers\" error will oc‐\ncur when no certificate is given.\n"
                },
                {
                    "name": "key=<filename>",
                    "content": "Specifies the file with the private key. The private key may be in this file or in the\nfile given with the cert option. The party that has to proof that it is the owner of a\ncertificate needs the private key.\n"
                },
                {
                    "name": "dhparams=<filename>",
                    "content": "Specifies the file with the Diffie Hellman parameters. These parameters may also be in\nthe file given with the cert option in which case the dhparams option is not needed.\n"
                },
                {
                    "name": "cafile=<filename>",
                    "content": "Specifies the file with the trusted (root) authority certificates. The file must be in\nPEM format and should contain one or more certificates. The party that checks the  au‐\nthentication of its peer trusts only certificates that are in this file.\n"
                },
                {
                    "name": "capath=<dirname>",
                    "content": "Specifies  the directory with the trusted (root) certificates. The directory must con‐\ntain certificates in PEM format and their hashes (see OpenSSL documentation)\n"
                },
                {
                    "name": "egd=<filename>",
                    "content": "On some systems, openssl requires an explicit  source  of  random  data.  Specify  the\nsocket  name  where  an  entropy  gathering daemon like egd provides random data, e.g.\n/dev/egd-pool.\n\npseudo On systems where openssl cannot find an entropy source and where no entropy  gathering\ndaemon  can  be  utilized,  this option activates a mechanism for providing pseudo en‐\ntropy. This is achieved by taking the current time in  microseconds  for  feeding  the\nlibc pseudo random number generator with an initial value. openssl is then feeded with\noutput from random() calls.\nNOTE:This mechanism is not sufficient for generation of secure keys!\n"
                },
                {
                    "name": "compress",
                    "content": "Enable or disable the use of compression for a connection. Setting this to \"none\" dis‐\nables  compression,  setting it to \"auto\" lets OpenSSL choose the best available algo‐\nrithm supported by both parties. The default is to not touch  any  compression-related\nsettings.   NOTE:  Requires  OpenSSL  0.9.8  or  higher and disabling compression with\nOpenSSL 0.9.8 affects all new connections in the process.\n"
                },
                {
                    "name": "commonname=<string>",
                    "content": "Specify the commonname that the peer certificate must match. With OPENSSL-CONNECT  ad‐\ndress this overrides the given hostname or IP target address; with OPENSSL-LISTEN this\nturns on check of peer certificates commonname. This option has only meaning when  op‐\ntion verify is not disabled and the chosen cipher provides a peer certificate.\n"
                },
                {
                    "name": "no-sni=<bool>",
                    "content": "Do  not  use the client side Server Name Indication (SNI) feature that selects the de‐\nsired server certificate.\nNote: SNI is automatically used since socat version 1.7.4.0 and uses commonname or the\ngiven host name.\n"
                },
                {
                    "name": "snihost=<string>",
                    "content": "Set  the  client  side  Server  Name Indication (SNI) host name different from the ad‐\ndressed server name or common name. This might be useful when the  server  certificate\nhas  multiple  host  names  or  wildcard  names because the SNI host name is passed in\ncleartext to the server and might be eavesdropped; with this option a mock name of the\ndesired certificate may be transferred.\n\nfips   Enables  FIPS  mode  if compiled in. For info about the FIPS encryption implementation\nstandard see http://oss-institute.org/fips-faq.html.  This mode might require that the\ninvolved certificates are generated with a FIPS enabled version of openssl. Setting or\nclearing this option on one socat  address  affects  all  OpenSSL  addresses  of  this\nprocess.\n\n"
                },
                {
                    "name": "RETRY option group",
                    "content": "Options that control retry of some system calls, especially connection attempts.\n"
                },
                {
                    "name": "retry=<num>",
                    "content": "Number  of  retries before the connection or listen attempt is aborted.  Default is 0,\nwhich means just one attempt.\n"
                },
                {
                    "name": "interval=<timespec>",
                    "content": "Time between consecutive attempts (seconds, [timespec]). Default is 1 second.\n"
                },
                {
                    "name": "forever",
                    "content": "Performs an unlimited number of retry attempts.\n\n"
                },
                {
                    "name": "TUN option group",
                    "content": "Options that control Linux TUN/TAP interface device addresses.\n"
                },
                {
                    "name": "tun-device=<device-file>",
                    "content": "Instructs  socat  to  take  another  path  for  the  TUN  clone  device.  Default   is\n/dev/net/tun.\n"
                },
                {
                    "name": "tun-name=<if-name>",
                    "content": "Gives  the resulting network interface a specific name instead of the system generated\n(tun0, tun1, etc.)\n"
                },
                {
                    "name": "tun-type=[tun|tap]",
                    "content": "Sets the type of the TUN device; use this option to generate a  TAP  device.  See  the\nLinux docu for the difference between these types.  When you try to establish a tunnel\nbetween two TUN devices, their types should be the same.\n"
                },
                {
                    "name": "iff-no-pi",
                    "content": "Sets the IFFNOPI flag which controls if the device includes additional packet infor‐\nmation  in  the  tunnel.   When you try to establish a tunnel between two TUN devices,\nthese flags should have the same values.\n\niff-up Sets the TUN network interface status UP. Strongly recommended.\n"
                },
                {
                    "name": "iff-broadcast",
                    "content": "Sets the BROADCAST flag of the TUN network interface.\n"
                },
                {
                    "name": "iff-debug",
                    "content": "Sets the DEBUG flag of the TUN network interface.\n"
                },
                {
                    "name": "iff-loopback",
                    "content": "Sets the LOOPBACK flag of the TUN network interface.\n"
                },
                {
                    "name": "iff-pointopoint",
                    "content": "Sets the POINTOPOINT flag of the TUN device.\n"
                },
                {
                    "name": "iff-notrailers",
                    "content": "Sets the NOTRAILERS flag of the TUN device.\n"
                },
                {
                    "name": "iff-running",
                    "content": "Sets the RUNNING flag of the TUN device.\n"
                },
                {
                    "name": "iff-noarp",
                    "content": "Sets the NOARP flag of the TUN device.\n"
                },
                {
                    "name": "iff-promisc",
                    "content": "Sets the PROMISC flag of the TUN device.\n"
                },
                {
                    "name": "iff-allmulti",
                    "content": "Sets the ALLMULTI flag of the TUN device.\n"
                },
                {
                    "name": "iff-master",
                    "content": "Sets the MASTER flag of the TUN device.\n"
                },
                {
                    "name": "iff-slave",
                    "content": "Sets the SLAVE flag of the TUN device.\n"
                },
                {
                    "name": "iff-multicast",
                    "content": "Sets the MULTICAST flag of the TUN device.\n"
                },
                {
                    "name": "iff-portsel",
                    "content": "Sets the PORTSEL flag of the TUN device.\n"
                },
                {
                    "name": "iff-automedia",
                    "content": "Sets the AUTOMEDIA flag of the TUN device.\n"
                },
                {
                    "name": "iff-dynamic",
                    "content": "Sets the DYNAMIC flag of the TUN device.\n\n"
                }
            ]
        },
        "DATA VALUES": {
            "content": "This section explains the different data types that address parameters  and  address  options\ncan take.\n\naddress-range\nIs currently only implemented for IPv4 and IPv6. See address-option `range’\n\nbool   \"0\" or \"1\"; if value is omitted, \"1\" is taken.\n\nbyte   An unsigned int number, read with strtoul() , lower or equal to UCHARMAX .\n\ncommand-line\nA string specifying a program name and its arguments, separated by single spaces.\n\ndata   This  is a more general data specification. The given text string contains information\nabout the target data type and value. Generally a leading character specifies the type\nof the following data item. In its specific context a default data type may exist.\nCurrently only the following specifications are implemented:\n\ni      A signed integer number, stored in host byte order.\nExample:    i-1000    (Integer number -1000)\n\nI      An unsigned integer number, stored in host byte order.\n\nl      A signed long integer number, stored in host byte order.\n\nL      An unsigned long integer number, stored in host byte order.\n\ns      A signed short integer number, stored in host byte order.\n\nS      An unsigned short integer number, stored in host byte order.\n\nb      A signed byte (signed char).\n\nB      An unsigned byte (unsigned char).\n\nx      Following is an even number of hex digits, stored as sequence of bytes.\nExample:    x7f000001 (IP address 127.0.0.1)\n\n\"      Following  is  a  string that is used with the common conversions \\n \\r \\t \\f \\b \\a \\e\n\\0; the string must be closed with ’\"’. Please note that the  quotes  and  backslashes\nneed to be escaped from shell and socat conversion.\nExample:    \"Hello world!\\n\"\n\n’      A single char, with the usual conversions. Please note that the quotes and backslashes\nneed to be escaped from shell and socat conversion.\nExample:    ’’a’’ Data items may be separated with white space without  need  to  repeat\nthe type specifier again.\n\ndirectory\nA string with usual UN*X directory name semantics.\n\nfacility\nThe name of a syslog facility in lower case characters.\n\nfdnum  An unsigned int type, read with strtoul() , specifying a UN*X file descriptor.\n\nfilename\nA string with usual UN*X filename semantics.\n\ngroup  If  the  first  character  is a decimal digit, the value is read with strtoul() as un‐\nsigned integer specifying a group id. Otherwise, it must be an existing group name.\n\nint    A number following the rules of the strtol() function with base \"0\", i.e. decimal num‐\nber, octal number with leading \"0\", or hexadecimal number with leading \"0x\". The value\nmust fit into a C int.\n\ninterface\nA string specifying the device name of a network interface as  shown  by  ifconfig  or\nprocan, e.g. \"eth0\".\n\nIP address\nAn IPv4 address in numbers-and-dots notation, an IPv6 address in hex notation enclosed\nin brackets, or a hostname that resolves to an IPv4 or an IPv6 address.\nExamples: 127.0.0.1, [::1], www.dest-unreach.org, dns1\n\nIPv4 address\nAn IPv4 address in numbers-and-dots notation or a hostname that resolves  to  an  IPv4\naddress.\nExamples: 127.0.0.1, www.dest-unreach.org, dns2\n\nIPv6 address\nAn  IPv6 address in hexnumbers-and-colons notation enclosed in brackets, or a hostname\nthat resolves to an IPv6 address.\nExamples: [::1], [1234:5678:9abc:def0:1234:5678:9abc:def0], ip6name.domain.org\n\nlong   A number read with strtol() . The value must fit into a C long.\n\nlong long\nA number read with strtoll() . The value must fit into a C long long.\n\nofft  An implementation dependend signed number, usually 32 bits, read with strtol  or  str‐\ntoll.\n\noff64t\nAn  implementation  dependend signed number, usually 64 bits, read with strtol or str‐\ntoll.\n\nmodet An unsigned integer, read with strtoul() , specifying mode (permission) bits.\n\npidt  A number, read with strtol() , specifying a process id.\n\nport   A uint16t (16 bit unsigned number) specifying a TCP or UDP port, read with  strtoul()\n.\n\nprotocol\nAn unsigned 8 bit number, read with strtoul() .\n\nsizet An unsigned number with sizet limitations, read with strtoul .\n\nsockname\nA socket address. See address-option `bind’\n\nstring A  sequence  of  characters, not containing ’\\0’ and, depending on the position within\nthe command line, ’:’, ’,’, or \"!!\". Note that you might have  to  escape  shell  meta\ncharacters in the command line.\n\nTCP service\nA service name, not starting with a digit, that is resolved by getservbyname() , or an\nunsigned int 16 bit number read with strtoul() .\n\ntimeval\nA double float specifying seconds; the number is mapped into a  struct  timeval,  con‐\nsisting of seconds and microseconds.\n\ntimespec\nA  double  float specifying seconds; the number is mapped into a struct timespec, con‐\nsisting of seconds and nanoseconds.\n\nUDP service\nA service name, not starting with a digit, that is resolved by getservbyname() , or an\nunsigned int 16 bit number read with strtoul() .\n\nunsigned int\nA number read with strtoul() . The value must fit into a C unsigned int.\n\nuser   If  the  first  character  is a decimal digit, the value is read with strtoul() as un‐\nsigned integer specifying a user id. Otherwise, it must be an existing user name.\n\nVSOCK cid\nA uint32t (32 bit unsigned number) specifying a VSOCK Context Identifier (CID),  read\nwith  strtoul() .  There are several special addresses: VMADDRCIDANY (-1U) means any\naddress for binding; VMADDRCIDHOST (2) is the well-known address of the host.\n\nVSOCK port\nA uint32t (32 bit unsigned number) specifying a VSOCK port, read with strtoul() .\n\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "",
            "subsections": [
                {
                    "name": "socat - TCP4:www.domain.org:80",
                    "content": "transfers data between STDIO (-) and a TCP4 connection to  port  80  of  host  www.do‐\nmain.org.  This example results in an interactive connection similar to telnet or net‐\ncat. The stdin terminal parameters are not changed, so you may close the relay with ^D\nor abort it with ^C.\n\nsocat -d -d READLINE,history=$HOME/.httphistory \\"
                },
                {
                    "name": "TCP4:www.domain.org:www,crnl",
                    "content": "this  is  similar to the previous example, but you can edit the current line in a bash\nlike manner (READLINE) and use the history file .httphistory; socat  prints  messages\nabout progress (-d -d). The  port is specified by service name (www), and correct net‐\nwork line termination characters (crnl) instead of NL are used.\n"
                },
                {
                    "name": "socat TCP4-LISTEN:www TCP4:www.domain.org:www",
                    "content": "installs a simple TCP port forwarder. With TCP4-LISTEN it listens on local port  \"www\"\nuntil  a  connection comes in, accepts it, then connects to the remote host (TCP4) and\nstarts data transfer. It will not accept a second connection.\n"
                },
                {
                    "name": "socat -d -d -lmlocal2 \\",
                    "content": ""
                },
                {
                    "name": "TCP4-LISTEN:80,bind=myaddr1,reuseaddr,fork,su=nobody,range=10.0.0.0/8 \\",
                    "content": ""
                },
                {
                    "name": "TCP4:www.domain.org:80,bind=myaddr2",
                    "content": "TCP port forwarder, each side bound to another local IP address (bind).  This  example\nhandles  an almost arbitrary number of parallel or consecutive connections by fork’ing\na new process after each accept() . It provides a little security by  su’ing  to  user\nnobody after forking; it only permits connections from the private 10 network (range);\ndue to reuseaddr, it allows immediate restart after master process’s termination, even\nif  some  child  sockets  are not completely shut down.  With -lmlocal2, socat logs to\nstderr until successfully reaching the accept loop. Further  logging  is  directed  to\nsyslog with facility local2.\n"
                },
                {
                    "name": "socat TCP4-LISTEN:5555,fork,tcpwrap=script \\",
                    "content": ""
                },
                {
                    "name": "EXEC:/bin/myscript,chroot=/home/sandbox,su-d=sandbox,pty,stderr",
                    "content": "a  simple server that accepts connections (TCP4-LISTEN) and fork’s a new child process\nfor each connection; every child acts as single relay.   The  client  must  match  the\nrules for daemon process name \"script\" in /etc/hosts.allow and /etc/hosts.deny, other‐\nwise it is refused access (see \"man 5 hostsaccess\").  For EXEC’uting the program, the\nchild  process  chroot’s  to  /home/sandbox, su’s to user sandbox, and then starts the\nprogram /home/sandbox/bin/myscript. Socat and myscript communicate via  a  pseudo  tty\n(pty);  myscript’s  stderr  is  redirected to stdout, so its error messages are trans‐\nferred via socat to the connected client.\n"
                },
                {
                    "name": "socat EXEC:\"mail.sh target@domain.com\",fdin=3,fdout=4 \\",
                    "content": ""
                },
                {
                    "name": "TCP4:mail.relay.org:25,crnl,bind=alias1.server.org,mss=512",
                    "content": "mail.sh is a shell script, distributed with  socat,  that  implements  a  simple  SMTP\nclient.  It is programmed to \"speak\" SMTP on its FDs 3 (in) and 4 (out).  The fdin and\nfdout options tell socat to use these FDs for communication with the program.  Because\nmail.sh inherits stdin and stdout while socat does not use them, the script can read a\nmail body from stdin. Socat makes alias1 your local source address (bind),  cares  for\ncorrect  network  line  termination (crnl) and sends at most 512 data bytes per packet\n(mss).\n"
                },
                {
                    "name": "socat -,escape=0x0f /dev/ttyS0,rawer,crnl",
                    "content": "opens an interactive connection via the serial line, e.g. for talking  with  a  modem.\nrawer  sets  the console’s and ttyS0’s terminal parameters to practicable values, crnl\nconverts to correct newline characters. escape allows terminating  the  socat  process\nwith character control-O.\n"
                },
                {
                    "name": "socat UNIX-LISTEN:/tmp/.X11-unix/X1,fork \\",
                    "content": ""
                },
                {
                    "name": "SOCKS4:host.victim.org:127.0.0.1:6000,socksuser=nobody,sourceport=20",
                    "content": "with  UNIX-LISTEN,  socat opens a listening UNIX domain socket /tmp/.X11-unix/X1. This\npath corresponds to local XWindow display :1 on your machine, so XWindow  client  con‐\nnections  to  DISPLAY=:1  are  accepted.  Socat  then  speaks  with  the SOCKS4 server\nhost.victim.org that might permit sourceport 20 based connections due to  an  FTP  re‐\nlated weakness in its static IP filters. Socat pretends to be invoked by socksuser no‐\nbody, and requests to be connected to loopback port 6000 (only weak  sockd  configura‐\ntions  will  allow this). So we get a connection to the victims XWindow server and, if\nit does not require MIT cookies or Kerberos authentication, we can start work.  Please\nnote  that  there can only be one connection at a time, because TCP can establish only\none session with a given set of addresses and ports.\n"
                },
                {
                    "name": "socat -u /tmp/readdata,seek-end=0,ignoreeof -",
                    "content": "this is an example for unidirectional data transfer (-u). Socat  transfers  data  from\nfile  /tmp/readdata  (implicit address GOPEN), starting at its current end (seek-end=0\nlets socat start reading at current end of file; use seek=0 or no seek option to first\nread the existing data) in a \"tail -f\" like mode (ignoreeof). The \"file\" might also be\na listening UNIX domain socket (do not use a seek option then).\n"
                },
                {
                    "name": "(sleep 5; echo PASSWORD; sleep 5; echo ls; sleep 1) |",
                    "content": ""
                },
                {
                    "name": "socat - EXEC:'ssh -l user server',pty,setsid,ctty",
                    "content": "EXEC’utes an ssh session to server. Uses a pty for  communication  between  socat  and\nssh,  makes  it  ssh’s  controlling  tty (ctty), and makes this pty the owner of a new\nprocess group (setsid), so ssh accepts the password from socat.\n"
                },
                {
                    "name": "socat -u TCP4-LISTEN:3334,reuseaddr,fork \\",
                    "content": ""
                },
                {
                    "name": "OPEN:/tmp/in.log,creat,append",
                    "content": "implements a simple network based message collector.  For each  client  connecting  to\nport  3334,  a  new  child  process  is generated (option fork).  All data sent by the\nclients are append’ed to the file /tmp/in.log.  If the  file  does  not  exist,  socat\ncreat’s it.  Option reuseaddr allows immediate restart of the server process.\n"
                },
                {
                    "name": "socat PTY,link=$HOME/dev/vmodem0,rawer,wait-slave \\",
                    "content": ""
                },
                {
                    "name": "EXEC:\"ssh modemserver.us.org socat - /dev/ttyS0,nonblock,rawer\"",
                    "content": "generates  a  pseudo terminal device (PTY) on the client that can be reached under the\nsymbolic link $HOME/dev/vmodem0.  An application that expects a serial line  or  modem\ncan  be  configured to use $HOME/dev/vmodem0; its traffic will be directed to a modem‐\nserver via ssh where another socat instance links it to /dev/ttyS0.\n"
                },
                {
                    "name": "socat TCP4-LISTEN:2022,reuseaddr,fork \\",
                    "content": ""
                },
                {
                    "name": "PROXY:proxy:www.domain.org:22,proxyport=3128,proxyauth=user:pass",
                    "content": "starts a forwarder that accepts connections on port 2022, and directs them through the\nproxy  daemon  listening  on  port  3128  (proxyport) on host proxy, using the CONNECT\nmethod, where they are authenticated as \"user\"  with  \"pass\"  (proxyauth).  The  proxy\nshould establish connections to host www.domain.org on port 22 then.\n"
                },
                {
                    "name": "socat - OPENSSL:server:4443,cafile=server.crt,cert=client.pem",
                    "content": "is an OpenSSL client that tries to establish a secure connection to an SSL server. Op‐\ntion cafile specifies a file that contains trust certificates:  we  trust  the  server\nonly  when  it  presents one of these certificates and proofs that it owns the related\nprivate key.  Otherwise the connection is terminated.  With cert a file containing the\nclient  certificate  and  the associated private key is specified. This is required in\ncase the server wishes a client authentication; many Internet servers do not.\nThe first address (’-’) can be replaced by almost any other socat address.\n"
                },
                {
                    "name": "socat OPENSSL-LISTEN:4443,reuseaddr,pf=ip4,fork,cert=server.pem,cafile=client.crt PIPE",
                    "content": "is an OpenSSL server that accepts TCP connections, presents the certificate  from  the\nfile  server.pem  and  forces  the  client  to  present a certificate that is verified\nagainst cafile.crt.\nThe second address (’PIPE’) can be replaced by almost any other socat address.\nFor instructions on generating and distributing OpenSSL keys and certificates see  the\nadditional socat docu socat-openssl.txt.\n"
                },
                {
                    "name": "echo |socat -u - file:/tmp/bigfile,create,largefile,seek=100000000000",
                    "content": "creates  a  100GB  sparse  file;  this  requires a file system type that supports this\n(ext2, ext3, reiserfs, jfs; not minix, vfat). The operation of writing  1  byte  might\ntake  long  (reiserfs: some minutes; ext2: \"no\" time), and the resulting file can con‐\nsume some disk space with just its inodes (reiserfs: 2MB; ext2: 16KB).\n\nsocat tcp-l:7777,reuseaddr,fork system:’’filan -i 0 -s >&2’’,nofork\n\n\nlistens for incoming TCP connections on port 7777. For each accepted  connection,  in‐\nvokes  a  shell.  This  shell  has  its stdin and stdout directly connected to the TCP\nsocket (nofork).  The shell starts filan and lets it print  the  socket  addresses  to\nstderr (your terminal window).\n"
                },
                {
                    "name": "echo -en \"\\0\\14\\0\\0\\c\" |socat -u - file:/usr/bin/squid.exe,seek=0x00074420",
                    "content": "functions as primitive binary editor: it writes the 4 bytes 000 014 000 000 to the ex‐\necutable /usr/bin/squid at offset 0x00074420 (this is a real world patch to  make  the\nsquid executable from Cygwin run under Windows, actual per May 2004).\n"
                },
                {
                    "name": "socat - tcp:www.blackhat.org:31337,readbytes=1000",
                    "content": "connects to an unknown service and prevents being flooded.\n"
                },
                {
                    "name": "socat -U TCP:target:9999,end-close TCP-L:8888,reuseaddr,fork",
                    "content": "merges  data  arriving  from  different TCP streams on port 8888 to just one stream to\ntarget:9999. The end-close option prevents the child processes forked off by the  sec‐\nond  address from terminating the shared connection to 9999 (close(2) just unlinks the\ninode which stays active as long as the parent process lives;  shutdown(2)  would  ac‐\ntively terminate the connection).\n"
                },
                {
                    "name": "socat - UDP4-DATAGRAM:192.168.1.0:123,sp=123,broadcast,range=192.168.1.0/24",
                    "content": "sends  a broadcast to the network 192.168.1.0/24 and receives the replies of the time‐\nservers there. Ignores NTP packets from hosts outside this network.\n\nsocat - SOCKET-DATAGRAM:2:2:17:x007bxc0a80100x0000000000000000,b‐‐\nind=x007bx00000000x0000000000000000,setsockopt-int=1:6:1,r‐‐"
                },
                {
                    "name": "ange=x0000xc0a80100x0000000000000000:x0000xffffff00x0000000000000000",
                    "content": "is semantically equivalent to the previous example, but all parameters are specified\nin generic form. the value 6 of setsockopt-int is the Linux value for SOBROADCAST.\n"
                },
                {
                    "name": "socat - IP4-DATAGRAM:255.255.255.255:44,broadcast,range=10.0.0.0/8",
                    "content": "sends a broadcast to the local network(s) using protocol 44. Accepts replies from the\nprivate address range only.\n"
                },
                {
                    "name": "socat - UDP4-DATAGRAM:224.255.0.1:6666,bind=:6666,ip-add-membership=224.255.0.1:eth0",
                    "content": "transfers data from stdin to the specified multicast address using UDP. Both local and\nremote ports are 6666. Tells the interface eth0 to also accept multicast packets of\nthe given group. Multiple hosts on the local network can run this command, so all data\nsent by any of the hosts will be received by all the other ones. Note that there are\nmany possible reasons for failure, including IP-filters, routing issues, wrong inter‐\nface selection by the operating system, bridges, or a badly configured switch.\n"
                },
                {
                    "name": "socat UDP:host2:4443 TUN:192.168.255.1/24,up",
                    "content": "establishes one side of a virtual (but not private!) network with host2 where a simi‐\nlar process might run, with UDP-L and tun address 192.168.255.2. They can reach each\nother using the addresses 192.168.255.1 and 192.168.255.2. Note that streaming eg.via\nTCP or SSL does not guarantee to retain packet boundaries and might thus cause packet\nloss.\n"
                },
                {
                    "name": "socat - VSOCK-CONNECT:2:1234",
                    "content": "establishes a VSOCK connection with the host (host is always reachable with the\nwell-know CID=2) on 1234 port.\n"
                },
                {
                    "name": "socat - VSOCK-LISTEN:1234",
                    "content": "listens for a VSOCK connection on 1234 port.\n"
                },
                {
                    "name": "socat - VSOCK-CONNECT:31:4321,bind:5555",
                    "content": "establishes a VSOCK connection with the guest that have CID=31 on 1234 port, binding\nthe local socket to the 5555 port.\n"
                },
                {
                    "name": "socat VSOCK-LISTEN:3333,reuseaddr,fork VSOCK-CONNECT:42,3333",
                    "content": "starts a forwarder that accepts VSOCK connections on port 3333, and directs them to\nthe guest with CID=42 on the same port.\n"
                },
                {
                    "name": "socat VSOCK-LISTEN:22,reuseaddr,fork TCP:localhost:22",
                    "content": "forwards VSOCK connections from 22 port to the local SSH server.  Running this in a VM\nallows you to connect via SSH from the host using VSOCK, as in the example below.\n"
                },
                {
                    "name": "socat TCP4-LISTEN:22222,reuseaddr,fork VSOCK-CONNECT:33:22",
                    "content": "forwards TCP connections from 22222 port to the guest with CID=33 listening on VSOCK\nport 22.  Running this in the host, allows you to connect via SSH running \"ssh -p\n22222 user@localhost\", if the guest runs the example above.\n"
                },
                {
                    "name": "socat PTY,link=/var/run/ppp,rawer INTERFACE:hdlc0",
                    "content": "circumvents the problem that pppd requires a serial device and thus might not be able\nto work on a synchronous line that is represented by a network device.  socat creates\na PTY to make pppd happy, binds to the network interface hdlc0, and can transfer data\nbetween both devices. Use pppd on device /var/run/ppp then.\n"
                },
                {
                    "name": "socat -T 1 -d -d TCP-L:10081,reuseaddr,fork,crlf SYSTEM:\"echo -e \\\"\\\\\\\"HTTP/1.0 200",
                    "content": "OK\\\\\\nDocumentType: text/plain\\\\\\n\\\\\\ndate: \\$\\(date\\)\\\\\\nserver:\\$SOCATSOCKADDR:\\$SO‐‐\nCATSOCKPORT\\\\\\nclient: \\$SOCATPEERADDR:\\$SOCATPEERPORT\\\\\\n\\\\\\\"\\\"; cat; echo -e"
                },
                {
                    "name": "\\\"\\\\\\\"\\\\\\n\\\\\\\"\\\"\"",
                    "content": "creates a simple HTTP echo server: each HTTP client that connects gets a valid HTTP\nreply that contains information about the client address and port as it is seen by the\nserver host, the host address (which might vary on multihomed servers), and the origi‐\nnal client request.\n\nsocat -d -d UDP4-RECVFROM:9999,so-broadcast,so-timestamp,ip-pkt‐‐\ninfo,ip-recverr,ip-recvopts,ip-recvtos,ip-recvttl!!- SYSTEM:’’export; sleep 1’’ |grep SOCAT\n\n\nwaits for an incoming UDP packet on port 9999 and prints the environment variables\nprovided by socat. On BSD based systems you have to replace ip-pktinfo with ip-recvd‐\nstaddr,ip-recvif. Especially interesting is SOCATIPDSTADDR: it contains the target\naddress of the packet which may be a unicast, multicast, or broadcast address.\n\necho -e \"M-SEARCH * HTTP/1.1\\nHOST: 239.255.255.250:1900\\nMAN: \\\"ssdp:discover\\\"\\nMX: 4\\nST:"
                },
                {
                    "name": "\\\"ssdp:all\\\"\\n\" |./socat - UDP-DATAGRAM:239.255.255.250:1900,crlf",
                    "content": "sends an SSDP (Simple Service Discovery Protocol) query to the local network and col‐\nlects and outputs the answers received.\n\n\n\n"
                }
            ]
        },
        "DIAGNOSTICS": {
            "content": "Socat uses a logging mechanism that allows filtering messages by severity. The severities\nprovided are more or less compatible to the appropriate syslog priority. With one or up to\nfour occurrences of the -d command line option, the lowest priority of messages that are is‐\nsued can be selected. Each message contains a single uppercase character specifying the mes‐\nsages severity (one of F, E, W, N, I, or D)\n\nFATAL: Conditions that require unconditional and immediate program termination.\n\nERROR: Conditions that prevent proper program processing. Usually the program is terminated\n(see option -s).\n\nWARNING:\nSomething did not function correctly or is in a state where correct further processing\ncannot be guaranteed, but might be possible.\n\nNOTICE:\nInteresting actions of the program, e.g. for supervising socat in some kind of server\nmode.\n\nINFO:  Description of what the program does, and maybe why it happens. Allows monitoring the\nlifecycles of file descriptors.\n\nDEBUG: Description of how the program works, all system or library calls and their results.\n\n\nLog messages can be written to stderr, to a file, or to syslog.\n\nOn exit, socat gives status 0 if it terminated due to EOF or inactivity timeout, with a posi‐\ntive value on error, and with a negative value on fatal error.\n",
            "subsections": []
        },
        "FILES": {
            "content": "/usr/bin/socat\n/usr/bin/filan\n/usr/bin/procan\n",
            "subsections": []
        },
        "ENVIRONMENT VARIABLES": {
            "content": "Input variables carry information from the environment to socat, output variables are set by\nsocat for use in executed scripts and programs.\n\nIn the output variables beginning with \"SOCAT\" this prefix is actually replaced by the upper\ncase name of the executable or the value of option -lp.\n",
            "subsections": [
                {
                    "name": "SOCAT___DEFAULT___LISTEN___IP (input)",
                    "content": "(Values 4 or 6) Sets the IP version to be used for listen, recv, and recvfrom ad‐\ndresses if no pf (protocol-family) option is given. Is overridden by socat options -4\nor -6.\n"
                },
                {
                    "name": "SOCAT___PREFERRED___RESOLVE___IP (input)",
                    "content": "(Values 0, 4, or 6) Sets the IP version to be used when resolving target host names\nwhen version is not specified by address type, option pf (protocol-family), or address\nformat. If name resolution does not return a matching entry, the first result (with\ndiffering IP version) is taken. With value 0, socat always selects the first record\nand its IP version.\n"
                },
                {
                    "name": "SOCAT___FORK___WAIT (input)",
                    "content": "Specifies the time (seconds) to sleep the parent and child processes after successful\nfork(). Useful for debugging.\n"
                },
                {
                    "name": "SOCAT___VERSION (output)",
                    "content": "Socat sets this variable to its version string, e.g. \"1.7.0.0\" for released versions\nor e.g. \"1.6.0.1+envvar\" for temporary versions; can be used in scripts invoked by so‐\ncat.\n"
                },
                {
                    "name": "SOCAT___PID (output)",
                    "content": "Socat sets this variable to its process id. In case of fork address option, SOCATPID\ngets the child processes id. Forking for exec and system does not change SOCATPID.\n"
                },
                {
                    "name": "SOCAT___PPID (output)",
                    "content": "Socat sets this variable to its process id. In case of fork, SOCATPPID keeps the pid\nof the master process.\n"
                },
                {
                    "name": "SOCAT___PEERADDR (output)",
                    "content": "With passive socket addresses (all LISTEN and RECVFROM addresses), this variable is\nset to a string describing the peers socket address. Port information is not included.\n"
                },
                {
                    "name": "SOCAT___PEERPORT (output)",
                    "content": "With appropriate passive socket addresses (TCP, UDP, and SCTP - LISTEN and RECVFROM),\nthis variable is set to a string containing the number of the peer port.\n"
                },
                {
                    "name": "SOCAT___SOCKADDR (output)",
                    "content": "With all LISTEN addresses, this variable is set to a string describing the local\nsocket address. Port information is not included example\n"
                },
                {
                    "name": "SOCAT___SOCKPORT (output)",
                    "content": "With TCP-LISTEN, UDP-LISTEN, and SCTP-LISTEN addresses, this variable is set to the\nlocal port.\n"
                },
                {
                    "name": "SOCAT___TIMESTAMP (output)",
                    "content": "With all RECVFROM addresses where address option so-timestamp is applied, socat sets\nthis variable to the resulting timestamp.\n"
                },
                {
                    "name": "SOCAT___IP___OPTIONS (output)",
                    "content": "With all IPv4 based RECVFROM addresses where address option ip-recvopts is applied,\nsocat fills this variable with the IP options of the received packet.\n"
                },
                {
                    "name": "SOCAT___IP___DSTADDR (output)",
                    "content": "With all IPv4 based RECVFROM addresses where address option ip-recvdstaddr (BSD) or\nip-pktinfo (other platforms) is applied, socat sets this variable to the destination\naddress of the received packet. This is particularly useful to identify broadcast and\nmulticast addressed packets.\n"
                },
                {
                    "name": "SOCAT___IP___IF (output)",
                    "content": "With all IPv4 based RECVFROM addresses where address option ip-recvif (BSD) or ip-pkt‐\ninfo (other platforms) is applied, socat sets this variable to the name of the inter‐\nface where the packet was received.\n"
                },
                {
                    "name": "SOCAT___IP___LOCADDR (output)",
                    "content": "With all IPv4 based RECVFROM addresses where address option ip-pktinfo is applied, so‐\ncat sets this variable to the address of the interface where the packet was received.\n"
                },
                {
                    "name": "SOCAT___IP___TOS (output)",
                    "content": "With all IPv4 based RECVFROM addresses where address option ip-recvtos is applied, so‐\ncat sets this variable to the TOS (type of service) of the received packet.\n"
                },
                {
                    "name": "SOCAT___IP___TTL (output)",
                    "content": "With all IPv4 based RECVFROM addresses where address option ip-recvttl is applied, so‐\ncat sets this variable to the TTL (time to live) of the received packet.\n"
                },
                {
                    "name": "SOCAT___IPV6___HOPLIMIT (output)",
                    "content": "With all IPv6 based RECVFROM addresses where address option ipv6-recvhoplimit is ap‐\nplied, socat sets this variable to the hoplimit value of the received packet.\n"
                },
                {
                    "name": "SOCAT___IPV6___DSTADDR (output)",
                    "content": "With all IPv6 based RECVFROM addresses where address option ipv6-recvpktinfo is ap‐\nplied, socat sets this variable to the destination address of the received packet.\n"
                },
                {
                    "name": "SOCAT___IPV6___TCLASS (output)",
                    "content": "With all IPv6 based RECVFROM addresses where address option ipv6-recvtclass is ap‐\nplied, socat sets this variable to the transfer class of the received packet.\n"
                },
                {
                    "name": "SOCAT___OPENSSL___X509___ISSUER (output)",
                    "content": "Issuer field from peer certificate\n"
                },
                {
                    "name": "SOCAT___OPENSSL___X509___SUBJECT (output)",
                    "content": "Subject field from peer certificate\n"
                },
                {
                    "name": "SOCAT___OPENSSL___X509___COMMONNAME (output)",
                    "content": "commonName entries from peer certificates subject. Multiple values are separated by \"\n// \".\n\nSOCATOPENSSLX509* (output)\nall other entries from peer certificates subject\n"
                },
                {
                    "name": "SOCAT___OPENSSL___X509V3___DNS (output)",
                    "content": "DNS entries from peer certificates extensions - subjectAltName field. Multiple values\nare separated by \" // \".\n"
                },
                {
                    "name": "HOSTNAME (input)",
                    "content": "Is used to determine the hostname for logging (see -lh).\n"
                },
                {
                    "name": "LOGNAME (input)",
                    "content": "Is used as name for the socks client user name if no socksuser is given.\nWith options su and su-d, LOGNAME is set to the given user name.\n"
                },
                {
                    "name": "USER (input)",
                    "content": "Is used as name for the socks client user name if no socksuser is given and LOGNAME is\nempty.\nWith options su and su-d, USER is set to the given user name.\n"
                },
                {
                    "name": "SHELL (output)",
                    "content": "With options su and su-d, SHELL is set to the login shell of the given user.\n"
                },
                {
                    "name": "PATH (output)",
                    "content": "Can be set with option path for exec and system addresses.\n"
                },
                {
                    "name": "HOME (output)",
                    "content": "With options su and su-d, HOME is set to the home directory of the given user.\n"
                }
            ]
        },
        "CREDITS": {
            "content": "The work of the following groups and organizations was invaluable for this project:\n\nThe FSF (GNU, http://www.fsf.org/ project with their free and portable development software\nand lots of other useful tools and libraries.\n\nThe Linux developers community (http://www.linux.org/) for providing a free, open source op‐\nerating system.\n\nThe Open Group (http://www.unix-systems.org/) for making their standard specifications avail‐\nable on the Internet for free.\n",
            "subsections": []
        },
        "VERSION": {
            "content": "This man page describes version 1.7.4 of socat.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Addresses cannot be nested, so a single socat process cannot, e.g., drive ssl over socks.\n\nAddress option ftruncate without value uses default 1 instead of 0.\n\nVerbose modes (-x and/or -v) display line termination characters inconsistently when address\noptions cr or crnl are used: They show the data after conversion in either direction.\n\nThe licenses of OpenSSL and GNU Readline are incompatible. Therefore readline support is dis‐\nabled in Debian.\n\nSend bug reports to <socat@dest-unreach.org>\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "nc(1), rinetd(8), openssl(1), stunnel(8), rlwrap(1), setsid(1)\n\nSocat home page http://www.dest-unreach.org/socat/\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Gerhard Rieger <rieger@dest-unreach.org> and contributors\n\n\n\nsocat(1)",
            "subsections": []
        }
    },
    "summary": "socat - Multipurpose relay (SOcket CAT)",
    "flags": [
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-?",
            "long": null,
            "arg": null,
            "description": "Print a help text to stdout describing command line options and available address types, and exit."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "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 imple‐ mentation."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Like -hh, plus a list of all available address option names."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "also prints warning messages. See DIAGNOSTICS for more information."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "Prints fatal, error, warning, notice, and info messages."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "Prints fatal, error, warning, notice, info, and debug messages."
        },
        {
            "flag": "-D",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Writes messages to syslog instead of stderr; severity as defined with -d option. With optional <facility>, the syslog type can be selected, default is \"daemon\". Third party libraries might not obey this option."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Writes messages to <logfile> [filename] instead of stderr. Some third party libraries, in particular libwrap, might not obey this option."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "obey this option, in particular libwrap appears to only log to syslog."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Overrides the program name printed in error messages and used for constructing envi‐ ronment variable names."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "logging to syslog."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "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 <facility>, the syslog type can be selected, default is \"daemon\"."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "the value retrieved with uname() if HOSTNAME is not set."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "output format is text with some conversions for readability, and prefixed with \"> \" or \"< \" indicating flow directions."
        },
        {
            "flag": "-x",
            "long": null,
            "arg": null,
            "description": "output format is hexadecimal, prefixed with \"> \" or \"< \" indicating flow directions. Can be combined with -v ."
        },
        {
            "flag": "-r",
            "long": null,
            "arg": "<file>",
            "description": "Dumps the raw (binary) data flowing from left to right address to the given file."
        },
        {
            "flag": "-R",
            "long": null,
            "arg": "<file>",
            "description": "Dumps the raw (binary) data flowing from right to left address to the given file."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Sets the data transfer block <size> [sizet]. At most <size> bytes are transferred per step. Default is 8192 bytes."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "ning when some option could not be applied. With this option, socat is sloppy with er‐ rors and tries to continue. Even with this option, socat will exit on fatals, and will abort connection attempts when security checks failed."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "When one channel has reached EOF, the write part of the other channel is shut down. Then, socat waits <timeout> [timeval] seconds before terminating. Default is 0.5 sec‐ onds. 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 termi‐ nates without awaiting the timeout."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Total inactivity timeout: when socat is already in the transfer loop and nothing has happened for <timeout> [timeval] seconds (no data arrived, no interrupt occurred...) then it terminates. Useful with protocols like UDP that cannot transfer EOF."
        },
        {
            "flag": "-u",
            "long": null,
            "arg": null,
            "description": "address is only used for writing (example)."
        },
        {
            "flag": "-U",
            "long": null,
            "arg": null,
            "description": "writing, and the second address is only used for reading."
        },
        {
            "flag": "-g",
            "long": null,
            "arg": null,
            "description": "given address environment. Use it if you want to force, e.g., appliance of a socket option to a serial device."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "If lockfile exists, exits with error. If lockfile does not exist, creates it and con‐ tinues, unlinks lockfile on exit."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "If lockfile exists, waits until it disappears. When lockfile does not exist, creates it and continues, unlinks lockfile on exit."
        },
        {
            "flag": "-4",
            "long": null,
            "arg": null,
            "description": "version; this is the default."
        },
        {
            "flag": "-6",
            "long": null,
            "arg": null,
            "description": "version."
        }
    ],
    "examples": [
        "transfers data between STDIO (-) and a TCP4 connection to  port  80  of  host  www.do‐",
        "main.org.  This example results in an interactive connection similar to telnet or net‐",
        "cat. The stdin terminal parameters are not changed, so you may close the relay with ^D",
        "or abort it with ^C.",
        "socat -d -d READLINE,history=$HOME/.httphistory \\",
        "this  is  similar to the previous example, but you can edit the current line in a bash",
        "like manner (READLINE) and use the history file .httphistory; socat  prints  messages",
        "about progress (-d -d). The  port is specified by service name (www), and correct net‐",
        "work line termination characters (crnl) instead of NL are used.",
        "installs a simple TCP port forwarder. With TCP4-LISTEN it listens on local port  \"www\"",
        "until  a  connection comes in, accepts it, then connects to the remote host (TCP4) and",
        "starts data transfer. It will not accept a second connection.",
        "TCP port forwarder, each side bound to another local IP address (bind).  This  example",
        "handles  an almost arbitrary number of parallel or consecutive connections by fork’ing",
        "a new process after each accept() . It provides a little security by  su’ing  to  user",
        "nobody after forking; it only permits connections from the private 10 network (range);",
        "due to reuseaddr, it allows immediate restart after master process’s termination, even",
        "if  some  child  sockets  are not completely shut down.  With -lmlocal2, socat logs to",
        "stderr until successfully reaching the accept loop. Further  logging  is  directed  to",
        "syslog with facility local2.",
        "a  simple server that accepts connections (TCP4-LISTEN) and fork’s a new child process",
        "for each connection; every child acts as single relay.   The  client  must  match  the",
        "rules for daemon process name \"script\" in /etc/hosts.allow and /etc/hosts.deny, other‐",
        "wise it is refused access (see \"man 5 hostsaccess\").  For EXEC’uting the program, the",
        "child  process  chroot’s  to  /home/sandbox, su’s to user sandbox, and then starts the",
        "program /home/sandbox/bin/myscript. Socat and myscript communicate via  a  pseudo  tty",
        "(pty);  myscript’s  stderr  is  redirected to stdout, so its error messages are trans‐",
        "ferred via socat to the connected client.",
        "mail.sh is a shell script, distributed with  socat,  that  implements  a  simple  SMTP",
        "client.  It is programmed to \"speak\" SMTP on its FDs 3 (in) and 4 (out).  The fdin and",
        "fdout options tell socat to use these FDs for communication with the program.  Because",
        "mail.sh inherits stdin and stdout while socat does not use them, the script can read a",
        "mail body from stdin. Socat makes alias1 your local source address (bind),  cares  for",
        "correct  network  line  termination (crnl) and sends at most 512 data bytes per packet",
        "(mss).",
        "opens an interactive connection via the serial line, e.g. for talking  with  a  modem.",
        "rawer  sets  the console’s and ttyS0’s terminal parameters to practicable values, crnl",
        "converts to correct newline characters. escape allows terminating  the  socat  process",
        "with character control-O.",
        "with  UNIX-LISTEN,  socat opens a listening UNIX domain socket /tmp/.X11-unix/X1. This",
        "path corresponds to local XWindow display :1 on your machine, so XWindow  client  con‐",
        "nections  to  DISPLAY=:1  are  accepted.  Socat  then  speaks  with  the SOCKS4 server",
        "host.victim.org that might permit sourceport 20 based connections due to  an  FTP  re‐",
        "lated weakness in its static IP filters. Socat pretends to be invoked by socksuser no‐",
        "body, and requests to be connected to loopback port 6000 (only weak  sockd  configura‐",
        "tions  will  allow this). So we get a connection to the victims XWindow server and, if",
        "it does not require MIT cookies or Kerberos authentication, we can start work.  Please",
        "note  that  there can only be one connection at a time, because TCP can establish only",
        "one session with a given set of addresses and ports.",
        "this is an example for unidirectional data transfer (-u). Socat  transfers  data  from",
        "file  /tmp/readdata  (implicit address GOPEN), starting at its current end (seek-end=0",
        "lets socat start reading at current end of file; use seek=0 or no seek option to first",
        "read the existing data) in a \"tail -f\" like mode (ignoreeof). The \"file\" might also be",
        "a listening UNIX domain socket (do not use a seek option then).",
        "EXEC’utes an ssh session to server. Uses a pty for  communication  between  socat  and",
        "ssh,  makes  it  ssh’s  controlling  tty (ctty), and makes this pty the owner of a new",
        "process group (setsid), so ssh accepts the password from socat.",
        "implements a simple network based message collector.  For each  client  connecting  to",
        "port  3334,  a  new  child  process  is generated (option fork).  All data sent by the",
        "clients are append’ed to the file /tmp/in.log.  If the  file  does  not  exist,  socat",
        "creat’s it.  Option reuseaddr allows immediate restart of the server process.",
        "generates  a  pseudo terminal device (PTY) on the client that can be reached under the",
        "symbolic link $HOME/dev/vmodem0.  An application that expects a serial line  or  modem",
        "can  be  configured to use $HOME/dev/vmodem0; its traffic will be directed to a modem‐",
        "server via ssh where another socat instance links it to /dev/ttyS0.",
        "starts a forwarder that accepts connections on port 2022, and directs them through the",
        "proxy  daemon  listening  on  port  3128  (proxyport) on host proxy, using the CONNECT",
        "method, where they are authenticated as \"user\"  with  \"pass\"  (proxyauth).  The  proxy",
        "should establish connections to host www.domain.org on port 22 then.",
        "is an OpenSSL client that tries to establish a secure connection to an SSL server. Op‐",
        "tion cafile specifies a file that contains trust certificates:  we  trust  the  server",
        "only  when  it  presents one of these certificates and proofs that it owns the related",
        "private key.  Otherwise the connection is terminated.  With cert a file containing the",
        "client  certificate  and  the associated private key is specified. This is required in",
        "case the server wishes a client authentication; many Internet servers do not.",
        "The first address (’-’) can be replaced by almost any other socat address.",
        "is an OpenSSL server that accepts TCP connections, presents the certificate  from  the",
        "file  server.pem  and  forces  the  client  to  present a certificate that is verified",
        "against cafile.crt.",
        "The second address (’PIPE’) can be replaced by almost any other socat address.",
        "For instructions on generating and distributing OpenSSL keys and certificates see  the",
        "additional socat docu socat-openssl.txt.",
        "creates  a  100GB  sparse  file;  this  requires a file system type that supports this",
        "(ext2, ext3, reiserfs, jfs; not minix, vfat). The operation of writing  1  byte  might",
        "take  long  (reiserfs: some minutes; ext2: \"no\" time), and the resulting file can con‐",
        "sume some disk space with just its inodes (reiserfs: 2MB; ext2: 16KB).",
        "socat tcp-l:7777,reuseaddr,fork system:’’filan -i 0 -s >&2’’,nofork",
        "listens for incoming TCP connections on port 7777. For each accepted  connection,  in‐",
        "vokes  a  shell.  This  shell  has  its stdin and stdout directly connected to the TCP",
        "socket (nofork).  The shell starts filan and lets it print  the  socket  addresses  to",
        "stderr (your terminal window).",
        "functions as primitive binary editor: it writes the 4 bytes 000 014 000 000 to the ex‐",
        "ecutable /usr/bin/squid at offset 0x00074420 (this is a real world patch to  make  the",
        "squid executable from Cygwin run under Windows, actual per May 2004).",
        "connects to an unknown service and prevents being flooded.",
        "merges  data  arriving  from  different TCP streams on port 8888 to just one stream to",
        "target:9999. The end-close option prevents the child processes forked off by the  sec‐",
        "ond  address from terminating the shared connection to 9999 (close(2) just unlinks the",
        "inode which stays active as long as the parent process lives;  shutdown(2)  would  ac‐",
        "tively terminate the connection).",
        "sends  a broadcast to the network 192.168.1.0/24 and receives the replies of the time‐",
        "servers there. Ignores NTP packets from hosts outside this network.",
        "socat - SOCKET-DATAGRAM:2:2:17:x007bxc0a80100x0000000000000000,b‐‐",
        "ind=x007bx00000000x0000000000000000,setsockopt-int=1:6:1,r‐‐",
        "is semantically equivalent to the previous example, but all parameters are specified",
        "in generic form. the value 6 of setsockopt-int is the Linux value for SOBROADCAST.",
        "sends a broadcast to the local network(s) using protocol 44. Accepts replies from the",
        "private address range only.",
        "transfers data from stdin to the specified multicast address using UDP. Both local and",
        "remote ports are 6666. Tells the interface eth0 to also accept multicast packets of",
        "the given group. Multiple hosts on the local network can run this command, so all data",
        "sent by any of the hosts will be received by all the other ones. Note that there are",
        "many possible reasons for failure, including IP-filters, routing issues, wrong inter‐",
        "face selection by the operating system, bridges, or a badly configured switch.",
        "establishes one side of a virtual (but not private!) network with host2 where a simi‐",
        "lar process might run, with UDP-L and tun address 192.168.255.2. They can reach each",
        "other using the addresses 192.168.255.1 and 192.168.255.2. Note that streaming eg.via",
        "TCP or SSL does not guarantee to retain packet boundaries and might thus cause packet",
        "loss.",
        "establishes a VSOCK connection with the host (host is always reachable with the",
        "well-know CID=2) on 1234 port.",
        "listens for a VSOCK connection on 1234 port.",
        "establishes a VSOCK connection with the guest that have CID=31 on 1234 port, binding",
        "the local socket to the 5555 port.",
        "starts a forwarder that accepts VSOCK connections on port 3333, and directs them to",
        "the guest with CID=42 on the same port.",
        "forwards VSOCK connections from 22 port to the local SSH server.  Running this in a VM",
        "allows you to connect via SSH from the host using VSOCK, as in the example below.",
        "forwards TCP connections from 22222 port to the guest with CID=33 listening on VSOCK",
        "port 22.  Running this in the host, allows you to connect via SSH running \"ssh -p",
        "22222 user@localhost\", if the guest runs the example above.",
        "circumvents the problem that pppd requires a serial device and thus might not be able",
        "to work on a synchronous line that is represented by a network device.  socat creates",
        "a PTY to make pppd happy, binds to the network interface hdlc0, and can transfer data",
        "between both devices. Use pppd on device /var/run/ppp then.",
        "OK\\\\\\nDocumentType: text/plain\\\\\\n\\\\\\ndate: \\$\\(date\\)\\\\\\nserver:\\$SOCATSOCKADDR:\\$SO‐‐",
        "CATSOCKPORT\\\\\\nclient: \\$SOCATPEERADDR:\\$SOCATPEERPORT\\\\\\n\\\\\\\"\\\"; cat; echo -e",
        "creates a simple HTTP echo server: each HTTP client that connects gets a valid HTTP",
        "reply that contains information about the client address and port as it is seen by the",
        "server host, the host address (which might vary on multihomed servers), and the origi‐",
        "nal client request.",
        "socat -d -d UDP4-RECVFROM:9999,so-broadcast,so-timestamp,ip-pkt‐‐",
        "info,ip-recverr,ip-recvopts,ip-recvtos,ip-recvttl!!- SYSTEM:’’export; sleep 1’’ |grep SOCAT",
        "waits for an incoming UDP packet on port 9999 and prints the environment variables",
        "provided by socat. On BSD based systems you have to replace ip-pktinfo with ip-recvd‐",
        "staddr,ip-recvif. Especially interesting is SOCATIPDSTADDR: it contains the target",
        "address of the packet which may be a unicast, multicast, or broadcast address.",
        "echo -e \"M-SEARCH * HTTP/1.1\\nHOST: 239.255.255.250:1900\\nMAN: \\\"ssdp:discover\\\"\\nMX: 4\\nST:",
        "sends an SSDP (Simple Service Discovery Protocol) query to the local network and col‐",
        "lects and outputs the answers received."
    ],
    "see_also": [
        {
            "name": "nc",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/nc/1/json"
        },
        {
            "name": "rinetd",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/rinetd/8/json"
        },
        {
            "name": "openssl",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/openssl/1/json"
        },
        {
            "name": "stunnel",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/stunnel/8/json"
        },
        {
            "name": "rlwrap",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/rlwrap/1/json"
        },
        {
            "name": "setsid",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/setsid/1/json"
        }
    ]
}