code: def wsgi_app(self, environ, start_response):
          
  
          path = environ['PATH_INFO']
  
          if re.match(self.path_pattern, path):
              ws = environ['wsgi.websocket']
              address = (environ.get('REMOTE_ADDR'), environ.get('REMOTE_PORT'))
              self._handle_stream(ws, address)
          else:
              if self.merge_wsgi_app:
                  return self.merge_wsgi_app(environ, start_response)
              else:
                  start_response("400 Bad Request", [])
                  return ['400 Bad Request']
docs: 将原始的app，包装为包括websocket的app