Browse Source

redis

master
zeus 4 years ago
parent
commit
723680003d
  1. 12
      swarmlab-app/src/run/app.js

12
swarmlab-app/src/run/app.js

@ -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 }));

Loading…
Cancel
Save