makes websocket url dynamic based on hostname