/
var
/
www
/
myprog.com.ua
/
server
/
node
/
node_modules
/
socket.io-client
/
lib
/
/var/www/myprog.com.ua/server/node/node_modules/socket.io-client/lib
mkdir
upload
Name
Size
Mode
Actions
index.js
1502
0644
edit
dl
rm
manager.js
9740
0644
edit
dl
rm
on.js
370
0644
edit
dl
rm
socket.js
6903
0644
edit
dl
rm
url.js
1490
0644
edit
dl
rm
Edit:
/var/www/myprog.com.ua/server/node/node_modules/socket.io-client/lib/url.js
(1490B)
/** * Module dependencies. */ var parseuri = require('parseuri'); var debug = require('debug')('socket.io-client:url'); /** * Module exports. */ module.exports = url; /** * URL parser. * * @param {String} url * @param {Object} An object meant to mimic window.location. * Defaults to window.location. * @api public */ function url(uri, loc){ var obj = uri; // default to window.location var loc = loc || global.location; if (null == uri) uri = loc.protocol + '//' + loc.hostname; // relative path support if ('string' == typeof uri) { if ('/' == uri.charAt(0)) { if ('undefined' != typeof loc) { uri = loc.hostname + uri; } } if (!/^(https?|wss?):\/\//.test(uri)) { debug('protocol-less url %s', uri); if ('undefined' != typeof loc) { uri = loc.protocol + '//' + uri; } else { uri = 'https://' + uri; } } // parse debug('parse %s', uri); obj = parseuri(uri); } // make sure we treat `localhost:80` and `localhost` equally if (!obj.port) { if (/^(http|ws)$/.test(obj.protocol)) { obj.port = '80'; } else if (/^(http|ws)s$/.test(obj.protocol)) { obj.port = '443'; } } obj.path = obj.path || '/'; // define unique id obj.id = obj.protocol + '://' + obj.host + ':' + obj.port; // define href obj.href = obj.protocol + '://' + obj.host + (loc && loc.port == obj.port ? '' : (':' + obj.port)); return obj; }
Save
cmd:
run