{"id":22824332,"url":"https://github.com/sango-tech/camera_proxy_node","last_synced_at":"2025-03-31T00:18:29.038Z","repository":{"id":106050059,"uuid":"396731066","full_name":"sango-tech/camera_proxy_node","owner":"sango-tech","description":"Nodejs  + MJPEG ","archived":false,"fork":false,"pushed_at":"2021-08-17T03:23:53.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-06T05:30:09.997Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sango-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-16T09:59:14.000Z","updated_at":"2021-08-17T03:23:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"f79e4a3d-fe84-4f6b-9e4d-3c64269384a3","html_url":"https://github.com/sango-tech/camera_proxy_node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sango-tech%2Fcamera_proxy_node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sango-tech%2Fcamera_proxy_node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sango-tech%2Fcamera_proxy_node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sango-tech%2Fcamera_proxy_node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sango-tech","download_url":"https://codeload.github.com/sango-tech/camera_proxy_node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246395806,"owners_count":20770263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-12T17:06:16.075Z","updated_at":"2025-03-31T00:18:29.014Z","avatar_url":"https://github.com/sango-tech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Introduction\n\nThis module proxies MJPEG streams (from an IP camera, for example) to a given endpoint of your choice using [express.js](https://expressjs.com/).\n\n### Events\n\n* `error` If the stream errors.\n\n* `addClient` When a new client begins consuming the proxy stream.\n\n* `dropClient` When a client closes the connection with the proxy stream.\n\n### Example Usage\n\n```javascript\nvar express = require(\"express\");\nvar proxy = require(\"express-mjpeg-proxy\").Proxy;\nvar url = \"Insert MJPEG stream here\";\n\nvar server = express();\nserver.get(\"/\", new proxy(url).requestHandler);\nserver.listen(8080);\n\n```\n\n### How to run\n\nRun `npm start \u003cSTREAM URL\u003e [PORT]` to start a sample express.js server running the stream. Note that you will need to have express.js installed in the package already (`npm install express`) in order for this to work.\n\n### Details\n\nWhen a new Proxy object is created, it will establish a connection to the MJPEG stream. Any new data from the stream will be sent to any client in the `clients` array.\nThe argument can either be a string (in the form a URL) or an object acceptable by [http.request](https://nodejs.org/api/http.html#http_http_request_options_callback):\n\n```javascript\nvar proxy = new Proxy(\"URL\"); // Works\nvar proxy = new Proxy({\n\thost: \"...\",\n\tport: \"80\",\n\tmethod: \"GET\"\n\tpath: \"/cam.mjpeg\"\n}); // Also works\n\n```\n\nWhen requestHandler is executed, it will add the new client to the clients array. When the client closes the connection, it will be removed from the clients array. requestHandler will also send headers to every new client that preserve the boundary value in the Content-Type header.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsango-tech%2Fcamera_proxy_node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsango-tech%2Fcamera_proxy_node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsango-tech%2Fcamera_proxy_node/lists"}