1

I am building a chat application for my company, and have decided to use node js with websocket (ws). In my application there are multiple department and users for each department, and when a browser (person asking question) selects a particular department, want the chat to be redirected to the same department.

I have decided to use a WAMP router, but there is no sample script which shows how to redirect each chat to the particular department a browser has selected.

Can anyone help me on the same

Cheers

Sunil

  • What does "chat redirected to the same department" actually mean? Is there a particular person to answer questions that represents a given department? – jfriend00 Oct 24 '15 at 19:02
  • There will be different departments like sales, support, refund etc. For each department there will be different users, when a browser selects a particular department, the chat will be directed to user from that department – Sunil Kumar Oct 25 '15 at 01:49
  • So, you can just send a message across the chat connection that says to change departments. It is then the responsibility of the server to forward messages from that connection to the right department. It can do that by keeping track of the department manually or it can use chat rooms to do that. There are multiple ways on the server to do that. – jfriend00 Oct 25 '15 at 05:58

1 Answers1

0

A user would select a department in the browser client. The client then subscribes to the topic/topics for that department. If it was previously subscribed to the topics for another department then it sends an unsubscribe for these.

The WAMP router then sends events for any of the subscribed topics to the client.

gzost
  • 2,375
  • 1
  • 18
  • 25