{"_id":"@arwel/peer-js-server","_rev":"1-12b7686e6695bd24030afc226e74a304","name":"@arwel/peer-js-server","dist-tags":{"latest":"0.3.0"},"versions":{"0.3.0":{"name":"@arwel/peer-js-server","version":"0.3.0","description":"PeerJS server component. Fork of original peer package","main":"dist/peerjs.server.min.js","bin":{"peerjs":"bin/peerjs"},"repository":{"type":"git","url":"git+ssh://git@github.com/Arwel96/peerjs-server.git"},"author":{"name":"Michelle Bu, Eric Zhang"},"license":"MIT","scripts":{"build":"tsc","clean":"rimraf ./dist","lint":"eslint --ext .js,.ts .","tsc":"tsc","prebuild":"npm run lint","test":"npm run lint && mocha -r ts-node/register \"test/**/*\"","start":"bin/peerjs --port ${PORT:=9000}","dev:start":"npm-run-all build start","dev":"nodemon --watch src -e ts --exec npm run dev:start"},"release":{"branch":"master"},"dependencies":{"@types/cors":"2.8.6","@types/express":"4.17.1","@types/ws":"6.0.4","body-parser":"1.19.0","cors":"2.8.4","express":"4.17.1","optimist":"0.6.1","uuid":"3.3.3","ws":"7.1.2"},"devDependencies":{"@types/chai":"^4.1.7","@types/mocha":"^5.2.7","@types/node":"^10.14.16","@types/uuid":"3.4.6","@typescript-eslint/eslint-plugin":"^2.11.0","@typescript-eslint/parser":"^2.11.0","chai":"^4.2.0","eslint":"^6.7.2","mocha":"^6.2.2","mock-socket":"8.0.5","nodemon":"1.19.1","npm-run-all":"4.1.5","rimraf":"3.0.0","sinon":"7.5.0","ts-node":"8.5.4","typescript":"3.7.3"},"engines":{"node":">=10"},"bugs":{"url":"https://github.com/peers/peerjs-server/issues"},"homepage":"https://github.com/peers/peerjs-server#readme","directories":{"test":"test"},"keywords":["peer"],"gitHead":"8d4e232d54948bb3d69041b7f1cf84d8126a71f6","_id":"@arwel/peer-js-server@0.3.0","_nodeVersion":"12.9.1","_npmVersion":"6.13.7","dist":{"integrity":"sha512-TXQjJr/bRDChVXAA4VcsfutTi/LmZxcYmVovrlWnrf2z1wUUcixMa1g3ia5erTTx6c8Y5Qn9bS2tZcp+kTm5hA==","shasum":"bc5827287912ab2b2755cb6f61aaacf854c45fb5","tarball":"https://registry.npmjs.org/@arwel/peer-js-server/-/peer-js-server-0.3.0.tgz","fileCount":71,"unpackedSize":80800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeW/4rCRA9TVsSAnZWagAAgpoP/imSZJU8Gb99/+cN8lu1\nBRv2Nc5Fp+u6aUoLx+vJd12Cu3JfOdUFjAzSv8K+LuZwXTQkQF1KWTRC+nzQ\nTDUO+gTROdz3lRWkhfK618OuAQWU02Teoaq/HIQvohc/3X+jsjjVQE5/ua8Z\nhFvpKUJsSZt4Okg0szbAvURdPHiNPrkN0db/L8476EzGKj3U/xfF55i4uw+j\nHfuagKTKWQxWxFvKwzjPfbB4eKIJW3cDN0LnWseLuKK6Hiyqqf6o79sVS0CM\ncajQnryCiw8yU0WWoBMv/WhaYRzlCZBTxYibuFOB+EBlzd5P9OYuH78Mo3C3\naroGrwJR4CVL7AXzTQrqVuGwAlMrSmtRSTIK6oubuS8da3RwTz2pSKsyECzE\nWfntn9Oqv2LZZO5GFRiiuFHv0FtCP93lr3OJN+35Znopc1xzRC+XeaGJx8fT\n+yn5sHPeEPpvyt2gFdS8rWFGWnEtEiJeMILKpRiUleiU1GVRcUL9V9xw/FdQ\nzYziPH4mnYCO06cimMkmm26I0rc+WEWacjanPqxB6vBZ/kjsIHbATLKFyOMW\nDiphhyMLoCChGLXZzv0ypvY600VG9vYG3b34r+FUvjMGNZ+BeJKNwmo7jh5l\ng7bnB6Fq08F3jGXviuceKHA/UtoRfWTbNuK7HPeKGTTWLovfurZGqh6bNH1F\nD0NM\r\n=GetZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA1R6BYpsHmC34xSxSQP2uzOGq80yYspzQizcPZ++eTdAiEAo134aICeiVkVSSEkoHi3yZa5lVhvi5/OpUgRVH8gA84="}]},"maintainers":[{"name":"arwel","email":"muzykaandriy96@gmail.com"}],"_npmUser":{"name":"arwel","email":"muzykaandriy96@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/peer-js-server_0.3.0_1583087147319_0.6641678051333249"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-01T18:25:47.285Z","0.3.0":"2020-03-01T18:25:47.471Z","modified":"2022-04-04T15:41:31.658Z"},"maintainers":[{"name":"arwel","email":"muzykaandriy96@gmail.com"}],"description":"PeerJS server component. Fork of original peer package","homepage":"https://github.com/peers/peerjs-server#readme","keywords":["peer"],"repository":{"type":"git","url":"git+ssh://git@github.com/Arwel96/peerjs-server.git"},"author":{"name":"Michelle Bu, Eric Zhang"},"bugs":{"url":"https://github.com/peers/peerjs-server/issues"},"license":"MIT","readme":"[![Build Status](https://travis-ci.org/peers/peerjs-server.png?branch=master)](https://travis-ci.org/peers/peerjs-server)\n[![npm version](https://badge.fury.io/js/peer.svg)](https://www.npmjs.com/package/peer)\n[![Downloads](https://img.shields.io/npm/dm/peer.svg)](https://www.npmjs.com/package/peer)\n\n# Fork of PeerServer: A server for PeerJS. Original -> https://github.com/peers/peerjs-server #\n\nPeerServer helps broker connections between PeerJS clients. Data is not proxied through the server.\n\nRun your own server on Gitpod!\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/peers/peerjs-server)\n\n## [https://peerjs.com](https://peerjs.com)\n\n### Run PeerServer\n\n1. Install PeerServer from npm or github:\n\n#### NPM\n```bash\nnpm install peer\n```\n\n#### github\n\n```bash\ngit clone https://github.com/peers/peerjs-server.git#master\nnpm install\n```\n\n2. Run the server:\n\n```bash\n$> peerjs --port 9000 --key peerjs --path /myapp\n```\n\nOr, create a custom server:\n\n```javascript\nconst { PeerServer } = require('peer');\nconst server = PeerServer({port: 9000, path: '/myapp'});\n```\n\n3. Check that server works: open browser with [http://localhost:9000/myapp](http://localhost:9000/myapp) It should returns JSON with name, description and website fields.\n\n### Connecting to the server from PeerJS:\n\n```html\n<script>\n    const peer = new Peer('someid', {host: 'localhost', port: 9000, path: '/myapp'});\n</script>\n```\n\n### Using HTTPS: Simply pass in PEM-encoded certificate and key.\n\n```javascript\nconst fs = require('fs');\nconst { PeerServer } = require('peer');\n\nconst server = PeerServer({\n  port: 9000,\n  ssl: {\n    key: fs.readFileSync('/path/to/your/ssl/key/here.key'),\n    cert: fs.readFileSync('/path/to/your/ssl/certificate/here.crt')\n  }\n});\n```\n\n### Running PeerServer behind a reverse proxy\n\nMake sure to set the `proxied` option, otherwise IP based limiting will fail.\nThe option is passed verbatim to the\n[expressjs `trust proxy` setting](http://expressjs.com/4x/api.html#app-settings)\nif it is truthy.\n\n```javascript\nconst { PeerServer } = require('peer');\nconst server = PeerServer({port: 9000, path: '/myapp', proxied: true});\n```\n\n### Combining with existing express app\n\n```javascript\nconst express = require('express');\nconst app = express();\nconst { ExpressPeerServer } = require('peer');\n\napp.get('/', (req, res, next) => { res.send('Hello world!'); });\n\n// =======\n\nconst server = app.listen(9000);\n\nconst options = {\n    debug: true\n    path: '/peerjs'\n}\n\nconst peerserver = ExpressPeerServer(server, options);\n\napp.use(options.path, peerserver);\n\n// == OR ==\n\nconst server = require('http').createServer(app);\nconst peerserver = ExpressPeerServer(server, options);\n\napp.use(options.path, peerserver);\n\nserver.listen(9000);\n\n// ========\n```\n\n### Events\n\nThe `'connection'` event is emitted when a peer connects to the server.\n\n```javascript\npeerserver.on('connection', (client) => { ... });\n```\n\nThe `'disconnect'` event is emitted when a peer disconnects from the server or\nwhen the peer can no longer be reached.\n\n```javascript\npeerserver.on('disconnect', (client) => { ... });\n```\n\n## Running tests\n\n```bash\nnpm test\n```\n\n## Docker\n\nYou can build this image simply by calling:\n```bash\ndocker build -t peerjs https://github.com/peers/peerjs-server.git\n```\n\nTo run the image execute this:  \n```bash\ndocker run -p 9000:9000 -d peerjs\n```\n\nThis will start a peerjs server on port 9000 exposed on port 9000.\n\n## Problems?\n\nDiscuss PeerJS on our Telegram chat:\nhttps://t.me/joinchat/ENhPuhTvhm8WlIxTjQf7Og\n\nPlease post any bugs as a Github issue.\n","readmeFilename":"README.md"}