Renamed slice to index, now dynamically chosing websocket hostname