def dataReceived(self, data): if self._firstByte: if data[0] != '\x00': # we don't support the HTTP relay self.transport.loseConnection() return data = data[1:] self._firstByte = False BaseProtocol.dataReceived(self, data)