fetch() can send HTTP requests over a unix domain socket with the unix option.
The
unix option is the local file path to a unix domain socket. fetch() sends the request over that socket instead of a TCP connection. HTTPS is also supported: use the https:// protocol in the URL instead of http://.
To send a POST request to an API endpoint over a unix domain socket: