summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--app.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/app.js b/app.js
index e1330790..2261cc3c 100644
--- a/app.js
+++ b/app.js
@@ -114,6 +114,16 @@ app.use(session({
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
app.use(function (req, res, next) {
if (toobusy()) {