If you are looking for something on your own (not Windows) for the end user, then also check out the APE project . This is OpenSource using SSJS using comet.
Note that it still uses Apache and your usual LAMP setup, so there is no need to get a dedicated computer or VPS to host it.
I also don't know how Facebook does this, but APE really sounds like a good option.
I just found this for a minute or so in Googling, since your question interested me, I did not use or test it, but as a free tool that is located on your own server, which is definitely worth a look.
As well as a note, I found a comment in Portuguese that complains that it does not work with Windows servers, as stated in the documentation.
Good luck, and I would be wondering how this happens if you decide to give him a chance!
source share