Help : Nodejs For Push Notification

168 views
Skip to first unread message

Krunal Goswami

unread,
Aug 2, 2013, 5:16:39 AM8/2/13
to nod...@googlegroups.com
Hello Everyone,

I am going to develop a web application, which has a tiny socialnetworking feature where each user can post/share quotes and it has facility to like and comment(similar to facebook).
now i want to notify owner of that post about the like and comments on his post. i want to provide realtime notification with nodejs. is there any way to do it?

Please provide me good solution.



Thanks!
Krunal

bodo

unread,
Aug 2, 2013, 6:54:37 AM8/2/13
to nod...@googlegroups.com
I think socket.io is good solution for you

Krunal Goswami

unread,
Aug 2, 2013, 6:59:18 AM8/2/13
to nod...@googlegroups.com

Yes it is good, did some demo on it. But i want server to push user specific notifications, when some event (like/comment) occurs on post. Right now in my demo at some time interval i have to ask server for if notification exists for me or not.

--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

bodo

unread,
Aug 2, 2013, 7:11:56 AM8/2/13
to nod...@googlegroups.com, kish...@yahoo.com
If you have to ask server for notification, that's AJAX

With socket.io, that uses websocket, you can do that by idea of chat example:


Client need only to listen data pushed from server, that's same things with your notification

Hope that helps you

Matt

unread,
Aug 2, 2013, 9:06:01 AM8/2/13
to nod...@googlegroups.com
On Fri, Aug 2, 2013 at 6:54 AM, bodo <vuducb...@gmail.com> wrote:
I think socket.io is good solution for you

FWIW using socket.io in production in a mix of environments you'll have problems with random clients just plain not working and no idea how to fix it. At least with the current stable version of socket.io. Instead I recommend SockJS instead. We haven't had any of the random problems we saw with socket.io since switching. Also worth noting that the meteor framework switched for similar reasons.

bodo

unread,
Aug 2, 2013, 9:26:23 AM8/2/13
to nod...@googlegroups.com
"random clients just plain not working"  => what do you mean ? I don't find any problem with socket.io for now

Matt

unread,
Aug 2, 2013, 12:52:51 PM8/2/13
to nod...@googlegroups.com

On Fri, Aug 2, 2013 at 9:26 AM, bodo <vuducb...@gmail.com> wrote:
"random clients just plain not working"  => what do you mean ? I don't find any problem with socket.io for now

I mean they just don't successfully make socket.io connections and don't trigger timeouts.

>  I don't find any problem with socket.io for now

Most people don't until they start to gain users who actually let them know of problems. And it's impossible to debug those problems because there's no error messages and you can't emulate their network/environment perfectly.

There's a reason they re-wrote socket.io from the ground up for 1.0 (still un-released). Because the current version just doesn't work in enough places.

Matt.

bodo

unread,
Aug 3, 2013, 10:41:05 AM8/3/13
to nod...@googlegroups.com
Thank you for your share. That means when there are too many connections at the same time, you can't make socket.io connection ? Any that must be big application ?

I'm very curios on this pb because I'm working on a project that uses socket.io

Thank you

Matt

unread,
Aug 3, 2013, 12:10:01 PM8/3/13
to nod...@googlegroups.com

On Sat, Aug 3, 2013 at 10:41 AM, bodo <vuducb...@gmail.com> wrote:
Thank you for your share. That means when there are too many connections at the same time, you can't make socket.io connection ? Any that must be big application ?

No this was for a small startup - the number of connections wasn't the problem. The problem was unknown configurations at the end user's site (firewalls, anti-virus, different browsers, etc). You can't test for all that stuff, and you can't debug it, except to say that switching from socket.io to SockJS made all those problems go away.

Sindre Sorhus

unread,
Aug 4, 2013, 8:51:00 AM8/4/13
to nod...@googlegroups.com
I would use Server-Sent Events: http://www.html5rocks.com/en/tutorials/eventsource/basics/


On Friday, August 2, 2013 11:16:39 AM UTC+2, Krunal Goswami wrote:
Reply all
Reply to author
Forward
0 new messages