Issue with Emitting Messages from Frappe to External Clients

Hello Frappe Community,

I’m currently developing a custom app that requires real-time communication capabilities. I’ve set up a Node.js server using Express and, integrated with Redis for handling real-time events. I’m facing an issue with messages being emitted from Frappe to external clients. While internal communication within Frappe works as expected, the external emits are not functioning properly.

What I Intend To Achieve

I want to enable real-time messaging between Frappe and an external Node.js server using The goal is to send updates from Frappe to the external server, which then broadcasts these messages to connected clients.

What Works

  1. Message Sending from Client to Frappe: Clients connected to the server can send messages to Frappe through Redis, and these are received properly.
  2. Internal Frappe Communication: Frappe successfully emits messages to other Frappe instances or services listening on the same Redis channels.

What Does Not Work

Emitting messages from Frappe to the external Node.js/ server does not work. The messages are intended to be broadcast to all connected external clients, but currently, only internal communication within Frappe is successful.

My Setup

Here is a brief overview of my Node.js setup:

// Node.js with and Redis configuration
const express = require('express');
const http = require('http');
const socketIo = require('');
const redis = require('redis');

const app = express();
const server = http.createServer(app);
const io = socketIo(server, {
    cors: {
        origin: "*", 
        methods: ["GET", "POST"],
        credentials: true

const subscriber = redis.createClient();
subscriber.subscribe("custom_connector", (message) => {
    io.emit('response_event', JSON.parse(message));

io.on('connection', (socket) => {
    console.log('A client connected');
    socket.on('disconnect', () => {
        console.log('A client disconnected');

server.listen(9002, () => {
    console.log("Server is running on port 9002");

Has anyone faced a similar issue or can offer insights into what might be going wrong with the external emits from Frappe? Any suggestions on how to debug this problem or adjust the configurations would be greatly appreciated.

Frappe version-15

Thank you in advance for your help and suggestions!

Having the exact same problem, making chat apps with guests useless. Have you found the solution?