use `window.location.protocol` so we can use ES behind SSL
Merge pull request #119 from errordeveloper/master

Use `window.location.protocol` so we can use ES behind SSL