Skip to content

Instantly share code, notes, and snippets.

@alex-hladun
Created October 7, 2021 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alex-hladun/de03e658773dfe6b2102de74ce3ccdd2 to your computer and use it in GitHub Desktop.
Save alex-hladun/de03e658773dfe6b2102de74ce3ccdd2 to your computer and use it in GitHub Desktop.
Connecting to socket.io-redis-adapter
connectToHostedRedis = (redisEndpoint: string) => {
this.pubClient = new RedisClient({ host: redisEndpoint, port: 6379 });
const subClient = this.pubClient.duplicate();
this.io.adapter(createAdapter({ pubClient: this.pubClient, subClient }));
this.sessionStore = new RedisSessionStore(this.pubClient);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment