location.origin var socket = io.connect(location.protocol + '//' + document.domain + ':' + location.port + namespace);