{"bin":{"star-sig":"src/sig-server/bin.js","star-signal":"src/sig-server/bin.js","webrtc-star":"src/sig-server/bin.js"},"bugs":{"url":"https://github.com/libp2p/js-libp2p-webrtc-star/issues"},"dist":{"shasum":"c1c5689914ddff380d7c97bfb2003a3c7131df43","tarball":"https://registry.npmjs.org/libp2p-webrtc-star/-/libp2p-webrtc-star-0.18.0.tgz","fileCount":19,"integrity":"sha512-P3zienPjPoPISdDuyUCvWGxzYC3g48jQ2vy9VLqIKFbzHVHj9BdKHgz6SElOi+Ee63+kjMNmzIlHKYzpuE0qFA==","signatures":[{"sig":"MEYCIQDQuc9YBr3TtzmOISmk50UKaKl4beo9zkkF3EchPlWr9QIhAMQWVfX1Hl2q8XD8NnNjjE5YBhaTJ9A1WBap6p8euyph","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6832732,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenzIHCRA9TVsSAnZWagAAJlUP+gI0vF+f4TTsQEV+1EMt\nHkEZoe1WH+dLiTzgdMRfbcf3kfrMtXw/CpdCcOG+cANIECGpOMyYC3gm7z2Z\n1DM9fG1BkvlAoCuNn9o6FYymAhOJpE5yq/Q6jcuP0KE7exWFTe5iHbeOSGvt\n+Iu3fnxluYTDVbyPAFwXeYYTqiLQG//pyEFg+w9w8UJPhc5LVQPV3XOIIGtB\ndmaOBUcoxcHHGyxLVLaOqnINt5TMYCDpSlE1M4Po8PPHiidJFzTCWJF1SC8B\nNRve0hwHr/dVvCMVr13hkI3q9e+y2bw7p4FaV4gTjtsMNopWFfbwoac+3+7A\nosX6tqS2fXSeUJkM0uqlQpmKC7J9doVDC6GVx9geRpIKVKyOktUYC7FW/vYv\nIUOoLUmMtVwvGYKLn5Jnf6oXuG4xLJDCj4tCLLjyGngN9PETHBPE6/wk7kXW\n+tM5KcraLzf6r1cxYXIW5wQGwpYB/mfcbkmyWL+S0lV4fOgIodMYr8bQQnzd\nmLP899fwGl+PQG0fCvrY+VZJ57Ggvtydmx6ia1y706E0QKKpHABunUU4aaDb\n01BMsnBXphJYtzx00FMiQGgHlwxe/nU0wSNCX+/XgYZ4E8/X0Tr0HtTlRF6t\nwfglSOX9XmljBeMcoV+Ze0JWCC+VciWqVMc037tPycNbfeLXXe0IDnjJTeHm\nCCjm\r\n=BinJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/index.js","name":"libp2p-webrtc-star","readme":"# js-libp2p-webrtc-star\n\n[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://protocol.ai)\n[![](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)\n[![](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p)\n[![Discourse posts](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg)](https://discuss.libp2p.io)\n[![](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-webrtc-star.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-webrtc-star)\n[![](https://img.shields.io/travis/libp2p/js-libp2p-webrtc-star.svg?style=flat-square)](https://travis-ci.com/libp2p/js-libp2p-webrtc-star)\n[![Dependency Status](https://david-dm.org/libp2p/js-libp2p-webrtc-star.svg?style=flat-square)](https://david-dm.org/libp2p/js-libp2p-webrtc-star) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)\n\n[![](https://raw.githubusercontent.com/libp2p/interface-transport/master/img/badge.png)](https://github.com/libp2p/interface-transport)\n[![](https://raw.githubusercontent.com/libp2p/interface-connection/master/img/badge.png)](https://github.com/libp2p/interface-connection)\n[![](https://github.com/libp2p/interface-peer-discovery/raw/master/img/badge.png)](https://github.com/libp2p/interface-peer-discovery)\n\n> libp2p WebRTC transport that includes a discovery mechanism provided by the signalling-star\n\n## Lead Maintainer\n\n[Vasco Santos](https://github.com/vasco-santos).\n\n## Description\n\n`libp2p-webrtc-star` is one of the WebRTC transports available for libp2p. `libp2p-webrtc-star` incorporates both a transport and a discovery service that is facilitated by the signalling server, also part of this module.\n\n## Usage\n\n### Install\n\n```bash\n> npm install libp2p-webrtc-star\n```\n\n## Usage\n\n### Using this module in Node.js (read: not in the browser)\n\nTo use this module in Node.js, you have to BYOI of WebRTC, there are multiple options out there, unfortunately, none of them are 100% solid. The ones we recommend are: [wrtc](http://npmjs.org/wrtc) and [electron-webrtc](https://www.npmjs.com/package/electron-webrtc).\n\nInstead of just creating the WebRTCStar instance without arguments, you need to pass an options object with the WebRTC implementation:\n\n```JavaScript\nconst wrtc = require('wrtc')\nconst electronWebRTC = require('electron-webrtc')\nconst WStar = require('libp2p-webrtc-star')\n\n// Using wrtc\nconst ws1 = new WStar({ wrtc: wrtc })\n\n// Using electron-webrtc\nconst ws2 = new WStar({ wrtc: electronWebRTC() })\n```\n\n### Using this module in the Browser\n\n```JavaScript\nconst WStar = require('libp2p-webrtc-star')\nconst multiaddr = require('multiaddr')\nconst pipe = require('it-pipe')\nconst { collect } = require('streaming-iterables')\n\nconst addr = multiaddr('/ip4/188.166.203.82/tcp/20000/wss/p2p-webrtc-star/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSooo2a')\n\nconst ws = new WStar({ upgrader })\n\nconst listener = ws.createListener((socket) => {\n  console.log('new connection opened')\n  pipe(\n    ['hello'],\n    socket\n  )\n})\n\nawait listener.listen(addr)\nconsole.log('listening')\n\nconst socket = await ws.dial(addr)\nconst values = await pipe(\n  socket,\n  collect\n)\n\nconsole.log(`Value: ${values.toString()}`)\n\n// Close connection after reading\nawait listener.close()\n```\n\n## API\n\n### Transport\n\n[![](https://raw.githubusercontent.com/libp2p/interface-transport/master/img/badge.png)](https://github.com/libp2p/interface-transport)\n\n### Connection\n\n[![](https://raw.githubusercontent.com/libp2p/interface-connection/master/img/badge.png)](https://github.com/libp2p/interface-connection)\n\n### Peer Discovery - `ws.discovery`\n\n[![](https://github.com/libp2p/interface-peer-discovery/raw/master/img/badge.png)](https://github.com/libp2p/interface-peer-discovery)\n\n## Rendezvous server (aka Signalling server)\n\nNodes using `libp2p-webrtc-star` will connect to a known point in the network, a rendezvous point where they can learn about other nodes (Discovery) and exchange their [SDP offers (signalling data)](https://www.html5rocks.com/en/tutorials/webrtc/infrastructure/).\n\n`libp2p-webrtc-star` comes with its own signalling server, used for peers to handshake their signalling data and establish a connection. You can install it in your machine by installing the module globally:\n\n```bash\n> npm install --global libp2p-webrtc-star\n```\n\nThis will expose a `webrtc-star` cli tool. To spawn a server do:\n\n```bash\n> star-signal --port=13579 --host=127.0.0.1\n```\n\nDefaults:\n\n- `port` - 9090\n- `host` - '0.0.0.0'\n\n## Hosted Rendezvous Server\n\nWe host a signalling server at `star-signal.cloud.ipfs.team` that can be used for practical demos and experimentation, it **should not be used for apps in production**.\nA libp2p-webrtc-star address, using the signalling server we provide, looks like: \n\n`/dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star/p2p/<your-peer-id>`\n\nNote: The address above indicates WebSockets Secure, which can be accessed from both http and https.\n","engines":{"npm":">=6.0.0","node":">=10.0.0"},"gitHead":"914905802c391127c4acd91552a7b8807a163514","license":"MIT","scripts":{"lint":"aegir lint","test":"aegir test -t node -t browser","build":"aegir build","release":"aegir release -t node -t browser","test:ip":"WEBRTC_STAR_REMOTE_SIGNAL_IP=1 aegir test -t browser","coverage":"aegir coverage","test:dns":"WEBRTC_STAR_REMOTE_SIGNAL_DNS=1 aegir test -t browser","test:node":"aegir test -t node","star-signal":"node src/sig-server/bin.js","test:browser":"aegir test -t browser","release-major":"aegir release --type major -t node -t browser","release-minor":"aegir release --type minor -t node -t browser","coverage-publish":"aegir coverage --provider coveralls"},"_npmUser":{"name":"vascosantos","email":"vasco.santos@moxy.studio"},"homepage":"https://github.com/libp2p/js-libp2p-webrtc-star#readme","keywords":["IPFS","libp2p"],"pre-push":["lint"],"repository":{"url":"git+https://github.com/libp2p/js-libp2p-webrtc-star.git","type":"git"},"_npmVersion":"6.13.4","description":"libp2p WebRTC transport that includes a discovery mechanism provided by the signalling-star","directories":{},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"_nodeVersion":"12.14.0","contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Vasco Santos","email":"vasco.santos@moxy.studio"},{"name":"Jacob Heun","email":"jacobheun@gmail.com"},{"name":"Friedel Ziegelmayer","email":"dignifiedquire@gmail.com"},{"name":"Yahya","email":"ya7yaz@gmail.com"},{"name":"Pedro Teixeira","email":"i@pgte.me"},{"name":"Maciej Krüger","email":"mkg20001@gmail.com"},{"name":"Dmitriy Ryajov","email":"dryajov@gmail.com"},{"name":"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ","email":"victorbjelkholm@gmail.com"},{"name":"Alan Shaw","email":"alan.shaw@protocol.ai"},{"name":"Alex Potsides","email":"alex@achingbrain.net"},{"name":"Michael Fakhry","email":"fakhrimichael@live.com"},{"name":"SeungWon","email":"ksw3894@gmail.com"},{"name":"Richard Littauer","email":"richard.littauer@gmail.com"},{"name":"Juan Benet","email":"juan@benet.ai"},{"name":"Hugo Dias","email":"mail@hugodias.me"},{"name":"dmitriy ryajov","email":"dryajov@dmitriys-MBP.HomeNET"},{"name":"Diogo Silva","email":"fsdiogo@gmail.com"},{"name":"Flarp","email":"flurpdadurp@gmail.com"},{"name":"interfect","email":"interfect@gmail.com"}],"dependencies":{"debug":"^4.1.1","mafmt":"^7.0.1","it-pipe":"^1.0.1","p-defer":"^3.0.0","peer-id":"~0.13.2","class-is":"^1.1.0","err-code":"^2.0.0","minimist":"^1.2.0","menoetius":"0.0.2","multiaddr":"^7.1.0","peer-info":"~0.17.0","socket.io":"^2.3.0","@hapi/hapi":"^18.4.0","@hapi/inert":"^5.2.2","prom-client":"^12.0.0","simple-peer":"^9.6.0","libp2p-utils":"^0.1.0","stream-to-it":"^0.2.0","webrtcsupport":"github:ipfs/webrtcsupport","socket.io-client":"^2.3.0","abortable-iterator":"^3.0.0","streaming-iterables":"^4.1.0"},"_hasShrinkwrap":false,"leadMaintainer":"Vasco Santos <vasco.santos@moxy.studio>","readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","wrtc":"^0.4.3","aegir":"^21.2.0","sinon":"^9.0.0","dirty-chai":"^2.0.1","p-wait-for":"^3.1.0","electron-webrtc":"~0.3.0","libp2p-interfaces":"github:libp2p/js-interfaces#skip-abort-while-reading"},"_npmOperationalInternal":{"tmp":"tmp/libp2p-webrtc-star_0.18.0_1587491334649_0.3215276002577705","host":"s3://npm-registry-packages"},"_id":"libp2p-webrtc-star@0.18.0","version":"0.18.0"}