{"id":19577128,"url":"https://github.com/craiggleso/peer-tracker","last_synced_at":"2025-04-27T06:32:02.600Z","repository":{"id":48172392,"uuid":"78441580","full_name":"CraigglesO/peer-tracker","owner":"CraigglesO","description":"Lightweight BitTorrent Tracker Client \u0026 Server Implementation","archived":false,"fork":false,"pushed_at":"2019-10-29T18:25:48.000Z","size":569,"stargazers_count":1,"open_issues_count":14,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-11T06:11:42.300Z","etag":null,"topics":["client","nginx","p2p","redis","server","tracker"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CraigglesO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-09T15:29:13.000Z","updated_at":"2017-07-02T13:58:36.000Z","dependencies_parsed_at":"2022-09-26T18:40:54.698Z","dependency_job_id":null,"html_url":"https://github.com/CraigglesO/peer-tracker","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/CraigglesO%2Fpeer-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CraigglesO%2Fpeer-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CraigglesO%2Fpeer-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CraigglesO%2Fpeer-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CraigglesO","download_url":"https://codeload.github.com/CraigglesO/peer-tracker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224062795,"owners_count":17249291,"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":["client","nginx","p2p","redis","server","tracker"],"created_at":"2024-11-11T07:04:39.377Z","updated_at":"2024-11-11T07:04:41.179Z","avatar_url":"https://github.com/CraigglesO.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# peer-tracker [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![Greenkeeper badge](https://badges.greenkeeper.io/CraigglesO/peer-tracker.svg)](https://greenkeeper.io/)\n\n\n[travis-image]: https://travis-ci.org/CraigglesO/peer-tracker.svg?branch=master\n[travis-url]: https://travis-ci.org/CraigglesO/peer-tracker\n[npm-image]: https://img.shields.io/npm/v/peer-tracker.svg\n[npm-url]: https://npmjs.org/package/peer-tracker\n[downloads-image]: https://img.shields.io/npm/dm/peer-tracker.svg\n[downloads-url]: https://npmjs.org/package/peer-tracker\n\n### Lightweight BitTorrent Tracker Client \u0026 (Persistent) Server Implementation\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src =\"https://github.com/CraigglesO/peer-tracker/blob/master/img/tracker.png\" /\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n### About\n\n**OFFICIALLY VERSION 1!**\n\n#### Example Use\n\nSee a working example [HERE](http://tracker.empire-js.us/stat)\n\nTutorial to use on a Digital Ocean server here:\n\n**START USING DIGITAL OCEAN AND GET $10 FREE**\n[CLICK HERE](https://m.do.co/c/d93e8feef9dc)\n\nDocker images:\n  * **REDIS** `oconnorct1/redis:latest`\n  * **NGINX** `oconnorct1/nginx:latest`\n  * **NODE**  `oconnorct1/peer-tracker:latest`\n\n#### Ingenuity\n\n**The first of it's kind! A smart persistent Bittorent tracker.**\n\nIf one server crashes, the system will not fail.\n\nNginx will handle distributing the load.\n\nUsing a Redis server, memory will be stored intermittently to ensure speed and efficiency over memory, as some loss in peers is ok.\n\nPaired with client software, this package is ready to go.\n\n#### Functionality\n\n* Scrape support\n* **NEW** Multi-Scrape support!!!!\n* WebSocket support\n* Multi-server support\n* Docker compatible\n* NGinX ready\n\n## Install\n\n``` javascript\nnpm install peer-tracker\n\n```\n\n## Usage\n\n  **Server**\n``` javascript\nnew Server();\n```\n\nYep, literally that simple.\n(Be sure to have a Redis instance running)\n\nThe server does take options, however:\n\n``` javascript\n\nlet opts = {\n  port:    80    // Default\n  udpPort: 1337  // Default\n  docker:  false // Default\n}\n\nnew Server(opts);\n```\n\n  **Client**\n  ``` javascript\n// Scrape one hash\nlet client = Client.udp(\"scrape\", \"0.0.0.0\", 1337, 6688, \"0123456789012345678901234567890123456789\", 0, 0, 0);\n// OR ws:\n// Scrape multiple hashes:\nlet client = Client.ws(\"scrape\", \"0.0.0.0\", 80, 6688, [\"0123456789012345678901234567890123456789\", \"0123456789012345678901234567890123456789\"], 0, 0, 0);\n\n\nclient.on(\"announce\", (interval, leechers, seeders, addresses) =\u003e {\n  console.log(\"interval:\", interval);\n  console.log(\"leechers:\", leechers);\n  console.log(\"seeders:\", seeders);\n  console.log(\"addresses:\", addresses);\n});\n\nclient.on(\"scrape\", (seeders, completed, leechers) =\u003e {\n  console.log(\"seeders\", seeders);\n  console.log(\"completed\", completed);\n  console.log(\"leechers\", leechers);\n});\n\nclient.on(\"error\", (err) =\u003e {\n  console.log(\"error:\", err);\n})\n\n  ```\n\nClient will auto-self-destruct upon completion.\n\n`SERVER`\n\nServer(opts);\n  * opts: Options\n\n``` javascript\ninterface Options {\n  port:    number;\n  udpPort: number;\n  docker:  Boolean\n}\n```\n\n\n`UDP CLIENT:`\n\n**udp(announcement, trackerHost, port, myPort, infoHash, left, uploaded, downloaded)**\n  * _announcement_ type: string\n    * `scrape`\n    * `complete`\n    * `start`\n    * `stop`\n    * `update`\n  * _trackerHost_: string\n    * **UDP**: `0.0.0.0`\n  * _port_: number\n  * _myPort_: number\n  * _infoHash_: string\n  * _left_: number\n  * _uploaded_: number\n  * _downloaded_: number\n\n`WS CLIENT:`\n\n**ws(announcement, trackerHost, port, myPort, infoHash, left, uploaded, downloaded)**\n  * _announcement_ type: string\n    * `scrape`\n    * `complete`\n    * `start`\n    * `stop`\n    * `update`\n  * _trackerHost_: string\n    * **WSS**: `0.0.0.0`\n  * _port_: number\n  * _myPort_: number\n  * _infoHash_: string\n  * _left_: number\n  * _uploaded_: number\n  * _downloaded_: number\n\n\n\n## license\n\n### ISC License (Open Source Initiative)\n\nISC License (ISC)\nCopyright \u003c2017\u003e \u003cCraig OConnor\u003e\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n[Craig OConnor](http://connor-craig.us).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcraiggleso%2Fpeer-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcraiggleso%2Fpeer-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcraiggleso%2Fpeer-tracker/lists"}