How to handle CONTROL+C in node.js TCP server

how do I handle the CONTROL+C input in a node.js TCP server?

var server = net.createServer(function(c) {
    c.on('end', function() {
        console.log('Client disconnected');
    });
    c.on('data', function(data) {
        if (data == "CONTROL+C") { // Here is the check
            c.destroy();
        }
    });
}).listen(8124);

Control-C is a single byte, 0x03 (using an ASCII chart is kinda helpful).

However, whenever you're dealing with a socket connection you have to remember that you're going to receive data in a "chunked" fashion and the chunking does not necessarily correspond to the way the data was sent; you cannot assume that one send call on the client side corresponds to a single chunk on the server side. Therefore you can't assume that if the client sends a Control-C, it will be the only thing you receive in your data event. Some other data might come before it, and some other data might come after it, all in the same event. You will have to look for it inside your data.

From ebohlman's answer. It work.

c.on('data', function(data) {
    if (data.toString().charCodeAt(0) === 3) {
        c.destroy();
    }
});