);
  });
});

server.listen(5757);
console.log('server 啟動');

```

關於 readline 的用法請參考：  <https://nodejs.org/api/readline.html>

Client 端

檔案: ChatClient.js

```javascript
var net = require('net');
var readline = require('readline').createInterface(process.stdin, process.stdout);

var client = new net.Socket();

readline.on('line', function(line) {
  client.write(line);
  readline.prompt();
});
  
client.connect(5757, '127.0.0.1', function() {
  console.log('連接 ' + client.remo