From db0aa964f56d72126d16e87bcb834deca6b12512 Mon Sep 17 00:00:00 2001 From: Jenny_L Date: Thu, 12 Nov 2020 13:10:50 +0800 Subject: [PATCH] fix crash when upgrade to socket.io 3.0.0 (#1031) --- app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 52f0e4d1c..1c50a73cf 100644 --- a/app.js +++ b/app.js @@ -28,7 +28,7 @@ const self = require('./package') const app = express() , server = http.createServer(app) -, io = socket.listen(server) +, io = socket(server) , Sink = sink.Sink , version = self.version ; @@ -46,7 +46,7 @@ l10n.setLanguage('en_GB'); server.listen(process.argv[2] || process.env.PORT || DEFAULT_PORT); -io.sockets.on("connection", function (socket) { +io.on("connection", function (socket) { socket.emit("handshake", { version: version }); socket.on("extractMetadata", function (data) { if (!data.url) return socket.emit("exception", { message: "URL not provided." });