{"id":13635,"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.","status":"abandoned","version":"0.3.2","language":"javascript","source_language":"en","source_url":"git://github.com/jeroen13/node-mjpeg-proxy","tags":["javascript","mjpeg","proxy","node","mjpeg-proxy"],"install":[{"cmd":"npm install node-mjpeg-proxy","lang":"bash","label":"npm"},{"cmd":"yarn add node-mjpeg-proxy","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-mjpeg-proxy","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is CommonJS-only. ES module `import` syntax is not supported.","wrong":"import { MjpegProxy } from 'node-mjpeg-proxy';\nimport MjpegProxy from 'node-mjpeg-proxy';","symbol":"MjpegProxy","correct":"const MjpegProxy = require('node-mjpeg-proxy');"}],"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."},"warnings":[{"fix":"No direct fix needed when using `node-mjpeg-proxy` as it ships with the updated implementation. Be aware of the change if migrating from older, `buffertools`-dependent versions.","message":"This package is a 'v2' version, which internally removed the `buffertools` dependency, relying instead on Node.js native `Buffer` for stream handling. Users migrating from the original `mjpeg-proxy` package may experience different performance characteristics or subtle behavior changes due to this refactor.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Always use `const MjpegProxy = require('node-mjpeg-proxy');` for importing the module.","message":"Due to the age of the package and its CommonJS-only nature, it does not officially support or provide ESM (ECMAScript Module) imports. Attempting to use `import` syntax will result in errors.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Evaluate newer, actively maintained MJPEG proxy solutions if security, modern Node.js compatibility, or ongoing support are critical requirements for your project.","message":"As an abandoned package (last published 6 years ago), it is not maintained, meaning no security updates, bug fixes, or new features will be released. It may contain unpatched vulnerabilities or become incompatible with newer Node.js versions.","severity":"gotcha","affected_versions":">=0.3.2"},{"fix":"Debug client-side issues using tools like Wireshark to inspect HTTP headers and content. Ensure `Content-Type: multipart/x-mixed-replace` with a clear boundary is correctly set and handled by the client. In some cases, explicitly disabling chunked encoding on the server response might be necessary, though this is often handled internally by the proxy.","message":"When streaming MJPEG over HTTP, some older clients or specific configurations might struggle with Node.js's default chunked encoding. While the library handles much of the framing, client-side issues can still arise.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.3.2':44 '6':35 'abandon':89 'abil':103 'activ':93 'address':30 'age':78 'ago':50 'approxim':47 'buffer':73 'buffertool':66 'certain':38 'client':21 'common':116 'compat':36 'connect':22 'consid':87 'consum':113 'depend':67 'design':12 'develop':94 'differenti':100 'due':75 'earlier':57 'effici':105 'enabl':19 'extern':65 'favor':69 'handl':115 'improv':53 'io':34 'issu':31 'javascript':119 'jpeg':16 'lack':80 'last':45 'librari':61 'mjpeg':2,6,17,26,39,59,109,120,124 'mjpeg-proxi':58,123 'modul':11 'motion':15 'multipl':20,112 'multiplex':106 'nativ':71 'node':1,5,122 'node-mjpeg-proxi':4 'node.js':10,72 'notabl':62 'oper':74 'packag':42,90 'peculiar':118 'plan':96 'primari':99 'proxi':3,7,14,60,121,125 'publish':46 'recent':82 'releas':97 'remain':101 'remov':63 'request':18 'singl':25,108 'six':48 'sourc':110 'specif':29 'stream':27,40,117 'updat':83 'version':43,54 'year':49","created_at":"2026-04-20T01:55:30.865637+00:00","updated_at":"2026-04-20T01:55:30.865637+00:00","problems":[{"fix":"Verify that the IP address and port of the MJPEG source are correct and that the source stream is active and accessible from the server running `node-mjpeg-proxy`.","cause":"The MJPEG source URL provided to the MjpegProxy constructor is unreachable or refused the connection.","error":"Error: connect ECONNREFUSED 192.168.1.17:8082"},{"fix":"Ensure you are correctly extracting the constructor: `const MjpegProxy = require('node-mjpeg-proxy');` (if the package had a default export, it would be `require('node-mjpeg-proxy').default`, but here it's the module itself).","cause":"This error typically occurs when trying to use `require('node-mjpeg-proxy')` directly as a constructor without accessing the `MjpegProxy` property, or attempting to use ESM `import` syntax.","error":"TypeError: MjpegProxy is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/jeroen13/node-mjpeg-proxy","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/node-mjpeg-proxy","openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}