Live data from Hacker News

Introducing Socket.io 1.0

socket.io

31–40 of 76 posts

Re: Introducing Socket.io 1.0

#32

Congrats on the release! I know this was a long time coming. A scalability question: You note "Turn on sticky load balancing (for example by origin IP address). This ensures that long-polling connections for example always route requests to the same node where buffers of messages could be stored." I read this to mean that we are responsible (in our load balancer/proxy/etc) to keep connections from clients returning t…

As a note, I switched to Faye for most of my websocket needs because of this http://faye.jcoglan.com/

Re: Introducing Socket.io 1.0

#33

Congrats on the release! I know this was a long time coming. A scalability question: You note "Turn on sticky load balancing (for example by origin IP address). This ensures that long-polling connections for example always route requests to the same node where buffers of messages could be stored." I read this to mean that we are responsible (in our load balancer/proxy/etc) to keep connections from clients returning t…

The node.js cluster module is not flexible enough to be used with engine.io / socket.io / sockjs etc. Just run several processes and put something like HAproxy in front of them. If using a cookie to ensure stickiness, you can scale to multiple load-balancers easily.

I concur; we use sticky-sessions in our load-balancer, and stunnel when we're doing it on an SSL'd page, and it's working just fine.

Re: Introducing Socket.io 1.0

#34
post #17

Great. offtopic: please fix your blog, it breaks the browser history in IE 11 (spammed with hash entries)

As long as we're off topic, I think the OP means to say that

"The benefits of this particular modularization can’t be overstated"

Re: Introducing Socket.io 1.0

#35

This seems like a good place to ask: Does anyone know of a library (preferably C++/Emscripten) that simplifies using WebRTC to create real time network games?

I looked for a library for a similar WebRTC project. All of the libraries I found contained superfluous functionality, as I was only interested in data channels and did not want to be locked in by a particular third party. I ended up rolling my own; the WebRTC API is simple enough [1] and there is some example code from Google that points the right direction [2]. Additionally, Socket.io makes for a convenient signalling server prototype, though it is overkill.

[1] http://dev.w3.org/2011/webrtc/editor/webrtc.html

[2] https://bitbucket.org/webrtc/codelab

Re: Introducing Socket.io 1.0

#36
A kind of OT question related to socket.io.

I am trying to develop an application that can be horizontally scaled. I understand using the socket.io-redis package seems to allow you to emit to a particular socketid from one instance while that connection itself is connected to another machine and the redis connection will take care of the communicating. This in a sense abstracts away the fact that there are multiple servers by just taking care of it transparently.

Are there any provisions within socket.io or another package that allows you to sync normal js objects across servers as well? The alternative as I see it is to use redis pub/sub to keep the state in sync but this feels like it should be a solved problem that one need not reinvent the wheel for.

Re: Introducing Socket.io 1.0

#37

I like the separation of the transports into engine.io, however it would be even better if it exposed a standard Node.js Stream interface so that it played nicely with the growing ecosystem of Stream-related modules. Dominic Tarr, substack, and others have been advocating this idea for awhile: https://github.com/substack/stream-handbook Gluing together various types of streams and stream transformers is a really nice…

You could also just use Primus which exposes a Stream compatible wrapper by default for the client and server.

https://github.com/primus/primus

(Primus uses engine.io,sockjs,browserchannel,websockets internally so you're no longer locked into a specific framework)

Re: Introducing Socket.io 1.0

#39
post #28

Something about this site just kills both Firefox and Chrome on my Windows 7 computer: everything becomes choppy and laggy, even outside the browser. On both browsers, things return to normal when I close the tab. Task Manager shows no unusual CPU activity beyond the initial page load.

It's almost certainly the multiple animations ( elements) on the page.

Re: Introducing Socket.io 1.0

#40
post #28

Something about this site just kills both Firefox and Chrome on my Windows 7 computer: everything becomes choppy and laggy, even outside the browser. On both browsers, things return to normal when I close the tab. Task Manager shows no unusual CPU activity beyond the initial page load.

I'm having the exact same issue.
Post reply on HN