Node with Express - Looking for Realtime

82 views
Skip to first unread message

A

unread,
Dec 19, 2015, 9:18:33 AM12/19/15
to nodejs
I have a site up using Node with Express; quite a few pages, and now there is a requirement to have one of the page be done in realtime.

I looked into Express.io, but seems like a lot of extra to do all around that may effect the other parts of the site (rather not retest everything). 

Any suggestions on how I can get a realtime for just one page on the whole site?   As of now, I am using JQuery and leveraging the setInterval for 20 seconds to accomplish the task; if this is the only, then so be it.

Thanks

Kevin "Ingwie Phoenix" Ingwersen

unread,
Dec 19, 2015, 10:46:55 AM12/19/15
to nod...@googlegroups.com
You can use Socket.IO or SocketCluster.

Socket.IO works for simple Express apps - you just attach it, like any other middleware.

SocketCluster lets you run multiple processes. That means, if you need to use multiple cores for your server, for instance, i would recommend using SC.

Both solutions are "real time engines".
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 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 unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/6ef2ac17-fb80-4dd4-b937-2809dce71f95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

CmingXu

unread,
Dec 19, 2015, 10:46:55 AM12/19/15
to nod...@googlegroups.com
Try google socket.io, its a websocket implementation for both the
browser side and server side. Very easy to setup and easy to
understand.

jQuery long pool will add much more server requests and huge
performance impact, use long pool only if low through output

Kevin "Ingwie Phoenix" Ingwersen

unread,
Dec 19, 2015, 11:02:14 AM12/19/15
to nod...@googlegroups.com
Hey.

> Am 19.12.2015 um 15:33 schrieb CmingXu <cmin...@gmail.com>:
>
> Try google socket.io, its a websocket implementation for both the
> browser side and server side. Very easy to setup and easy to
> understand.
Actually, not just WebSocket. SocketIO can use multiple transports, such as AJAX, and iFrame for very weird situations.
> To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAHPyuwuJ6W2HVMvO00OWt7KS71hn0RUuW3t4ZTfiTMzshFgfUg%40mail.gmail.com.

A

unread,
Dec 20, 2015, 1:40:19 PM12/20/15
to nodejs
Thanks

I thought Socket.io would 'replace' express vs work with it
SocketCluster sounds promising, I will look into that.  Thanks again

lance123

unread,
Dec 20, 2015, 1:40:19 PM12/20/15
to nodejs
Hey There,

Take a look at http://faye.jcoglan.com/ .

Top notch module that is actively developed with a good community of devs using it.  Been using it for many years.  Supports many fallbacks and websockets.

Hope that helps.

Regards,

Lance
Reply all
Reply to author
Forward
0 new messages