const server = net.createServer((socket) => { console.log('Client connected');
const clientAddress = socket.remoteAddress; console.log(`Client IP address is ${clientAddress}`);
socket.on('data', (data) => { console.log(`Received from client: ${data}`); socket.write(`Hello from server! Your IP address is ${clientAddress}`); });