Registry / http-networking / node-mjpeg-proxy

node-mjpeg-proxy

JSON →
library0.3.2jsnpmunverified

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.

npm install node-mjpeg-proxy
INSTALL
IMPORT
SIG · NODE-MJPEG-PROXY
N
node-mjpeg-proxy
http-networkingjavascriptv0.3.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MjpegProxy
const MjpegProxy = require('node-mjpeg-proxy');
import { MjpegProxy } from 'node-mjpeg-proxy'; import MjpegProxy from 'node-mjpeg-proxy';
This package is CommonJS-only. ES module `import` syntax is not supported.

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.

const MjpegProxy = require('node-mjpeg-proxy'); const express = require('express'); const app = express(); const PORT = process.env.PORT || 8080; const MJPEG_SOURCE_URL = process.env.MJPEG_SOURCE_URL || 'http://localhost:8081/stream.mjpeg'; // Placeholder for your MJPEG source app.listen(PORT, () => { console.log(`Server listening on port ${PORT}`); console.log(`Proxying requests from ${MJPEG_SOURCE_URL}`); }); // Create Proxy const proxy = new MjpegProxy(MJPEG_SOURCE_URL); // Bind proxy to the webserver app.get('/stream.mjpeg', proxy.proxyRequest); // Events proxy.on('streamstart', function(data){ console.log("Stream started - " + data); }); proxy.on('streamstop', function(data){ console.log("Stream stopped - " + data); }); proxy.on('error', function(data){ console.error("Proxy error: ", data.msg); console.error("Affected URL: ", data.url); });
Debug
Known issues
breakingThis 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.
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.
affects: >=0.1.0
gotchaDue 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.
fix
Always use `const MjpegProxy = require('node-mjpeg-proxy');` for importing the module.
affects: >=0.1.0
gotchaAs 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.
fix
Evaluate newer, actively maintained MJPEG proxy solutions if security, modern Node.js compatibility, or ongoing support are critical requirements for your project.
affects: >=0.3.2
gotchaWhen 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.
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.
affects: >=0.1.0
Errors
Common errors & fixes
Error: connect ECONNREFUSED 192.168.1.17:8082
The MJPEG source URL provided to the MjpegProxy constructor is unreachable or refused the connection.
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`.
TypeError: MjpegProxy is not a constructor
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.
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).
Upgrade
Version history
0.3.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources