def validateSOCKS4aHost(host): try: host = socket.inet_pton(socket.AF_INET, to_string(host)) except socket.error: return if host[:3] == '\0\0\0' and host[3] != '\0': raise ValueError('SOCKS4a reserves addresses 0.0.0.1-0.0.0.255')
def dataReceived(self, data): data = to_string(data) return ParserProtocol.dataReceived(self, data)