Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ClusterServer.prototype.generateId = function (req) {
var host;
if (this.hostAddress) {
host = this.hostAddress;
} else {
host = req.headers.host.match(this._hostRegex);
if (host) {
host = host[0];
} else {
host = '';
}
}
var port = req.connection.address().port;
return host + '_' + port + '_' + this.sourcePort + '_' + this.secure + '_' + base64id.generateId();
};
Server.prototype.handshake = function(transport, req){
var id = base64id.generateId();
debug('handshaking client "%s"', id);
var transportName = transport;
try {
var transport = new transports[transport](req);
if ('polling' == transportName) {
transport.maxHttpBufferSize = this.maxHttpBufferSize;
}
if (req._query && req._query.b64) {
transport.supportsBinary = false;
} else {
transport.supportsBinary = true;
}
}
Server.prototype.handshake = function(transport, req){
var id = base64id.generateId();
debug('handshaking client "%s"', id);
var transportName = transport;
try {
var transport = new transports[transport](req);
if ('polling' == transportName) {
transport.maxHttpBufferSize = this.maxHttpBufferSize;
}
if (req._query && req._query.b64) {
transport.supportsBinary = false;
} else {
transport.supportsBinary = true;
}
}
Server.prototype.handshake = function(transport, req){
var id = base64id.generateId();
debug('handshaking client "%s"', id);
var transportName = transport;
try {
var transport = new transports[transport](req);
if ('polling' == transportName) {
transport.maxHttpBufferSize = this.maxHttpBufferSize;
}
if (req._query && req._query.b64) {
transport.supportsBinary = false;
} else {
transport.supportsBinary = true;
}
}
Server.prototype.handshake = function(transport, req){
var id = base64id.generateId();
debug('handshaking client "%s"', id);
try {
var transport = new transports[transport](req);
}
catch (e) {
sendErrorMessage(req.res, Server.errors.BAD_REQUEST);
return;
}
var socket = new Socket(id, this, transport);
var self = this;
if (false !== this.cookie) {
transport.on('headers', function(headers){
headers['Set-Cookie'] = self.cookie + '=' + id;
Server.prototype.handshake = function(transport, req){
var id = base64id.generateId();
debug('handshaking client "%s"', id);
var transportName = transport;
try {
var transport = new transports[transport](req);
if ('polling' == transportName) {
transport.maxHttpBufferSize = this.maxHttpBufferSize;
}
if (req._query && req._query.b64) {
transport.supportsBinary = false;
} else {
transport.supportsBinary = true;
}
}