Total.js Platform
Total.js Platform

Total.js Platform news and tutorials

Server-Sent events with Total.js

Node.js Server-Sent Events with Total.js framework

With the Total.js framework, you can create an HTTP route for Server-Sent Events, or you can connect easily to another server with implemented Server-Sent Events.

Route for Server-Sent Events

Server-side implementation:

Client-side (web browser) implementation:

Capture Server-Sent Events on the server-side

With the Total.js framework is very easy to handle messages from another server with implemented Server-Sent Events functionality. For example, the code below captures messages from another HTTP server: