I’m new to node.js but I know it has a great socket API called socket.io. My question is: I want to build an iphone app that communicates with a database on a node.js server, but I’m not sure how to do this.
Do I build a standard index.html to which my app will attach to? How will the phone app create a socket? Will the socket be created when the app simply visits the website, e.g. http://www.example.com/index.html?
Any help is appreciated, thanks!
socket.io has a client js library which you can use from a website hosted on any platform. It can be a simple static .html file, or a file returned from node.js (express view or similar).
As far as how to use it on the iPhone, it depends on how you plan on creating your app. I haven’t used any native code which talks via socket.io, but a PhoneGap application shouldn’t have any problems.