Update index.js

Added fix for malformed protocols due to double escaping and quoting strings.