[cloud-sync] - Extract ws handler.