You'd have to use WebSockets (or some similar protocol module e.g. as supported by the Flash plugin) because a normal browser application simply can't open a pure TCP socket.
The Socket.IO
module available for node.js
can help a lot, but note that it is not a pure WebSocket module in its own right.
It's actually a more generic communications module that can run on top of various other network protocols, including WebSockets, and Flash sockets.
Hence if you want to use Socket.IO
on the server end you must also use their client code and objects. You can't easily make raw WebSocket
connections to a socket.io
server as you'd have to emulate their message protocol.