I have ShoutBox in my site. It’s implement in websocket on client site, and php in back-end. I decided to rewrite back-end in node.js as part of study. I write server in PHP so it should be easy.
So I start on find something done already, available library on this site: https://github.com/joyent/node/wiki/Modules#wiki-ws-ajax
Socket.io -> after install, when I see code and files which is necessary to work I think c’mon. Okay a lot of features (e.g: websocket,flash socket, AJAX long polling), but what for ? If someone want use websocket they want websocket, if your browser not support it, download the latest version. I can write the same about support protocol (hixie…hybid -> RFC 6455 is enough since dec 2011, 1 year ), now all browser support RCF. People who have oldest version browser, will need update they browser anyway. So it’s a lot of unnecessary code.
This is just my thoughts, you can’t agree with that, I don’t have a lot of developer experience in big company. Finally I decided to find something slighter. I just want support RCF 6455.
Ws -> support 3 protocol, okay I can accept this. I start analyze code, I give up after 5 min. I starts have doubt for my JavaScript knowledge.
I check something about 6 -7 library, each is based on websocket.io or have some weird code. This same situation I have when I look for PHP websocket server. My code have 161 line, I’m pretty sure this same result in node.js, after deleted all unnecessary stuff like protocol. Only solution is to write my own server.
Okay go to node.js docs and where I should start? Totally confused. Use http or net module? Previous library use http, but in net module is socket class, the name suggest I need it.
I have net.connect(options, [connectionListener]) and net.connect(port, [host], [connectListener]). Why? It isn't the same ?
I've looked for example code, it’s good place to find out. It isn’t there, only example is library. So I have big request, someone who has its own very simple websocket server can share it with me , please ? connect, handshake, broadcast msg to all connected (msg massage lower than < 65535)
EDIT: Give up at all, is impossible for me, until someone make DOCs readable.
I forget write that in some module you also need include file in client site. What for? Can you tell me why someone write client when is already there ? http://www.w3.org/TR/websockets/
On that list I pasted, everyone can get ? I found there module which don’t work at all. Or what doing there module which is based on socket.io, it is the same. Why even someone write they?
I can’t understand why somebody need add some c++ code when other don’t need them in this same case?