Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
);
});
} else { // auth is not necessary, simply go ahead and dispatch to funcs
dispatcher(req, res);
}
}
spdy.server.Server.call(this, options);
this.on("connect", handleRequest);
this.on("request", handleRequest);
};
util.inherits(SPDYProxy, spdy.server.Server);
var createServer = function(options) {
return new SPDYProxy(options);
};
exports.SPDYProxy = SPDYProxy;
exports.createServer = createServer;
} catch (error) {
log.error('synReply error: ' + error.message);
callback.call();
}
}
spdy.server.Server.call(this, {
key: fs.readFileSync(options.proxy.sslKeyPath),
cert: fs.readFileSync(options.proxy.sslCertPath)
});
this.on('connect', handleConnect);
this.on('request', handleRequest);
this.on('listening', handleListen);
};
util.inherits(SpdyProxy, spdy.server.Server);
module.exports = SpdyProxy;
module.exports.log = log;
common.watchUserDB(this, config.user_db);
}
this.maxConnections = config.maxConnections;
this.maxHeadersCount = 60;
this._listen = this.listen;
this.listen = function(port) {
this._listen(port? port : config.port, config.host);
this.log('Server up listening at ' + config.host + ':' + config.port);
process.on('uncaughtException', function(e) {
self.log('[uncaughtException]: '+ e.message);
});
};
};
common.inherits(Server, spdy.server.Server);
exports.Server = Server;
var createServer = function(config, overrides) {
return new Server(config, overrides);
};
exports.createServer = createServer;
var connectionHandler = function(client) {
var debug, connection, IP, conID, user;
debug = this.debug;
connection = client.socket;
IP = connection.IP = connection.remoteAddress;
conID = connection.conID = IP + ':' + connection.remotePort;
try {
user = connection.user = this.userDB[connection.getPeerCertificate().fingerprint];