def METHOD_NAME(self, data):
    if self.websocket is not None:
        self.websocket.METHOD_NAME(data)
    else:
        # Pass it to HttpProtocol handler first
        # That will (hopefully) upgrade it to a websocket.
        super().METHOD_NAME(data)