'Called when client send data over the shell session.
Just echo the received data and and if Ctrl+C is received, close the
session.'

def dataReceived(self, data):

    if (data == '\r'):
        data = '\r\n'
    elif (data == '\x03'):
        self.transport.loseConnection()
        return
    self.transport.write(data)
