From b254fcfb4f6aefe7d23faea79a6d53f5040dcd78 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Wed, 15 Jul 2020 11:02:02 -0700 Subject: [PATCH] default socketio config --- api/utils/socket.ts | 13 +++---------- dist/api/utils/socket.js | 13 +++---------- dist/api/utils/socket.js.map | 2 +- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/api/utils/socket.ts b/api/utils/socket.ts index 916298d..92d2024 100644 --- a/api/utils/socket.ts +++ b/api/utils/socket.ts @@ -3,22 +3,15 @@ const socketio = require("socket.io"); let io: any function connect(server) { - io = socketio(server, { - // path: '/socket', - serveClient: false, - // below are engine.IO options - pingInterval: 10000, - pingTimeout: 5000, - cookie: false - }); + io = socketio(server); io.on('connection', client => { console.log("=> [socket.io] connected!") client.on('event', data => { /* … */ }); client.on('disconnect', () => { /* … */ }); - io.sockets.send('{"try":"try"}') - client.send('{"try":"try"}') + // io.sockets.send('{"try":"try"}') + // client.send('{"try":"try"}') }); } diff --git a/dist/api/utils/socket.js b/dist/api/utils/socket.js index 1d8ff00..1d0c5a1 100644 --- a/dist/api/utils/socket.js +++ b/dist/api/utils/socket.js @@ -3,20 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true }); const socketio = require("socket.io"); let io; function connect(server) { - io = socketio(server, { - // path: '/socket', - serveClient: false, - // below are engine.IO options - pingInterval: 10000, - pingTimeout: 5000, - cookie: false - }); + io = socketio(server); io.on('connection', client => { console.log("=> [socket.io] connected!"); client.on('event', data => { }); client.on('disconnect', () => { }); - io.sockets.send('{"try":"try"}'); - client.send('{"try":"try"}'); + // io.sockets.send('{"try":"try"}') + // client.send('{"try":"try"}') }); } exports.connect = connect; diff --git a/dist/api/utils/socket.js.map b/dist/api/utils/socket.js.map index 3da4d6d..dbd9d44 100644 --- a/dist/api/utils/socket.js.map +++ b/dist/api/utils/socket.js.map @@ -1 +1 @@ -{"version":3,"file":"socket.js","sourceRoot":"","sources":["../../../api/utils/socket.ts"],"names":[],"mappings":";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,OAAO,CAAC,MAAM;IACrB,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEtB,EAAE,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE;QAC3B,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAA;QACxC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,GAAW,CAAC,CAAC,CAAC;QACxC,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE,GAAW,CAAC,CAAC,CAAC;QAE3C,mCAAmC;QACnC,+BAA+B;IACjC,CAAC,CAAC,CAAC;AACL,CAAC;AAcC,0BAAO;AAZT,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE;IACpB,4BAA4B;IAC5B,uBAAuB;IACvB,KAAK;IACL,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACvB,CAAC,CAAA;AAQC,oBAAI;AANN,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,EAAE;IAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;AAC9B,CAAC,CAAA;AAKC,4BAAQ"} \ No newline at end of file