Skip to content

Conversation

@kinseyost
Copy link

https://github.com/socketio/socket.io-redis-adapter/blob/main/lib/index.ts#L215 The current parser blows up when socket.io-redis-atapter tries to call parser.decode (it doesn't exist on this parser)

Here you go :)

@darrachequesne
Copy link
Member

Hi! This parser is not meant to be used with the adapter, you can simply use:

import { createAdapter } from '@socket.io/redis-adapter';

io.adapter(createAdapter(pubClient, subClient, {
  parser: {
    decode(msg) {
      return JSON.parse(msg);
    },
    encode(msg) {
      return JSON.stringify(msg);
    },
  },
}));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants