MJPEG streaming through HTTP in Node.js / Total.js
A simple controller's action for streaming MJPEG data via HTTP with the help of the Total.js framework in Node.js Platform.
MJPEG (HTTP) streaming in Node.js / Total.js
Streaming of MJPEG is effortless in the Total.js framework. So you need to receive the buffer
with the JPEG image from your e.g., IP camera.
Create a controller /controllers/mjpeg.js
:
Receiving MJPEG buffer and resend to all clients
You will need to declare your source from where you obtain MJPEG data. This is only an example, how to send MJPEG buffer
to all web clients:
Usage on client-side (HTML)
Good to know
/mjpeg/
endpoint keeps open all connections- easy to convert this code to
WebSocket
Other posts from Total.js Platform
- 2024-04-08How to create REST API using Total.js LessCode
- 2024-04-04Create UI parts visually with the power of Total.js UI Builder
- 2024-04-03Enhance your applications with Total.js v5 proxy functionality
- 2024-04-01March report 2024
- 2024-03-22How to scale your Total.js application with clusterization?
- 2024-03-01February report 2024
- 2024-02-19Building a CRUD API with Total.js: A Step-by-Step Guide
- 2024-02-01January report 2024
- 2024-01-18LessCode app
- 2024-01-16Differences between Total.js v4 and Total.js v5