timwis / enviar

Chat interface for SMS / text messages
37 stars 6 forks source link

Use server-side events #1

Closed timwis closed 8 years ago

timwis commented 8 years ago

The see.js library gives you a connection event. We can store the list of clients, then create a broadcast function that loops through each client and calls .send() on it. If it fails, remove the client from the list of clients (since there's no disconnect event).

timwis commented 8 years ago

.send() does not seem to throw an error if the client is disconnected. Reported to einaros/sse.js#17 and ngnjs/ngn-sse#1

Also found that IE doesn't support SSEs... :/

timwis commented 8 years ago

Going to close this one because of the lack of IE support. We'll go with sockets for now.