CONTENT
  • CHANGES
Szukaj
counter

#top socat


socat - Multipurpose relay (SOcket CAT)

Powiązane:

SYNOPSIS
socat [options] <address> <address>
socat -V
socat -h[h[h]] | -?[?[?]]
filan
procan


DESCRIPTION



OPTIONS
Socat provides some command line options that modify the behaviour of the program. They have nothing to do with so called address options that are used as parts of address specifications.

-V
Print version and available feature information to stdout, and exit.

-h | -?
Print a help text to stdout describing command line options and available address types, and exit.

-hh | -??
Like -h, plus a list of the short names of all available address options. Some options are platform dependend, so this output is helpful for checking the particular implementation.

-hhh | -???
Like -hh, plus a list of all available address option names.

-d
Without this option, only fatal and error messages are generated; applying this option also prints warning messages. See DIAGNOSTICS for more information.

-d -d
Prints fatal, error, warning, and notice messages.

-d -d -d
Prints fatal, error, warning, notice, and info messages.

-d -d -d -d
Prints fatal, error, warning, notice, info, and debug messages.

-D
Logs information about file descriptors before starting the transfer phase.

-ly[<facility>]
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".

-lf <logfile>
Writes messages to <logfile> [filename] instead of stderr.

-ls
Writes messages to stderr (this is the default).

-lp<progname>
Overrides the program name printed in error messages and used for constructing environment variable names.

-lu
Extends the timestamp of error messages to microsecond resolution. Does not work when logging to syslog.

-lm[<facility>]
Mixed log mode. During startup messages are printed to stderr; when socat starts the transfer phase loop or daemon mode (i.e. after opening all streams and before starting data transfer, or, with listening sockets with fork option, before the first accept call), it switches logging to syslog. With optional <facility>, the syslog type can be selected, default is "daemon".

-lh
Adds hostname to log messages. Uses the value from environment variable HOSTNAME or the value retrieved with uname() if HOSTNAME is not set.

-v
Writes the transferred data not only to their target streams, but also to stderr. The output format is text with some conversions for readability, and prefixed with "> " or "< " indicating flow directions.

-x
Writes the transferred data not only to their target streams, but also to stderr. The output format is hexadecimal, prefixed with "> " or "< " indicating flow directions. Can be combined with -v .

-b<size>
Sets the data transfer block <size> [size_t]. At most <size> bytes are transferred per step. Default is 8192 bytes.

-s
By default, socat terminates when an error occurred to prevent the process from running when some option could not be applied. With this option, socat is sloppy with errors and tries to continue. Even with this option, socat will exit on fatals, and will abort connection attempts when security checks failed.

-t<timeout>
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 seconds. This timeout only applies to addresses where write and read part can be closed independently. When during the timeout interval the read part gives EOF, socat terminates without awaiting the timeout.

-T<timeout>
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.

-u
Uses unidirectional mode. The first address is only used for reading, and the second address is only used for writing (example).

-U
Uses unidirectional mode in reverse direction. The first address is only used for writing, and the second address is only used for reading.

-g
During address option parsing, don't check if the option is considered useful in the given address environment. Use it if you want to force, e.g., appliance of a socket option to a serial device.

-L<lockfile>
If lockfile exists, exits with error. If lockfile does not exist, creates it and continues, unlinks lockfile on exit.

-W<lockfile>
If lockfile exists, waits until it disappears. When lockfile does not exist, creates it and continues, unlinks lockfile on exit.

-4
Use IP version 4 in case that the addresses do not implicitly or explicitly specify a version; this is the default.

-6
Use IP version 6 in case that the addresses do not implicitly or explicitly specify a version.




EXAMPLES
Dwie analogiczne składnie podawania argumentu typu address (socket).
echo ... | socat stdio /var/lib/haproxy/stats
echo ... | socat stdio unix-connect:/var/lib/haproxy/stats




Zmodyfikowany ostatnio: 2014/05/15 10:01:11 (9 lat temu), textsize: 6,82 kB, htmlsize: 7,94 kB

Zapraszam do komentowania, zgłaszania sugestii, propozycji, własnych przykładów, ...
Dodaj komentarzKomentarze użytkowników