S6-TCPCLIENT(8)

πŸ“¦ version 2.8.0.1, in nixpkgs unstable

πŸ’… S6-TCPCLIENT(8) πŸ’…

okay so bestie, this is the manual page for s6-tcpclient β€” part of the System Manager's Manual, section 8 (that's the "system administration" corner of the manual, iykyk). she's a Unix page and she ate. let's get into it 🫢


✨ NAME ✨

s6-tcpclient β€” the UCSPI client tool[1] for INET domain sockets. literally her whole job πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

s6-tcpclient [-q | -Q | -v] [-4 | -6] [-d | -D] [-r | -R] [-h] [-H]
             [-n | -N] [-t timeout] [-l localname] [-T timeoutconn]
             [-i localip] [-p localport] host port prog...

πŸ¦‹ DESCRIPTION πŸ¦‹

so what she does is: s6-tcpclient establishes a TCP connection to a server, then executes into a program. that's the whole vibe.

specifically β€” she establishes a TCP connection to host host port port.

then she executes into prog... with descriptor 6 reading from the network and descriptor 7 writing to it. iconic fd assignment tbh πŸ’…

🌸 Host address determination 🌸

host may be an IP address, in which case s6-tcpclient will connect to that IP address. and ngl, if the underlying skalibs has been compiled with IPv6 support, host can be an IPv6 address as well as an IPv4 one. versatile queen.

host may also be a domain name, in which case a DNS resolution will be performed on it, and a connection will be tried to all the resulting IP addresses in a round-robin fashion, twice: first with a small timeout, then with a longer timeout. the first address to answer wins πŸ’€ the connection attempt fails if no address in the list is able to answer. like, all of them ghosted her. rude.


✨ OPTIONS ✨

  • -q β€” be quiet. 🀫
  • -Q β€” be normally verbose. this is the default, bestie.
  • -v β€” be verbose. say more, queen.
  • -4 β€” interpret host as an IPv4 address or make A queries to determine its addresses. do not attempt IPv6.
  • -6 β€” (only valid if the underlying skalibs has IPv6 support) interpret host as an IPv6 address or make AAAA queries to determine its addresses. do not attempt IPv4.
  • -d β€” don't use the TCP_NODELAY socket option. this is the default.
  • -D β€” use the TCP_NODELAY socket option, which disables Nagle's algorithm. πŸ‘€
  • -r β€” try and obtain a TCPREMOTEINFO string via the IDENT protocol. heads up: this is obsolete and unreliable, and should only be used for compatibility with legacy programs. like, fr fr, only for the old ones.
  • -R β€” do not use the IDENT protocol. this is the default.
  • -h β€” consult the /etc/hosts database before performing DNS queries. the default, when this option is not given, is to ignore /etc/hosts. and note the -H option overrides -h and voids any kind of lookup. so don't be doing both, ok?
  • -H β€” do not try and obtain the local or remote host names via DNS. the default, when this option is not given, is to look up the local and remote host IPs in the DNS database to get the corresponding names.
  • -n β€” qualify host when resolving it to find suitable IP addresses.
  • -N β€” do not qualify host. this is the default.
  • -t timeout β€” put a global timeout on the connection attempt. if no fully functional connection has been established after timeout seconds, abort the program. by default, timeout is 0, which means no timeout. ⏰
  • -i localip β€” use localip as the local socket address for the connection. by default, address selection is left to the operating system.
  • -p localport β€” use localport as the local socket port for the connection. by default, port selection is left to the operating system.
  • -l localname β€” use localname as the value of the TCPLOCALHOST environment variable instead of looking it up via the DNS.
  • -T timeoutconn β€” configure the connection timeouts. timeoutconn must be of the form x+y, where x and y are integers. x is the first timeout and y is the second one: all suitable addresses for host are first tried with a timeout of x seconds, and if all of them fail, then they are tried again with a timeout of y seconds. (be aware that the timeout specified with the -t option overrides everything.) by default, x is 2 and y is 58. ✨

πŸ’œ ENVIRONMENT πŸ’œ

prog... is run with the following variables set:

  • PROTO β€” always set to TCP.
  • TCPREMOTEIP β€” set to the chosen IP address of host.
  • TCPREMOTEPORT β€” set to port.
  • TCPREMOTEHOST β€” if the -H option has been given, set to the name obtained by a reverse DNS resolution of the IP address chosen for host. else unset.
  • TCPLOCALHOST β€” if the -l option has been given, set to localname. else set to the name obtained by a reverse DNS resolution of the IP address chosen for the local host.
  • TCPREMOTEINFO β€” if the -r option has been given, set to the information given by an IDENT server on host about the current connection (very unreliable). else unset. πŸ™ˆ

🌈 SEE ALSO 🌈

[1] https://cr.yp.to/proto/ucspi.txt

this man page is ported from the authoritative documentation at: https://skarnet.org/software/s6-networking/s6-tcpclient.html


πŸ‘‘ AUTHORS πŸ‘‘

  • Laurent Bercot
  • Alexis <flexibeast@gmail.com> (man page port)

okay that's the whole page, no cap. this one's a Debian joint, dated October 12, 2024 β€” and yes, S6-TCPCLIENT(8) is the header, so now you know exactly which page you're in. go forth and connect, bestie πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from