Update index.js

Added missing hasOwnProperty check. socket.io breaks without it when Object.prototype has been extended.
Merge pull request #1600 from poldridge/master

Update index.js