an-sh / chat-service Goto Github PK
View Code? Open in Web Editor NEWAn extensible and scalable chat-like messaging server.
License: MIT License
An extensible and scalable chat-like messaging server.
License: MIT License
Firstly, thanks for making this library @an-sh !
I want to get a list of connected socket id corresponding to a particular username(used during connection from the client)?
Additional Details:
I am trying to add a person to an already created room from the server-side, but I am unable to do that without the socket id. Is there a different approach to this?
As expected behaviour, there should be an api, that provide room users an opportunity to delete chat messages, hiding them from users but keep it in store with 'deleted' flag or something similar. And it will be great if owners and admins can see all room messages, including deleted ones.
I am writing my own MySQLState plugin based on MemoryState. And it is not clear how userlist, adminlist, whitelist, and blacklist related to each other.
Hi,
I'm continuing to use CS.
I want to add chatroom whenever the user wants to, thus running this on the client:
this.socket.emit('roomCreate', roomName, false);
However I now want to handle the doubled roomnames.
I found that there are CommandHooks like roomCreateBefore/After, but I'm a bit confused on how I can use them.
What I tried was this:
instance.chatService = new ChatService(cs_config,
{
onConnect: utils.onConnect,
roomCreateBefore: utils.roomCreateBefore
});
//in module utils
roomCreateBefore(server, otherarg) {
console.log('got to roomCreate: ' + otherarg); //-> got to roomCreate: undefined
//Stuff like if server.hasroom do this else that.
return Promise.resolve();
}
Now onConnect works fine because it is part of the HooksInterface where the parameters are exposed.
But I dont know how I get the 'roomName' parameter of the event roomCreate.
roomCreateBefore(execInfo, cbopt) โ {Promise.<(Array|undefined)>}
I know about the execInfo from the docs aswell but I dont know where to get that and how to use it.
So to sum my question up:
How do I handle rpc events from the Client, and if the solution involves CommandHooks, how do I use them properly.
How do we implement this library in NestJS. Should it be a gateway or custom provider?
Hello,
We are building a chatroom ecosystem of applications and we are looking for a simple solution for handling all the messaging infrastructure. We have been evaluating multiple third party solutions but non of them match with our requirements and pricing budget.
chat-service
seems to be a really good candidate for our use case, is anyone using this in production ? Do you have a roadmap for the product ?
Thanks before hand!
I tried using the sample code from the doc. Do I need to do some additional configuration?
It would be great if you'd also support SockJS. Is that a lot of work and is it even possible, because it doesn't support rooms out of the box?
I also have the following.
Suppose every user has its own room which is named as its username. This user is the admin and owner of this room. From the docs I read that the creator of a room is also the admin/owner. But I don't want this. I want that every user can join/create a room, but it isn't automatically the admin/owner. Only the user whit the same username of the room is the owner/admin. So any user can create a room with a certain username, but it isn't automatically the owner/admin. Only the user with the same username as the roomk can be the owner/admin.
hi, great project :) do you know about similar node-js projects? i mean pluggable multiroom multiuser chat server?
On client i do
socket.emit("roomRecentHistory", 'default');
How to get result of this call?
I din`t found any server notification for this https://an-sh.github.io/chat-service/1.0/rpc.serverNotifications.html
Hi @an-sh ,
I am trying to implement slack like chat application where an user will have multiple chatrooms created. As far as I understand, the client needs to be joined in a room to be able to listen for event inside the room.
My question is what is the best way to let a client know that a new message was received in any of the rooms the client is a part of?
In order to achieve this, do I join each room while initializing the client web app by looping over the roomId(s) from dB, or is there a standard way to achieve this.
There can a lot of rooms (~100) a client will be a part of at a given moment. So, Is there a hard limit to the number of room a client can join?
Hey @an-sh ,
Is there a way (API or technique) to know if a user is online in a room?
Even though the readme states that there are possible APIs for the same, I could not find any code that documents the same. Would be great if you could shed some light on this front.
Nice package here!
I was wondering how all the data is stored. Background are the following questions:
Thank you ;)
I tried to use roomHistoryGet after restarting the server and I found the room data is empty.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.