From 5f8e7a0fdb3b4597599bf6c77b98452efb29fc84 Mon Sep 17 00:00:00 2001 From: theanarkh Date: Tue, 28 Nov 2023 11:57:50 +0800 Subject: [PATCH] doc: add doc for Unix abstract socket PR-URL: https://github.com/nodejs/node/pull/50904 Refs: https://github.com/nodejs/node/pull/49667 Reviewed-By: Luigi Pinca Reviewed-By: Paolo Insogna --- doc/api/net.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/api/net.md b/doc/api/net.md index 3219c4aee97733..0cf32d6f506f68 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -38,7 +38,10 @@ it will unlink the Unix domain socket as well. For example, socket outside of these abstractions, the user will need to remove it. The same applies when a Node.js API creates a Unix domain socket but the program then crashes. In short, a Unix domain socket will be visible in the file system and -will persist until unlinked. +will persist until unlinked. On Linux, You can use Unix abstract socket by adding +`\0` to the beginning of the path, such as `\0abstract`. The path to the Unix +abstract socket is not visible in the file system and it will disappear automatically +when all open references to the socket are closed. On Windows, the local domain is implemented using a named pipe. The path _must_ refer to an entry in `\\?\pipe\` or `\\.\pipe\`. Any characters are permitted,