Skip to content

Nothing work #552

@aishmurodov

Description

@aishmurodov

Hello, I created the adapter and connection, but nothing work

I have two same servers that balanced with proxy.
I use fastify and fastify-socket.io

My code below

    const pubClient = createClient({
      url: 'redis://${encodeURIComponent(config.redis.user)}:${encodeURIComponent(config.redis.password)}@${config.redis.host}:${config.redis.port}',
    });

    const subClient = pubClient.duplicate();

    pubClient.on("ready", () => {
      logging.info("pubClient is ready");
    });
    subClient.on("ready", () => {
      logging.info("subClient is ready");
    });

    await Promise.all([
      pubClient.connect(),
      subClient.connect(),
    ])

    FastifyServer.register(FastifyIO, {
      adapter: createAdapter(pubClient, subClient),
      cors: {
        origin: (
          requestOrigin: string | undefined,
          callback: (err: Error | null, origin?: boolean) => void
        ) => {
          callback(null, true);
        },
        credentials: true,
        methods: ["PUT", "POST", "PATCH", "DELETE", "GET"],
      },
    });

Connection is ok, i am getting "pubClient is ready" and "subClient is ready"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions