Node.js get socket file descriptor?

How can I get a file descriptor (respectively its path) socket?

I can open the file descriptor when I know its path as follows:

var fd = require("fs").createReadStream(pathOfFileDescriptor); 

eg

 require("fs").createReadStream("/proc/"+process.pid+"/fd/0").on("data",function(d){ console.log("The following data comes from stdin: "+d); }); 

Now, how can I find out which file descriptor file for which socket?

Hope someone can help!

+4
source share
1 answer

This currently seems impossible. Perhaps in future versions of node.js

0
source

Source: https://habr.com/ru/post/1386131/


All Articles