Note: This is not about using both node.js and HTML5 sockets. I'm also not interested in discussing the merits of the setup I'm describing.
node.js runs on the server, and, since it supports connecting via sockets as a client, it can act as a middle layer between an HTML5/JS client and server that uses TCP/IP (such as a database server.) So, both node.js and WebSockets include ways of opening socket connections to a server.
My question is, has anyone successfully ported a node.js script to WebSockets, i.e., cut node.js out of the equation, so that your web browser connects to the database directly? I imagine it would look like:
- cut out everything to do with HTTP
- port the usage of all node.js-specific functions to use the WebSockets API
If this has been done, was it a lot of trouble or were the node.js and WebSockets APIs relatively similar?