{
    "mode": "man",
    "parameter": "systemd-socket-proxyd",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/systemd-socket-proxyd/8/json",
    "generated": "2026-06-15T13:12:39Z",
    "synopsis": "systemd-socket-proxyd [OPTIONS...] HOST:PORT\nsystemd-socket-proxyd [OPTIONS...] UNIX-DOMAIN-SOCKET-PATH",
    "sections": {
        "NAME": {
            "content": "systemd-socket-proxyd - Bidirectionally proxy local sockets to another (possibly remote)\nsocket\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "systemd-socket-proxyd [OPTIONS...] HOST:PORT\n\nsystemd-socket-proxyd [OPTIONS...] UNIX-DOMAIN-SOCKET-PATH\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "systemd-socket-proxyd is a generic socket-activated network socket forwarder proxy daemon for\nIPv4, IPv6 and UNIX stream sockets. It may be used to bi-directionally forward traffic from a\nlocal listening socket to a local or remote destination socket.\n\nOne use of this tool is to provide socket activation support for services that do not\nnatively support socket activation. On behalf of the service to activate, the proxy inherits\nthe socket from systemd, accepts each client connection, opens a connection to a configured\nserver for each client, and then bidirectionally forwards data between the two.\n\nThis utility's behavior is similar to socat(1). The main differences for\nsystemd-socket-proxyd are support for socket activation with \"Accept=no\" and an event-driven\ndesign that scales better with the number of connections.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "The following options are understood:\n",
            "subsections": [
                {
                    "name": "-h --help",
                    "content": "Print a short help text and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "--version",
                    "content": "Print a short version string and exit.\n\n--connections-max=, -c\nSets the maximum number of simultaneous connections, defaults to 256. If the limit of\nconcurrent connections is reached further connections will be refused.\n",
                    "long": "--version"
                },
                {
                    "name": "--exit-idle-time=",
                    "content": "Sets the time before exiting when there are no connections, defaults to infinity. Takes a\nunit-less value in seconds, or a time span value such as \"5min 20s\".\n"
                }
            ]
        },
        "EXIT STATUS": {
            "content": "On success, 0 is returned, a non-zero failure code otherwise.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "",
            "subsections": [
                {
                    "name": "Simple Example",
                    "content": "Use two services with a dependency and no namespace isolation.\n"
                },
                {
                    "name": "Example 1. proxy-to-nginx.socket",
                    "content": "[Socket]\nListenStream=80\n\n[Install]\nWantedBy=sockets.target\n"
                },
                {
                    "name": "Example 2. proxy-to-nginx.service",
                    "content": "[Unit]\nRequires=nginx.service\nAfter=nginx.service\nRequires=proxy-to-nginx.socket\nAfter=proxy-to-nginx.socket\n\n[Service]\nExecStart=/lib/systemd/systemd-socket-proxyd /run/nginx/socket\nPrivateTmp=yes\nPrivateNetwork=yes\n"
                },
                {
                    "name": "Example 3. nginx.conf",
                    "content": "[...]\nserver {\nlisten       unix:/run/nginx/socket;\n[...]\n"
                },
                {
                    "name": "Example 4. Enabling the proxy",
                    "content": "# systemctl enable --now proxy-to-nginx.socket\n$ curl http://localhost:80/\n\nIf nginx.service has StopWhenUnneeded= set, then passing --exit-idle-time= to\nsystemd-socket-proxyd allows both services to stop during idle periods.\n"
                },
                {
                    "name": "Namespace Example",
                    "content": "Similar as above, but runs the socket proxy and the main service in the same private\nnamespace, assuming that nginx.service has PrivateTmp= and PrivateNetwork= set, too.\n"
                },
                {
                    "name": "Example 5. proxy-to-nginx.socket",
                    "content": "[Socket]\nListenStream=80\n\n[Install]\nWantedBy=sockets.target\n"
                },
                {
                    "name": "Example 6. proxy-to-nginx.service",
                    "content": "[Unit]\nRequires=nginx.service\nAfter=nginx.service\nRequires=proxy-to-nginx.socket\nAfter=proxy-to-nginx.socket\nJoinsNamespaceOf=nginx.service\n\n[Service]\nExecStart=/lib/systemd/systemd-socket-proxyd 127.0.0.1:8080\nPrivateTmp=yes\nPrivateNetwork=yes\n"
                },
                {
                    "name": "Example 7. nginx.conf",
                    "content": "[...]\nserver {\nlisten       8080;\n[...]\n"
                },
                {
                    "name": "Example 8. Enabling the proxy",
                    "content": "# systemctl enable --now proxy-to-nginx.socket\n$ curl http://localhost:80/\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "systemd(1), systemd.socket(5), systemd.service(5), systemctl(1), socat(1), nginx(1), curl(1)\n\n\n\nsystemd 249                                                                 SYSTEMD-SOCKET-PROXYD(8)",
            "subsections": []
        }
    },
    "summary": "systemd-socket-proxyd - Bidirectionally proxy local sockets to another (possibly remote) socket",
    "flags": [
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Print a short help text and exit."
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "Print a short version string and exit. --connections-max=, -c Sets the maximum number of simultaneous connections, defaults to 256. If the limit of concurrent connections is reached further connections will be refused."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Sets the time before exiting when there are no connections, defaults to infinity. Takes a unit-less value in seconds, or a time span value such as \"5min 20s\"."
        }
    ],
    "examples": [
        "Use two services with a dependency and no namespace isolation.",
        "[Socket]",
        "ListenStream=80",
        "[Install]",
        "WantedBy=sockets.target",
        "[Unit]",
        "Requires=nginx.service",
        "After=nginx.service",
        "Requires=proxy-to-nginx.socket",
        "After=proxy-to-nginx.socket",
        "[Service]",
        "ExecStart=/lib/systemd/systemd-socket-proxyd /run/nginx/socket",
        "PrivateTmp=yes",
        "PrivateNetwork=yes",
        "[...]",
        "server {",
        "listen       unix:/run/nginx/socket;",
        "[...]",
        "# systemctl enable --now proxy-to-nginx.socket",
        "$ curl http://localhost:80/",
        "If nginx.service has StopWhenUnneeded= set, then passing --exit-idle-time= to",
        "systemd-socket-proxyd allows both services to stop during idle periods.",
        "Similar as above, but runs the socket proxy and the main service in the same private",
        "namespace, assuming that nginx.service has PrivateTmp= and PrivateNetwork= set, too.",
        "[Socket]",
        "ListenStream=80",
        "[Install]",
        "WantedBy=sockets.target",
        "[Unit]",
        "Requires=nginx.service",
        "After=nginx.service",
        "Requires=proxy-to-nginx.socket",
        "After=proxy-to-nginx.socket",
        "JoinsNamespaceOf=nginx.service",
        "[Service]",
        "ExecStart=/lib/systemd/systemd-socket-proxyd 127.0.0.1:8080",
        "PrivateTmp=yes",
        "PrivateNetwork=yes",
        "[...]",
        "server {",
        "listen       8080;",
        "[...]",
        "# systemctl enable --now proxy-to-nginx.socket",
        "$ curl http://localhost:80/"
    ],
    "see_also": [
        {
            "name": "systemd",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/systemd/1/json"
        },
        {
            "name": "systemd.socket",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/systemd.socket/5/json"
        },
        {
            "name": "systemd.service",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/systemd.service/5/json"
        },
        {
            "name": "systemctl",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/systemctl/1/json"
        },
        {
            "name": "socat",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/socat/1/json"
        },
        {
            "name": "nginx",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/nginx/1/json"
        },
        {
            "name": "curl",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/curl/1/json"
        },
        {
            "name": "SYSTEMD-SOCKET-PROXYD",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/SYSTEMD-SOCKET-PROXYD/8/json"
        }
    ]
}