TooTallNate/node-telnet — pull request #3 by danielbolan (2013-07-02 00:15:21+00:00)
Title: Add IP command and TIMING-MARK option to fix issue #1

So it looks like hitting CTRL-C (in Linux 3.2.0, in my case) sends two commands:
```
IAC IP (ff f4)
IAC DO TIMING-MARK (ff fd 06)
```
I've associated two functions to work the IP command and the TIMING-MARK option so it at the very least doesn't crash. The following code should all work when you hit CTRL-C:

```js
var telnet = require('telnet');
telnet.createServer(function(client) {
console.log('CLIENT CONNECTED');
client.write('hello!\n');
client.pipe(client);

client.on('ip',function() {
console.log('INTERRUPT PROCESS');
client.end();
});

client.on('timing mark', function() {
console.log('TIMING-MARK');
});

client.on('end',function() {
console.log('CLIENT DISCONNECTED');
});
}).listen(9999);
```

A few things worth noting:
- I implemented the IP command the same way as the IAC. This is a bit of repeated code, I don't know if someone would like to generalize that, or really even if that is correct in the first place.
- I'm not sure that the ```'ip'``` event lines up exactly with your design. Let me know if this is an issue.
- Using a telnet client in windows does not cause the 'ip' nor the 'timing mark' events to emit. (I'm sure you figured that out by now, but still worth stating explicitly)