|
|
@ -6,10 +6,14 @@ var http = require('http').Server(app); |
|
|
|
var https = require('https'); |
|
|
|
var io = require('socket.io')(http); |
|
|
|
|
|
|
|
import { createAdapter } from 'socket.io-redis'; |
|
|
|
import { RedisClient } from 'redis'; |
|
|
|
|
|
|
|
const pubClient = new RedisClient({ host: 'localhost', port: 6379 }); |
|
|
|
//import { createAdapter } from 'socket.io-redis';
|
|
|
|
const createAdapter = require('socket.io-redis'); |
|
|
|
//import { RedisClient } from 'redis';
|
|
|
|
const RedisClient = require("redis"); |
|
|
|
//const pubClient = redis.createClient({ host: 'localhost', port: 6379 } );
|
|
|
|
const pubClient = redis.createClient(); |
|
|
|
|
|
|
|
//const pubClient = new RedisClient({ host: 'localhost', port: 6379 });
|
|
|
|
const subClient = pubClient.duplicate(); |
|
|
|
|
|
|
|
io.adapter(createAdapter({ pubClient, subClient })); |
|
|
|