Yahoo-Me
Yahoo-Me

Reputation: 5033

HTML5 websocket API and node.js

Will the Websocket Api implementation of HTML5 make node.js irrelevant? If not, what are the differences between the two ans where to use what?

Upvotes: 2

Views: 3296

Answers (2)

kanaka
kanaka

Reputation: 73217

Actually, WebSockets makes Node far more applicable; a good number of the interesting server side implementations of WebSockets use Node.

In fact, a library that is growing very fast in popularity is Socket.IO. Socket.IO is a server-side (Node) and client side library that allows you to rapidly create interactive web applications. The client and server coordinate to pick the best communication mechanism available to both (WebSockets is the preference but falls back to long-polling). The client and server side Javascript library interface is very similar (and both are Javascript) so it's very easy to create web applications quickly.

Upvotes: 2

Ivo Wetzel
Ivo Wetzel

Reputation: 46756

Node.js is a server side, event based, asynchronous I/O framework.

HTML5 WebSockets a pretty much TCP sockets in the Browser, that's all they don't di much more then establishing a two way channel of communication.

For example, you would write your game Server with Node.js and then use WebSockets to communicate between your Browser based client and the server.

An example of such a Game (disclaimer, I'm the author of the project):
http://github.com/BonsaiDen/NodeGame-Shooter

To get an idea what Node.js does, I recommend that you watch some talks that are listed on our Node.js tag wiki.

Upvotes: 4

Related Questions