I currently have the following code:
net = require('net');
var clients = [];
net.createServer(function(s) {
clients.push(s);
s.on('data', function (data) {
clients.forEach(function(c) {
c.write(data);
});
process.stdout.write(data);
});
s.on('end', function() {
process.stdout.write("lost connection");
});
}).listen(9876);
Used to configure my Windows computer as a server and receive data from my Linux computer. He is currently writing data to the command window. I would like to write data to a text file in a specific place, how to do it?
Fwing source
share