{"_id":"@deconet/libp2p-webrtc-direct","_rev":"2-a7f7c58e1b12d0ae5f479231db958ba6","name":"@deconet/libp2p-webrtc-direct","dist-tags":{"latest":"0.6.1"},"versions":{"0.6.0":{"name":"@deconet/libp2p-webrtc-direct","version":"0.6.0","description":"Dial using WebRTC without the need to set up any Signalling Rendezvous Point! ","leadMaintainer":"Vasco Santos <vasco.santos@moxy.studio>","main":"src/index.js","publishConfig":{"access":"public"},"browser":{"wrtc":false,"http":false,"request":"xhr"},"scripts":{"lint":"aegir lint","build":"aegir build","docs":"aegir docs","test":"aegir test --target node --target browser","test:node":"aegir test --target node","test:browser":"aegir test --target browser","release":"aegir release --target node --target browser","release-minor":"aegir release --type minor --target node --target browser","release-major":"aegir release --type major --target node --target browser","coverage":"nyc --reporter=text --reporter=lcov npm run test:node"},"repository":{"type":"git","url":"git+https://github.com/libp2p/js-libp2p-webrtc-direct.git"},"keywords":["libp2p","webrtc","dial","stream","connection","woot","woot"],"license":"MIT","bugs":{"url":"https://github.com/libp2p/js-libp2p-webrtc-direct/issues"},"homepage":"https://github.com/libp2p/js-libp2p-webrtc-direct#readme","engines":{"node":">=14.0.0"},"devDependencies":{"aegir":"^30.3.0","chai":"^4.3.4","dirty-chai":"^2.0.1","it-pipe":"^1.1.0","multiaddr":"^9.0.1","streaming-iterables":"^5.0.3","webrtcsupport":"^2.2.0"},"dependencies":{"abortable-iterator":"^3.0.0","class-is":"^1.1.0","concat-stream":"^2.0.0","debug":"^4.3.1","detect-node":"^2.0.4","err-code":"^3.0.0","libp2p-interfaces":"libp2p/js-interfaces#chore/skip-abort-while-reading-for-webrtc","libp2p-utils":"^0.3.0","libp2p-webrtc-peer":"^10.0.1","mafmt":"^9.0.0","multibase":"^4.0.4","once":"^1.4.0","request":"^2.88.0","stream-to-it":"^0.2.2","uint8arrays":"^2.1.2","wrtc":"~0.4.6","xhr":"^2.5.0"},"contributors":[{"name":"Vasco Santos","email":"vasco.santos@moxy.studio"},{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ","email":"victorbjelkholm@gmail.com"},{"name":"Diogo Silva","email":"fsdiogo@gmail.com"},{"name":"Dmitriy Ryajov","email":"dryajov@gmail.com"}],"licenseText":"MIT License\n\nCopyright (c) 2017 libp2p\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@deconet/libp2p-webrtc-direct@0.6.0","dist":{"shasum":"2dca350b99e981062eec6d8c21879e268d5bb981","integrity":"sha512-Ua+p7GwEqrIXT1W2PN/UuLwanN5tqKt8HAN6KR7a6/1sJ0zIbz6lf9acMqQSGLF6mXFOVmq5q2vUPFKLC6VaPw==","tarball":"https://registry.npmjs.org/@deconet/libp2p-webrtc-direct/-/libp2p-webrtc-direct-0.6.0.tgz","fileCount":19,"unpackedSize":30923,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnX+yCRA9TVsSAnZWagAAGkcP/1F1LniOg48CliQii3J2\nGf6nNYacP9PM/RLDod05e6ZSf7hysNmeE3yQXoxndMSIqaI1mrEbWLcMOpik\ntslIImc4DXyWhpfeaN6ucZPluO5i2/k17L7ZeCt4kRqXLellGklfM1hUysrg\ncNg+ZT8+L0e/96cqzF8zO/bNwC3YPovx3KtKJJThiwhbnUwn2aWCPf5Qt0Ga\nV1jpUrWGDOH7QV9AcLBI6oY8alVLnCedExT26/ZTj4FSPXtgtKk3nS2tHNN6\nuek08Lrw71Gej1KCPiIHvtnPq+vMbiLv2q9e1wlkwqGOFXKfhYklR5b60f0J\nWBHcgA0cxloGBF1xwHhxQDaBfgeuLqRL7W+VqqZeDF1W2wYVSdG9BQqgGdzz\nabxszHkpKhg+8OGpo7b8d/6uklYJb1HrmdOQGANfktfnJTp314zbAXnFgzUa\nyuNjip8Ceyqj4fSeHqTihtMxGWaFR/t3c9NrsYKpWfbbmsGVpfW8FNIwKWFk\n8U7VgnJuPACVT6hs4rZYfq8DNszuR21hERf2bPH0fO/6z/uOURP8L2/wtf/c\nQjIM+k3ZjxyB79tFh6IPhFbBD1O3Nepq8maSJswkmkGL0smmpswkTeKsN5IU\n9RtB5ZKDLzW55CyCQD9WjrtrVhybm2awuTJUDSLSky+n6XeW0gZQfsoP0lYj\ncNfC\r\n=atz3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuL2GJ57hT/lbZHILWqUy7RzRNqHIwP/ef46GCYgKHDgIhAIyOLaW1odtgjbXfAJ5AKuaphgwKvGJa+nlaV/gi13de"}]},"_npmUser":{"name":"glitch003","email":"chris@expand.app"},"directories":{},"maintainers":[{"name":"glitch003","email":"chris@expand.app"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/libp2p-webrtc-direct_0.6.0_1620934577653_0.6286484140023572"},"_hasShrinkwrap":false},"0.6.1":{"name":"@deconet/libp2p-webrtc-direct","version":"0.6.1","description":"Dial using WebRTC without the need to set up any Signalling Rendezvous Point! ","leadMaintainer":"Vasco Santos <vasco.santos@moxy.studio>","main":"src/index.js","publishConfig":{"access":"public"},"browser":{"wrtc":false,"http":false,"request":"xhr"},"scripts":{"lint":"aegir lint","build":"aegir build","docs":"aegir docs","test":"aegir test --target node --target browser","test:node":"aegir test --target node","test:browser":"aegir test --target browser","release":"aegir release --target node --target browser","release-minor":"aegir release --type minor --target node --target browser","release-major":"aegir release --type major --target node --target browser","coverage":"nyc --reporter=text --reporter=lcov npm run test:node"},"repository":{"type":"git","url":"git+https://github.com/libp2p/js-libp2p-webrtc-direct.git"},"keywords":["libp2p","webrtc","dial","stream","connection","woot","woot"],"license":"MIT","bugs":{"url":"https://github.com/libp2p/js-libp2p-webrtc-direct/issues"},"homepage":"https://github.com/libp2p/js-libp2p-webrtc-direct#readme","engines":{"node":">=14.0.0"},"devDependencies":{"aegir":"^30.3.0","chai":"^4.3.4","dirty-chai":"^2.0.1","it-pipe":"^1.1.0","multiaddr":"^9.0.1","streaming-iterables":"^5.0.3","webrtcsupport":"^2.2.0"},"dependencies":{"abortable-iterator":"^3.0.0","class-is":"^1.1.0","concat-stream":"^2.0.0","debug":"^4.3.1","detect-node":"^2.0.4","err-code":"^3.0.0","libp2p-interfaces":"libp2p/js-interfaces#chore/skip-abort-while-reading-for-webrtc","libp2p-utils":"^0.3.0","libp2p-webrtc-peer":"^10.0.1","mafmt":"^9.0.0","multibase":"^4.0.4","once":"^1.4.0","request":"^2.88.0","stream-to-it":"^0.2.2","uint8arrays":"^2.1.2","wrtc":"~0.4.6","xhr":"^2.5.0"},"contributors":[{"name":"Vasco Santos","email":"vasco.santos@moxy.studio"},{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ","email":"victorbjelkholm@gmail.com"},{"name":"Diogo Silva","email":"fsdiogo@gmail.com"},{"name":"Dmitriy Ryajov","email":"dryajov@gmail.com"}],"licenseText":"MIT License\n\nCopyright (c) 2017 libp2p\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@deconet/libp2p-webrtc-direct@0.6.1","dist":{"shasum":"2ce7b0f2216cc981f077c9e36646d0ce3ea01b5a","integrity":"sha512-YABpVSLEinChTI59O01zqmvXE9RNSjYMAw1ii4A/5i1Go38DUmG/nYaaqcKJnDXVJFFpngUqLRLzb3l3uCulaA==","tarball":"https://registry.npmjs.org/@deconet/libp2p-webrtc-direct/-/libp2p-webrtc-direct-0.6.1.tgz","fileCount":19,"unpackedSize":30923,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnX/CCRA9TVsSAnZWagAAuqcP/3ZOiJVmLwUM8zkJI8jv\nIyszEhqgwKp+2xqH6wANTeofxAu5jF+uvB8DzY3cG1Yg/CPIBD2msdO5v0VY\nIUmRZtgQTbhaIljB/AhvIUzujq/uZPsR3p/xKz411H2FlV18vmaQr1XmIFiT\nv82E+gbTUJi2ogMn6VlkmuAHumxLckZUmej4nqIGIkevE15JLnuhlSVSJpw3\nHz0sbEt50lqJxvZCI+db55wh27f1njOl/1BplxFZRbazrfmjBGxE0kdj5EF2\nC5krqOEOJrYc0cWDYS6Bdwn6Wu0MOTq1aCgbUjJDW+sgFnXth9o30djZEO8G\nwMZJMu+gyIAH3nCYvicbPBUCs8C3PbLVGzKtH0cuQMeHxTew50qZ/9OqLV40\ntIAR7+Cjy8Mq1f9Vp9FiiKlkqV4pPmVNCcV4Xhkf5NIEHZygYCXV3stQmtEo\nYbwuf5o8v/9V5ukbGxagm1KEIsY91Ebcj1g7GnldX+5pP2ArjY0mpX7QpEdw\nIVimJZ0YsV7DX3CE7mxyec2VV10BEQJFVe76kCyKHFPiZa9VtqjQGbeWeqmq\n5qqx/8hfXBQTAff6Z3ewYJZtNjGw1wJX9TETPGbMfXix9nZGRCfyhmQ+dDGu\n0bi7sKKqOS2RYk8t/jgT+R42StYKR7bXZ2HMY9dpt4ZTU7poLAucWK3z8q1q\npLxN\r\n=MyJU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAlxmZoJOVvNiRcOywIiHLcOnLyYlU0k9L5Xtx2OWMMzAiEA63XitHTsUfdAhc1MfHqIfo7Abvgggo0AsUUcnETm0AI="}]},"_npmUser":{"name":"glitch003","email":"chris@expand.app"},"directories":{},"maintainers":[{"name":"glitch003","email":"chris@expand.app"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/libp2p-webrtc-direct_0.6.1_1620934594241_0.20985153616773156"},"_hasShrinkwrap":false}},"time":{"created":"2021-05-13T19:36:17.431Z","0.6.0":"2021-05-13T19:36:17.796Z","modified":"2022-04-05T03:34:43.044Z","0.6.1":"2021-05-13T19:36:34.394Z"},"maintainers":[{"name":"glitch003","email":"chris@expand.app"}],"description":"Dial using WebRTC without the need to set up any Signalling Rendezvous Point! ","homepage":"https://github.com/libp2p/js-libp2p-webrtc-direct#readme","keywords":["libp2p","webrtc","dial","stream","connection","woot","woot"],"repository":{"type":"git","url":"git+https://github.com/libp2p/js-libp2p-webrtc-direct.git"},"contributors":[{"name":"Vasco Santos","email":"vasco.santos@moxy.studio"},{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ","email":"victorbjelkholm@gmail.com"},{"name":"Diogo Silva","email":"fsdiogo@gmail.com"},{"name":"Dmitriy Ryajov","email":"dryajov@gmail.com"}],"bugs":{"url":"https://github.com/libp2p/js-libp2p-webrtc-direct/issues"},"license":"MIT","readme":"# js-libp2p-webrtc-direct\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-direct.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-webrtc-direct)\n[![](https://img.shields.io/travis/libp2p/js-libp2p-webrtc-direct.svg?style=flat-square)](https://travis-ci.com/libp2p/js-libp2p-webrtc-direct)\n[![Dependency Status](https://david-dm.org/libp2p/js-libp2p-webrtc-direct.svg?style=flat-square)](https://david-dm.org/libp2p/js-libp2p-webrtc-direct) [![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-connection/master/img/badge.png)\n![](https://raw.githubusercontent.com/libp2p/interface-transport/master/img/badge.png)\n\n> A WebRTC transport built for libp2p (not mandatory to use with libp2p) that doesn't require the set up a signalling server. Caveat, you can only establish Browser to Node.js and Node.js to Node.js connections.\n\n## Lead Maintainer\n\n[Vasco Santos](https://github.com/vasco-santos).\n\n## Table of Contents\n\n- [Install](#install)\n  - [npm](#npm)\n- [Usage](#usage)\n- [API](#api)\n- [Pull-streams](#pull-streams)\n\n\n## Install\n\n### npm\n\n```bash\n> npm install libp2p-webrtc-direct\n```\n\n## Usage\n\n```js\nconst WebRTCDirect = require('libp2p-webrtc-direct')\nconst multiaddr = require('multiaddr')\nconst pipe = require('pull-stream')\nconst { collect } = require('streaming-iterables')\n\nconst addr = multiaddr('/ip4/127.0.0.1/tcp/9090/http/p2p-webrtc-direct')\n\nconst webRTCDirect = new WebRTCDirect()\n\nconst listener = webRTCDirect.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 conn = await webRTCDirect.dial(addr)\nconst values = await pipe(\n  conn,\n  collect\n)\nconsole.log(`Value: ${values.toString()}`)\n\n// Close connection after reading\nawait listener.close()\n```\n\nOutputs:\n\n```sh\nlistening\nnew connection opened\nValue: hello\n```\nNote that it may take some time for the connection to be established.\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## Contribute\n\nThe libp2p implementation in JavaScript is a work in progress. As such, there are a few things you can do right now to help out:\n\n - Go through the modules and **check out existing issues**. This would be especially useful for modules in active development. Some knowledge of IPFS/libp2p may be required, as well as the infrastructure behind it - for instance, you may need to read up on p2p and more complex operations like muxing to be able to help technically.\n - **Perform code reviews**.\n - **Add tests**. There can never be enough tests.\n\n## License\n\n[MIT](LICENSE) © Protocol Labs\n","readmeFilename":"README.md"}