{"id":13491362,"url":"https://github.com/subins2000/p2pt","last_synced_at":"2025-05-16T15:02:48.650Z","repository":{"id":40653982,"uuid":"259112255","full_name":"subins2000/p2pt","owner":"subins2000","description":"Simple WebRTC Peer 2 Peer connections using WebTorrent trackers as the signalling server. Use WebTorrent trackers for any kind of WebRTC app ! 🔥 Make WebRTC apps fast \u0026 easy ! 🚀⭐","archived":false,"fork":false,"pushed_at":"2024-02-11T17:24:38.000Z","size":266,"stargazers_count":595,"open_issues_count":21,"forks_count":56,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-16T15:01:57.023Z","etag":null,"topics":["p2p","signalling-server","webrtc","websocket-trackers","webtorrent","webtorrent-trackers"],"latest_commit_sha":null,"homepage":"https://WebDrop.Space","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/subins2000.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-26T19:10:52.000Z","updated_at":"2025-05-11T10:03:56.000Z","dependencies_parsed_at":"2024-06-18T18:34:10.395Z","dependency_job_id":"182f0cb4-c4de-4967-8e99-d51640aed2ab","html_url":"https://github.com/subins2000/p2pt","commit_stats":{"total_commits":63,"total_committers":8,"mean_commits":7.875,"dds":0.2698412698412699,"last_synced_commit":"49c7d2898cf81cb6e8b203c6a9afe85c7c20b7b0"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subins2000%2Fp2pt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subins2000%2Fp2pt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subins2000%2Fp2pt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subins2000%2Fp2pt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/subins2000","download_url":"https://codeload.github.com/subins2000/p2pt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553936,"owners_count":22090415,"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":["p2p","signalling-server","webrtc","websocket-trackers","webtorrent","webtorrent-trackers"],"created_at":"2024-07-31T19:00:56.154Z","updated_at":"2025-05-16T15:02:48.592Z","avatar_url":"https://github.com/subins2000.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","p2p"],"sub_categories":[],"readme":"# P2PT\n\nSimple library to establish P2P connections, communicate messages using WebTorrent Trackers (WebSocket) as the signalling server. Make any kind of WebRTC app using WebTorrent trackers as general-purpose WebRTC signalling servers.\n\nWorks in both browser \u0026 node environment.\n\n* [Apps made wih P2PT](#examples)\n* [API Docs](https://github.com/subins2000/p2pt/blob/master/api-docs.md)\n\n## Features\n\n* Easy to use API\n* Send long messages: Data splitted into chunks, sent, received and reassembled all by the library !\n* Use WebSocket Trackers as signalling servers\n* JSON messaging system\n* Send \u0026 Respond to messages in a chain using Promise\n\n## How Does It Work ?\n\nThe [amazing WebTorrent](https://webtorrent.io/) library created a new kind of Torrent Trackers called \"WebSocket Trackers\" also known as \"WebTorrent Trackers\". Some torrent clients can use these new trackers to share files.\n\nBrowser torrent clients (example: [BTorrent](https://btorrent.xyz/)) only have the capability to communicate to these WebTorrent trackers and other browser peers (known as **web peers**). Because, JavaScript in browser can't directly make TCP/IP connections and communicate. [Read more about how WebTorrent works here](https://github.com/webtorrent/webtorrent/).\n\nWebRTC is the method by which browsers can communicate to other browsers peer to peer (P2P). WebTorrent makes use of WebRTC for sharing Torrents on web.\n\nBut, to establish P2P connections, a signalling server is needed. Signalling servers can be made in any way. But, you'll have to host it yourself. In WebTorrent, it's the **WebSocket trackers** that are the **signalling servers**. What if we use those trackers to establish P2P connections for our apps ?! That is what P2PT does ! :)\n\nHow do we find peers for torrent to download ? We use a magnet link. That magnet link has a unique identifier for our torrent called the [Info Hash](https://en.wikipedia.org/wiki/Magnet_URI_scheme#URN,_containing_hash_(xt)). This ID will be unique for all torrents.\n\nSimilarly, to build our apps, we use a identifier. This identifier is converted to a valid Info Hash and sent to our **WebTorrent trackers** who will give us a list of **web peers**. These web peers would be the other users also using our app :\n\n```\nvar p2pt = new P2PT(trackersAnnounceURLs, 'myApp')\n```\n\nAnd that is how P2PT works.\n\n## Examples\n\n### Apps Built With P2PT\n\n* [P2Wiki](//github.com/subins2000/p2wiki): Decentralized P2P proxy to access Wikipedia\n* [P2Chat](//github.com/subins2000/p2chat): P2P noregister instant chat\n* [Vett](//github.com/subins2000/vett): P2P Dots-and-Boxes game. [Play Here](//dots.subinsb.com)\n* [WebDrop](//github.com/subins2000/WebDrop): Easily share file across devices (both LAN \u0026 over Internet)\n* [Board-IO](//github.com/elvistony/board-io \"A Simple Drawing Board thats P2P\"): A Simple Drawing Board that's live over P2P. [Try It Out!](https://elvistony.github.io/board-io)\n* [Rock Paper Scissor](https://github.com/prinzpiuz/Stone-Paper-Scissor): P2P Rock Paper Scissor game [Play Here](https://silly-fermat-36c0e6.netlify.app/#/)\n* [Vaportrade](//github.com/arilotter/vaportrade): P2P Ethereum \u0026 Polygon trading dApp with live negotiation. [Make a trade!](https://vaportrade.net/)\n\nAdd yours here ! Send a PR ! 🚀\n\n### Simple Example\n\nOpen [this webpage](https://codepen.io/subins2000/pen/MWKwRYJ) in two separate browser windows. You'll see the messages. It's a codepen, you can fiddle with the code there.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubins2000%2Fp2pt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubins2000%2Fp2pt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubins2000%2Fp2pt/lists"}