Update application.js

improved method for collecting this.socket