mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 11:16:31 -05:00
Updated to support tls session resumption
This commit is contained in:
parent
d69d65ea74
commit
30d194bba4
1 changed files with 10 additions and 0 deletions
10
app.js
10
app.js
|
@ -114,6 +114,16 @@ app.use(session({
|
||||||
store: sessionStore
|
store: sessionStore
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// session resumption
|
||||||
|
var tlsSessionStore = {};
|
||||||
|
server.on('newSession', function (id, data, cb) {
|
||||||
|
tlsSessionStore[id.toString('hex')] = data;
|
||||||
|
cb();
|
||||||
|
});
|
||||||
|
server.on('resumeSession', function (id, cb) {
|
||||||
|
cb(null, tlsSessionStore[id.toString('hex')] || null);
|
||||||
|
});
|
||||||
|
|
||||||
//middleware which blocks requests when we're too busy
|
//middleware which blocks requests when we're too busy
|
||||||
app.use(function (req, res, next) {
|
app.use(function (req, res, next) {
|
||||||
if (toobusy()) {
|
if (toobusy()) {
|
||||||
|
|
Loading…
Reference in a new issue