Connect to origin or local based on query string param