{"library":"node-mjpeg-proxy","title":"Node MJPEG Proxy","description":"node-mjpeg-proxy is a Node.js module designed to proxy Motion JPEG (MJPEG) requests, enabling multiple client connections to a single MJPEG stream. It specifically addresses issues such as iOS 6 compatibility with certain MJPEG streams. This package (version 0.3.2, last published approximately six years ago) is an improved version of the earlier 'mjpeg-proxy' library, notably removing the external 'buffertools' dependency in favor of native Node.js Buffer operations. Due to its age and lack of recent updates, it should be considered an abandoned package, with no active development or planned releases. Its primary differentiator remains its ability to efficiently multiplex a single MJPEG source for multiple consumers while handling common stream peculiarities.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install node-mjpeg-proxy"],"cli":null},"imports":["const MjpegProxy = require('node-mjpeg-proxy');"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const MjpegProxy = require('node-mjpeg-proxy');\nconst express = require('express');\nconst app = express();\n\nconst PORT = process.env.PORT || 8080;\nconst MJPEG_SOURCE_URL = process.env.MJPEG_SOURCE_URL || 'http://localhost:8081/stream.mjpeg'; // Placeholder for your MJPEG source\n\napp.listen(PORT, () => {\n  console.log(`Server listening on port ${PORT}`);\n  console.log(`Proxying requests from ${MJPEG_SOURCE_URL}`);\n});\n\n// Create Proxy \nconst proxy = new MjpegProxy(MJPEG_SOURCE_URL);\n\n// Bind proxy to the webserver\napp.get('/stream.mjpeg', proxy.proxyRequest);\n\n// Events\nproxy.on('streamstart', function(data){\n  console.log(\"Stream started - \" + data);\n});\n\nproxy.on('streamstop', function(data){\n  console.log(\"Stream stopped - \" + data);\n});\n\nproxy.on('error', function(data){\n  console.error(\"Proxy error: \", data.msg);\n  console.error(\"Affected URL: \", data.url);\n});","lang":"javascript","description":"This example sets up an Express server that proxies an MJPEG stream from a specified source URL to a local endpoint, demonstrating basic instantiation and event handling.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}