{"bugs":{"url":"https://github.com/geut/socket-signal/issues"},"dist":{"shasum":"08c8cb791f5d4dc96134bd1a547c73fd37780f87","tarball":"https://registry.npmjs.org/socket-signal/-/socket-signal-4.0.2.tgz","fileCount":11,"integrity":"sha512-MWFToixomLreSTobZ5JP+6x99XT3JA7PE4fJwkBzLE/VCUuxZTviLHYtrfbX7FCP8BTk6PQifS2J0b7vXQ4vXA==","signatures":[{"sig":"MEUCIGZA2P0VNtC1U/112eRFCMaljaRfsFuSPUJAeRxK8o3MAiEAqfvzTa6F2Z+zY+CtqoNVOhPC+pC72HF8YMqWXtLc1Bk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31565,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezZ5tCRA9TVsSAnZWagAAQ7sQAIwYv1/l3fS5xeP6+B+k\n1+pPXCCZT/cCTsFCJohB0rVG7F7xYzF6duiRSpGq+HoWuxCyCeVa8mVlIL46\nlXLCWbDHMaxotUX5dde8lUB37Ot+bulv/6kPb8QT6Gjzg+xeI5mk7cfBQwEO\nzoqMGnMRS668xqjMd/MHxjzVE8PbnUr2v4onvXVNzWTCI/2okmpWD6zbyyEb\nP/HPldQfJ9PYJRVxCSheC4n/6MJQ04Ak8ZUE0hDyNsXkaxbxboAdA2P+Bx9B\nbxIY6QkWkO9XbYCmJ1g10J4QbbCs4n8B8evpn9s25ys4G8SKbEWqoehfvsWo\n2NG9+2HiNBIh/ae/7cQf2cIzvxA/ogqhYQzOFl4seEXbL74o/2VVHx81ke1v\n+a62gzYFFVs5HAETr9MkqK7viHIxruNsEQop9uZeadJGnJhZSunvGv8SWlGj\nY+gVPpYSWCgblMvgGPswpAwWSKEPaidZEHy0aysWgy2MUmAkiy5bqcd0MEw5\nYHJ75TMppWdFN8btk4I7Mk488X7GreLAjrp8chQdttuOAiQGkUAFJV3TgEN7\nHpJBJ5Irq4wdnZOe96z4fnAhvnvx5Bvwe3xkUKTN/bAHTY0kfV/DCaSwsPGg\nzp5gBQtvz+1nH1hMSnL1/FycWR8gPtjcqLoZJcrA86srvBKw2g5YnZUCpYve\nQfnh\r\n=Mqfs\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testMatch":["**/tests/**/*.test.js"],"testEnvironment":"node"},"main":"index.js","name":"socket-signal","author":{"name":"GEUT","email":"contact@geutstudio.com"},"readme":"# socket-signal\n\n[![Build Status](https://travis-ci.com/geut/socket-signal.svg?branch=master)](https://travis-ci.com/geut/socket-signal)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)\n\n> Signal abstraction to create WebRTC connections through sockets.\n\nThis module provides a common interface (for the client and server) to build your own signal.\n\nIf you want to use a `ready to use` implementation check: [socket-signal-websocket](https://github.com/geut/socket-signal-websocket).\n\n## <a name=\"install\"></a> Install\n\n```\n$ npm install socket-signal\n```\n\n## <a name=\"usage\"></a> Usage\n\n### Client\n\nThe client interface provides almost everything that you need to start a basic signal client (most of the times you won't need to add more features).\n\n```javascript\nconst { SocketSignalClient } = require('socket-signal')\n\nclass YourClient extends SocketSignalClient {}\n\nconst client = new YourClient(socket)\n\n;(async () => {\n  await client.open()\n\n  client.onIncomingPeer(async (peer) => {\n    if (validPeer(peer)) return\n    throw new Error('invalid peer')\n  })\n\n  const peersForThatTopic = await client.join(topic)\n\n  const remotePeer = client.connect(peersForThatTopic[0], topic)\n\n  try {\n    await remotePeer.waitForConnection()\n    // SimplePeer connected\n  } catch(err) {\n    // SimplePeer rejected\n  }\n})()\n```\n\n### Server\n\nIf you want a server with a minimal implementation to handle peer connections you can use [SocketSignalServerMap](lib/server-map.js) or\nbuild your own abstraction on top the server interface `SocketSignalServer`.\n\n## <a name=\"issues\"></a> Issues\n\n:bug: If you found an issue we encourage you to report it on [github](https://github.com/geut/socket-signal/issues). Please specify your OS and the actions to reproduce it.\n\n## <a name=\"contribute\"></a> Contributing\n\n:busts_in_silhouette: Ideas and contributions to the project are welcome. You must follow this [guideline](https://github.com/geut/socket-signal/blob/master/CONTRIBUTING.md).\n\n## License\n\nMIT © A [**GEUT**](http://geutstudio.com/) project\n","gitHead":"3e8d9cbe6d6ff195d00823c3096e81d446324e06","license":"MIT","scripts":{"lint":"xd-ns \"**/*.js\"","test":"jest --verbose --passWithNoTests --forceExit --detectOpenHandles","start":"node index.js","version":"chan release --allow-yanked ${npm_package_version} && git add .","posttest":"npm run lint","prepublishOnly":"npm test"},"_npmUser":{"name":"tinchoz49","email":"tinchoz49@gmail.com"},"homepage":"https://github.com/geut/socket-signal#readme","keywords":["socket-signal","webrtc","signal","signal-client","signal-server","simple-peer"],"standard":{"env":["jest","node","browser"]},"repository":{"url":"git+https://github.com/geut/socket-signal.git","type":"git"},"_npmVersion":"6.13.4","description":"Signal abstraction to create WebRTC connections through sockets.","directories":{},"maintainers":[{"name":"tinchoz49","email":"tinchoz49@gmail.com"}],"_nodeVersion":"12.16.1","browserslist":["> 5%"],"dependencies":{"debug":"^4.1.1","varint":"^5.0.0","p-event":"^4.1.0","p-queue":"^6.3.0","nanoerror":"^1.0.0","simple-peer":"^9.6.2","end-of-stream":"^1.4.4","isomorphic-ws":"^4.0.1","nanomessage-rpc":"^1.2.1","nanocustomassert":"^1.0.0","nanoresource-promise":"^1.2.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^25.1.0","wrtc":"^0.4.4","@geut/xd":"^1.5.0","standard":"^14.3.1","through2":"^3.0.1","duplexify":"^4.1.1","@geut/chan":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/socket-signal_4.0.2_1590533741017_0.4041312130908914","host":"s3://npm-registry-packages"},"_id":"socket-signal@4.0.2","version":"4.0.2"}