Using redis to Create Channels in nodejs

  node.js, question

Problem

图片描述

describe

Prompts that the publish method does not exist.

Find the reason:

Line 56 of the code:

//socket.on('connect', function() {
 subscriber = redis.createClient(32768, '192.168.99.100');  //Create a subscription client for users
 subscriber.subscribe('main_chat_room');  //reserve channel
 
 On ('message', function (channel, message) {//channel sends the message to the user after receiving it.
 Socket.write('Channel' plus channel plus':' plus message);
 });
 
 publisher = redis.createClient(32768, '192.168.99.100');  //Create a publishing client for users
 //});