Open dipit2007 opened 7 years ago
Thanks a lot. I was trying same but it was not working due to some silly mistake. Now Its working fine. Thanks a lot. One more query, is it possible to get this all info from laravel-echo-server using socket io interface? I mean I dont want to call API again and again but want to listen on certain event from server side to get all info through sockt io channel / communication. And obviously this channel and event only for Laravel Admin part not for others. Hope you got my point. Please help . Thanks .
i believe you must have to create a cron job and that will trigger the event time to time updating your cms/admin panel. It will be similar to hitting the api time to time.
there are so many events when user get connected and disconnected and authorization is called etc. Why to create more event and make server burden to handle extra event? So, better to use existing events and make a separate admin channel to notify admin saying "Hey Admin, I have received New connection Socket ID is FAdfdFDFdaFDA", subsequently "Hey Admin, I am authorizing FAdfdFDFdaFDA from Server Now". Hope you have got my point.
@barryvdh
I have found following code
**
* On join a channel log success.
*
* @param {any} socket
* @param {string} channel
*/
onJoin(socket: any, channel: string): void {
if (this.options.devMode) {
Log.info(`[${new Date().toLocaleTimeString()}] - ${socket.id} joined channel: ${channel}`);
}
}
Hope its starting point to modify to get what I need. Please guide me ..
as you said there can possibly be thousands on events per second. if you generate events from echo server itself that will overwhelm the event queue on laravel. What i actually meant was that make a cron job that runs every minute see and in the job trigger a laravel event that fetches the number of users by hitting the echo server api and emit the data to listeners, this way your front end will be updated every minute rather then numbers toggling madly on your frontend.
Sorry to say.. you didn't get my point.. I am not talking about front end at all..
I want one SPECIAL Channel which will be created during startup and will be accessible from restricted IP/HOST only. All log messages like when user get connected to a private,presence or public will be notified through this SPECIAL channel with proper / predefined event name.
This is required for admin real time dashboard for laravel-echo-server. Suppose someone is going to host it with daemon and also want monitor laravel-echo-server in real time.
I don't know about typescript. So help me to learn typescript to code and contribute on this.
May be this feature will be useful for others also.
Please help.
Thanks a lot.
@tlaverdure Thanks for adding my requirement as feature. I want to contribute if possible. Please guide me so that I can write code for you.
I know socketio maintain database for all connected socketids and room database . does laravel-echo-server expose this info using any API or anything? I want to know how many and who are connected at a time. Please help.