summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Cheng-Han2016-11-18 12:18:29 +0800
committerWu Cheng-Han2016-11-18 12:18:29 +0800
commitf387bb312f70fec6507f11c6aa94615090cac105 (patch)
treeccf69d3999aa8f7486cd0a9b48a53b413e807226
parent09e6596074de176fa97efdb63062f19f6881b160 (diff)
Try to replace engine.io to uws in socket.io for better performance
-rw-r--r--app.js4
-rw-r--r--package.json1
2 files changed, 5 insertions, 0 deletions
diff --git a/app.js b/app.js
index adb7f81f..ea745dfb 100644
--- a/app.js
+++ b/app.js
@@ -58,6 +58,10 @@ app.use(morgan('combined', {
//socket io
var io = require('socket.io')(server);
+io.engine.ws = new (require('uws').Server)({
+ noServer: true,
+ perMessageDeflate: false
+});
//others
var realtime = require("./lib/realtime.js");
diff --git a/package.json b/package.json
index 57e31ccf..67da3e36 100644
--- a/package.json
+++ b/package.json
@@ -96,6 +96,7 @@
"tedious": "^1.14.0",
"to-markdown": "^3.0.1",
"toobusy-js": "^0.5.1",
+ "uws": "^0.11.0",
"visibilityjs": "^1.2.4",
"viz.js": "^1.3.0",
"winston": "^2.2.0",