Learn how to use WebSockets to create real-time apps.
Instant feedback in your apps.
WebSockets allows you to build web/mobile applications where data can be sent between client/server in a much more efficient way than "traditional" HTTP. When a client connects to the WebSocket-enabled server it can send and receive messages with minimal overhead. Crucially where HTTP is a (stateless) request-response protocol, WebSockets allow the client to subscribe to a stream of data, which means that updates can be receive after the initial response. This makes WebSockets perfect for building Real-Time Apps!
To run the examples you will need two terminal windows (one to run the server.js and the other for client.js)
### Simple Connection to Server
In the first terminal window, boot the server:
PORT=8000 node nes/server.js
Then in the second window run the client:
PORT=8000 node nes/client.js
Same again, 2 terminal windows (note: have them both ready at the same time...)
- Boot the server:
PORT=8000 node nes/pubsub-server.js
- Then run the client :
PORT=8000 node nes/pubsub-client.js
Same again, 2 terminal windows (note: have them both ready at the same time...)
- Boot the server:
PORT=8000 node nes/sub-filter-server.js
- Then run the client :
PORT=8000 node nes/sub-filter-client.js
## FAQ
Sadly, no. http://caniuse.com/#feat=websockets
### Can we ignore Opera Mini...?
Apparently not... Opera Mini accounts for almost 5% of the market!
http://caniuse.com/usage-table
More detailed trend: https://www.netmarketshare.com/browser-market-share.aspx?qprid=1&qpcustomb=1
Where are all the Opera Mini users? http://raddevon.com/articles/where-are-opera-mini-users