{"id":3370,"date":"2022-12-20T17:02:28","date_gmt":"2022-12-20T20:02:28","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/systemdsocketproxyd-man8\/"},"modified":"2022-12-20T17:02:28","modified_gmt":"2022-12-20T20:02:28","slug":"systemdsocketproxyd-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/systemdsocketproxyd-man8\/","title":{"rendered":"SYSTEMD&minus;SOCKET&minus;PROXYD (man8)"},"content":{"rendered":"<h1 align=\"center\">SYSTEMD\u2212SOCKET\u2212PROXYD<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#EXIT STATUS\">EXIT STATUS<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">systemd-socket-proxyd \u2212 Bidirectionally proxy local sockets to another (possibly remote) socket<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"89%\">\n<p style=\"margin-top: 1em\"><b>systemd\u2212socket\u2212proxyd<\/b> [<i>OPTIONS<\/i>&#8230;] <i>HOST<\/i>:<i>PORT<\/i><\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"89%\">\n<p style=\"margin-top: 1em\"><b>systemd\u2212socket\u2212proxyd<\/b> [<i>OPTIONS<\/i>&#8230;] <i>UNIX\u2212DOMAIN\u2212SOCKET\u2212PATH<\/i><\/p>\n<\/td>\n<\/tr>\n<\/table>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><i><b>systemd\u2212socket\u2212proxyd<\/b><\/i> is a generic socket\u2212activated network socket forwarder proxy daemon for IPv4, IPv6 and UNIX stream sockets. It may be used to bi\u2212directionally forward traffic from a local listening socket to a local or remote destination socket.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">One use of this tool is to provide socket activation support for services that do not natively support socket activation. On behalf of the service to activate, the proxy inherits the socket from systemd, accepts each client connection, opens a connection to a configured server for each client, and then bidirectionally forwards data between the two.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This utility&#8217;s behavior is similar to <b>socat<\/b>(1). The main differences for <b>systemd\u2212socket\u2212proxyd<\/b> are support for socket activation with &#8220;Accept=no&#8221; and an event\u2212driven design that scales better with the number of connections.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The following options are understood:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212h<\/b>, <b>\u2212\u2212help<\/b><\/p>\n<p style=\"margin-left:17%;\">Print a short help text and exit.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212\u2212version<\/b><\/p>\n<p style=\"margin-left:17%;\">Print a short version string and exit.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212\u2212connections\u2212max=<\/b>, <b>\u2212c<\/b><\/p>\n<p style=\"margin-left:17%;\">Sets the maximum number of simultaneous connections, defaults to 256. If the limit of concurrent connections is reached further connections will be refused.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212\u2212exit\u2212idle\u2212time=<\/b><\/p>\n<p style=\"margin-left:17%;\">Sets the time before exiting when there are no connections, defaults to <b>infinity<\/b>. Takes a unit\u2212less value in seconds, or a time span value such as &#8220;5min 20s&#8221;.<\/p>\n<h2>EXIT STATUS <a name=\"EXIT STATUS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">On success, 0 is returned, a non\u2212zero failure code otherwise.<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Simple Example<\/b> <br \/> Use two services with a dependency and no namespace isolation.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Example\u00a01.\u00a0proxy\u2212to\u2212nginx.socket<\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">[Socket] <br \/> ListenStream=80<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">[Install] <br \/> WantedBy=sockets.target<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Example\u00a02.\u00a0proxy\u2212to\u2212nginx.service<\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">[Unit] <br \/> Requires=nginx.service <br \/> After=nginx.service <br \/> Requires=proxy\u2212to\u2212nginx.socket <br \/> After=proxy\u2212to\u2212nginx.socket<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">[Service] <br \/> ExecStart=\/usr\/lib\/systemd\/systemd\u2212socket\u2212proxyd \/run\/nginx\/socket <br \/> PrivateTmp=yes <br \/> PrivateNetwork=yes<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Example\u00a03.\u00a0nginx.conf<\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">[&#8230;] <br \/> server { <br \/> listen unix:\/run\/nginx\/socket; <br \/> [&#8230;]<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Example\u00a04.\u00a0Enabling the proxy<\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"># systemctl enable \u2212\u2212now proxy\u2212to\u2212nginx.socket <br \/> $ curl http:\/\/localhost:80\/<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If nginx.service has <i>StopWhenUnneeded=<\/i> set, then passing <b>\u2212\u2212exit\u2212idle\u2212time=<\/b> to <b>systemd\u2212socket\u2212proxyd<\/b> allows both services to stop during idle periods.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Namespace Example<\/b> <br \/> Similar as above, but runs the socket proxy and the main service in the same private namespace, assuming that nginx.service has <i>PrivateTmp=<\/i> and <i>PrivateNetwork=<\/i> set, too.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Example\u00a05.\u00a0proxy\u2212to\u2212nginx.socket<\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">[Socket] <br \/> ListenStream=80<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">[Install] <br \/> WantedBy=sockets.target<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Example\u00a06.\u00a0proxy\u2212to\u2212nginx.service<\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">[Unit] <br \/> Requires=nginx.service <br \/> After=nginx.service <br \/> Requires=proxy\u2212to\u2212nginx.socket <br \/> After=proxy\u2212to\u2212nginx.socket <br \/> JoinsNamespaceOf=nginx.service<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">[Service] <br \/> ExecStart=\/usr\/lib\/systemd\/systemd\u2212socket\u2212proxyd 127.0.0.1:8080 <br \/> PrivateTmp=yes <br \/> PrivateNetwork=yes<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Example\u00a07.\u00a0nginx.conf<\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">[&#8230;] <br \/> server { <br \/> listen 8080; <br \/> [&#8230;]<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Example\u00a08.\u00a0Enabling the proxy<\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"># systemctl enable \u2212\u2212now proxy\u2212to\u2212nginx.socket <br \/> $ curl http:\/\/localhost:80\/<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>systemd<\/b>(1), <b>systemd.socket<\/b>(5), <b>systemd.service<\/b>(5), <b>systemctl<\/b>(1), <b>socat<\/b>(1), <b>nginx<\/b>(1), <b>curl<\/b>(1)<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  systemd-socket-proxyd \u2212 Bidirectionally proxy local sockets to another (possibly remote) socket <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,498],"class_list":["post-3370","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-systemd-socket-proxyd"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3370","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3370"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3370\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3370"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}