def on_close(self):
        # Required for cache_handler
        self.handshake_response = tornado.httpclient.HTTPResponse(
            self.handshake_request,
            self.upstream_connection.code,
            headers=self.upstream_connection.headers,
            request_time=0)
        # Procedure for dumping a tornado request-response
        self.cache_handler = CacheHandler(
            self.application.cache_dir,
            self.handshake_request,
            self.application.cookie_regex,
            self.application.cookie_blacklist)
        self.cached_response = self.cache_handler.load()
        self.cache_handler.dump(self.handshake_response)
Called when websocket is closed.
dataset/ETHPy150Open owtf/owtf/framework/http/proxy/proxy.py/CustomWebSocketHandler.on_close