def __call__(self, environ, start_response):
        """Route WSGI requests based on host names."""
        domain = environ.get('HTTP_HOST', '')
        if self.use_x_forwarded_host:
            domain = environ.get('HTTP_X_FORWARDED_HOST', domain)

        nextapp = self.domains.get(domain)
        if nextapp is None:
            nextapp = self.default
        return nextapp(environ, start_response)
Route WSGI requests based on host names.
cherrypy/_cpwsgi.py