How can one connect to an abstract namespace unix family address in nodejs?

StackOverflow https://stackoverflow.com/questions/20489223

  •  30-08-2022
  •  | 
  •  

سؤال

Has anybody tried to connect to an abstract namespace path (which starts with a null character) on unix family addresses in nodejs? The problem seems to be that node internally sets the encoding of the path to ascii and consequently converts '\0' to space character. I tried buffers but didn't change anything.

If you wanna know what "abstract namespace" in unix address family means see the paragraph titled "abstract:" in "Address format" section of this link: http://man7.org/linux/man-pages/man7/unix.7.html

هل كانت مفيدة؟

المحلول

It seems that special module should be used for: https://www.npmjs.org/package/abstractsocket

نصائح أخرى

Since 0.12 this is supported by the core net module.

For 0.10: The the module proposed by socketpair uses child process api and an external utility socat (similar to netcat), and does not let you create servers, just client connections. A better alternative is https://www.npmjs.com/package/abstract-socket - it is a binary module instead.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top