Change endpoint to not use window.location.protocol and use '//' instead
Update snippet to support multiple instance names from the snippet closure