'Entry point for proxy server.
Should return a WSGI-style callable (such as swob.Response).
:param req: swob.Request object'

def handle_request(self, req):

    try:
        self.logger.set_statsd_prefix('proxy-server')
        if (req.content_length and (req.content_length < 0)):
            self.logger.increment('errors')
            return HTTPBadRequest(request=req, body='Invalid    Content-Length')
        try:
            if (not check_utf8(req.path_info)):
                self.logger.increment('errors')
                return HTTPPreconditionFailed(request=req, body='Invalid    UTF8    or    contains    NULL')
        except UnicodeError:
            self.logger.increment('errors')
            return HTTPPreconditionFailed(request=req, body='Invalid    UTF8    or    contains    NULL')
        try:
            (controller, path_parts) = self.get_controller(req)
        except APIVersionError:
            self.logger.increment('errors')
            return HTTPBadRequest(request=req)
        except ValueError:
            self.logger.increment('errors')
            return HTTPNotFound(request=req)
        if (not controller):
            self.logger.increment('errors')
            return HTTPPreconditionFailed(request=req, body='Bad    URL')
        if (self.deny_host_headers and (req.host.split(':')[0] in self.deny_host_headers)):
            return HTTPForbidden(request=req, body='Invalid    host    header')
        self.logger.set_statsd_prefix(('proxy-server.' + controller.server_type.lower()))
        controller = controller(self, **path_parts)
        if ('swift.trans_id' not in req.environ):
            trans_id_suffix = self.trans_id_suffix
            trans_id_extra = req.headers.get('x-trans-id-extra')
            if trans_id_extra:
                trans_id_suffix += ('-' + trans_id_extra[:32])
            trans_id = generate_trans_id(trans_id_suffix)
            req.environ['swift.trans_id'] = trans_id
            self.logger.txn_id = trans_id
        req.headers['x-trans-id'] = req.environ['swift.trans_id']
        controller.trans_id = req.environ['swift.trans_id']
        self.logger.client_ip = get_remote_client(req)
        if (req.method not in controller.allowed_methods):
            return HTTPMethodNotAllowed(request=req, headers={'Allow': ',    '.join(controller.allowed_methods)})
        handler = getattr(controller, req.method)
        old_authorize = None
        if ('swift.authorize' in req.environ):
            resp = req.environ['swift.authorize'](req)
            if (not resp):
                old_authorize = req.environ['swift.authorize']
            elif (not getattr(handler, 'delay_denial', None)):
                return resp
        req.environ.setdefault('swift.orig_req_method', req.method)
        try:
            if old_authorize:
                req.environ.pop('swift.authorize', None)
            return handler(req)
        finally:
            if old_authorize:
                req.environ['swift.authorize'] = old_authorize
    except HTTPException as error_response:
        return error_response
    except (Exception, Timeout):
        self.logger.exception(_('ERROR    Unhandled    exception    in    request'))
        return HTTPServerError(request=req)
