operate according to the code in the nodejs playbook, and find that when a new user connects to the node server, the connect event will not be triggered
code is as follows
node version 8.12
const events = require("events");
const net = require("net");
const server = net.createServer(function(client) {
const id = `${client.remoteAddress}:${client.remotePort}`;
client.on("connect", function() {
console.log(123123213);
});
//connection
client.on("data", function(data) {
console.log(data);
data = data.toString();
})
});
server.listen(8081);
connection code
telnet 127.0.0.1 8081