def wrapper(*args, **kwargs): ans = WebSocketConnection(*args, **kwargs) ans.request_handler = handler ans.websocket_handler = websocket_handler ans.static_cache = static_cache ans.translator_cache = translator_cache return ans