Tag Archives: WebSockets

Introducing Socket.IO P2P, the easiest way to establish a bidirectional events channel between two peers with a server fallback

Socket.IO takes the plunge into WebRTC: peer-to-peer web here we come!


Socket.IO P2P provides an easy and reliable way to setup a WebRTC connection between peers and communicate using the socket.io-protocol.

Socket.IO is used to transport signaling data and as a fallback for clients where the WebRTC PeerConnection is not supported. Adding a simple piece of middleware to your socket.io setup enables this – no need to hand roll your own signaling exchange or set up, deploy and scale new servers.

Walk through building a simple chat app at socket.io

Swarm.js+React — real-time, offline-ready Holy Grail web apps

Swarm.js works like Firebase but with the addition of offline client-side storage that is sync’ed to the server later


The new Swarm+React TodoMVC demo can:

– synchronize in real-time (WebSocket),

– cache data at the client (WebStorage),

– load and work completely offline (Application Cache).

The app employs Swarm models and React views. It is important to notice that the code is written like it is a local MVC app. The only network-aware call in client-side code is connect() which “plugs” the model into the server’s sync “outlet”. Later on, all the sync is done by Swarm in the background; update events are delivered to views using the popular on()/off() subscription pattern, and even that is hidden inside ReactMixin.

The app is optimized for instant load using the Holy Grail approach. All the views, models and even the router are shared between client and server. The server-side code prerenders React views so the browser gets static HTML (fast). The page is made live once scripts and data arrive (slower). Holy Grail is critical, considering that React.js is rather heavy. The resulting page load latency is quite close to RTT.

Read more from the source: Swarm.js