{"id":16408668,"url":"https://github.com/dletta/webrtc-mesh","last_synced_at":"2025-03-23T06:30:56.895Z","repository":{"id":94470545,"uuid":"310982502","full_name":"Dletta/webrtc-mesh","owner":"Dletta","description":"Library to Mesh webRTC clients","archived":false,"fork":false,"pushed_at":"2020-12-16T06:03:01.000Z","size":82,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T16:45:47.179Z","etag":null,"topics":["meething","mesh","p2p-network","webrtc"],"latest_commit_sha":null,"homepage":"","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/Dletta.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":"2020-11-08T04:06:54.000Z","updated_at":"2024-02-01T09:28:02.000Z","dependencies_parsed_at":"2023-03-30T23:19:56.778Z","dependency_job_id":null,"html_url":"https://github.com/Dletta/webrtc-mesh","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dletta%2Fwebrtc-mesh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dletta%2Fwebrtc-mesh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dletta%2Fwebrtc-mesh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dletta%2Fwebrtc-mesh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dletta","download_url":"https://codeload.github.com/Dletta/webrtc-mesh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245066496,"owners_count":20555402,"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":["meething","mesh","p2p-network","webrtc"],"created_at":"2024-10-11T06:17:29.672Z","updated_at":"2025-03-23T06:30:56.430Z","avatar_url":"https://github.com/Dletta.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webrtc-mesh\n\n** BETA Release API in the work, Subject to Change **\n\n## What does it do??\n\n### Prerequisite Disclaimer\n\nWebRTC allows direct communication between RTC capable Peers (usually browser to browser), thanks to the modern Robinhood Style of\nCoding (aka take from the geniuses and give to the masses) we can make node talk to webRTC peers. (Shoutout to my dependency contributors @theturtle32, @markandrus and @modeswitch)\n\n### The sauce\n\nUsing **your** websocket signaling server (echo server to all connected peers for sdp exchange) do automagically connect all clients running this lib with a network of datachannels\n\n## API - Beta\n\n### Initialize\n\n```javascript\nconst Mesh = require('webrtc-mesh').Mesh;\n\nvar config = {\n  url: 'wss:websocket.url.server:port/',\n  key: 'appKey or Token for message filtering', //optional, default is 'mesh'\n  debug: false, //optional, default is false\n}\n\nvar mesh = Mesh(config);\n\nmesh.pipe( (ev) =\u003e { //handle incoming data\n  console.log('we got some data from another peer', ev.data)\n  });\n\nmesh.sendToAll( arrayBuffer(12) ) // or even just 'string of Json'\n```\n\n### Initialize as Stream\n\n```javascript\nvar Mesh = require('webrtc-mesh').Mesh;\n\nvar config = {\n  url: 'wss:websocket.url.server:port/',\n  key: 'appKey or Token for message filtering', //optional, default is 'mesh'\n  debug: false, //optional, default is false\n}\n\nvar mesh = Mesh(config)\n\nvar meshedStream = mesh.getStream();\nmesh.pipe(meshedStream.push.bind(meshedStream));\n\nprocess.stdin.pipe(meshedStream).pipe(process.stdout);\n\n```\n\n### Utilities\n\n```javascript\nmesh.getPeerList() // returns a map of connected Peers with KEY: peerID Value: object with {status:connectionStatus, conn:reference to Peer Connection, channel: reference to data channel}\nmesh.getPeer(peerId) // returns a specific peer from the map\nmesh.getPeerId() //return your peerId\nmesh.printPeers() // console print for quick check against connection status\nmesh.sendToAll(buffer || blob || string) //send to all peers\nmesh.onNewPeer( function ) // register a function to receive the 'onOpen' event of a new data channel\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdletta%2Fwebrtc-mesh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdletta%2Fwebrtc-mesh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdletta%2Fwebrtc-mesh/lists"}