'This method verifies the extension to socks4 that allows the client
to send 0.0.0.x as IP address to indicate to the server that it should resolve the hostname
sent in the ID field and then connect to it.'

def validate_socks4a(self, req):

    ipAddress = req['address'][0]
    if ipAddress.startswith('0.0.0.'):
        if (req['userid'] != ''):
            req['address'] = (socket.gethostbyname(req['userid']), req['address'][1])
        else:
            log.debug('Invalid    socks4a    request.')
    else:
        pass
    return req
