{"_id":"@amplifi_labs/peer","_rev":"4-cf73a58e507d213e04038c35edb40cf2","name":"@amplifi_labs/peer","dist-tags":{"latest":"0.5.6"},"versions":{"0.5.3":{"name":"@amplifi_labs/peer","version":"0.5.3","description":"PeerJS server component","main":"dist/src/index.js","bin":{"peerjs":"bin/peerjs"},"keywords":["peerjs","webrtc","signaling"],"homepage":"https://github.com/peers/peerjs-server#readme","bugs":{"url":"https://github.com/peers/peerjs-server/issues"},"repository":{"type":"git","url":"git+https://github.com/peers/peerjs-server.git"},"author":{"name":"Amplifi Labs, John Petitte"},"license":"MIT","scripts":{"preversion":"npm run clean && npm run build","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.3","@types/ws":"^7.2.3","body-parser":"^1.19.0","cors":"^2.8.5","express":"^4.17.1","uuid":"^3.4.0","ws":"^7.2.3","yargs":"^15.3.1"},"devDependencies":{"@types/chai":"^4.2.11","@types/mocha":"^7.0.2","@types/node":"^10.17.17","@types/uuid":"^3.4.8","@typescript-eslint/eslint-plugin":"^2.24.0","@typescript-eslint/parser":"^2.24.0","chai":"^4.2.0","eslint":"^6.8.0","mocha":"^7.1.1","mock-socket":"8.0.5","nodemon":"^1.19.4","npm-run-all":"^4.1.5","rimraf":"^3.0.2","sinon":"^7.5.0","ts-node":"^8.7.0","typescript":"^3.8.3"},"engines":{"node":">=10"},"gitHead":"7bbb0682c790b55d17d9bfa286113cb8278905c1","_id":"@amplifi_labs/peer@0.5.3","_nodeVersion":"12.16.2","_npmVersion":"6.14.4","dist":{"integrity":"sha512-9CotnLbivpoI25dRKgyb2KBHS7BAzsV3dvBBXdOjCYY7GjIFk6LbchVNHzJ2oXngdgV7lf3uazngwODQy07i6A==","shasum":"76084c023b7a470a92ef1581ce03173d5b481970","tarball":"https://registry.npmjs.org/@amplifi_labs/peer/-/peer-0.5.3.tgz","fileCount":30,"unpackedSize":41563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezoscCRA9TVsSAnZWagAAqlkP/1GSe+J66aUBqPV0dVlP\n7THodpx7+eA1yWWcoG8E59umWPYFuuDWJ8xFY7BrCjgvg4bOm+GBciCo+6e9\ntzyAfkZ4tbhDojxHw2q0Gm71Y6/NH/HwAp66DhFTQwsVr7pHa5eT7Bi5liRc\nrxP4jlaJj0jIfBFmFJCrCmiyOO4zmTjDTYLLc6Ivn0Lv5cjfqfr0HhCxKfI9\nT7/SSrnB9W2NP6V7T37Gmzl0XiqSFF8Rl4M/FP5xo7Ky7rsgCT7aVhm1npmb\nrcmlp9AEtDMqO7wnSuJyloLxGihoD7h0UiCSEQNHSYrO9D+AybzcBnQcTrRP\nD1iSNniCALE8Rdh2sAtVunx15AV0/MBKDkD7SGe9sWKXAnCDvY014IsSZT4M\n8lenufwJ/dMGrcAPhS/qI8zILbDA5iqpM6+MU75BlSdV0jXfJI9i3riqZdY+\nvPk5D+uLFAIVAlnbVTqOxypVWt0xhDLeOInjxhXrJXBdyJM0nBwh2c6+f1rd\nkQ84D1e7V5z96qD9e5fi5t+0Fa4zwJVdpiKNLEA6YTHnfgJfWOKNYBVm+TaP\nz2lzxL/1akfT8Lvgr77Jqj43NIRUhMF8BQV+sQq9QmPk163ErruhBJBmbCKR\nbvEEMPEdNvmlQxBEN7xmTMgc7zCLt1MkGnDHx9vKtoBPpQ8vU/X0BxKINou0\n6wlF\r\n=rICY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFXMeULDPwB983VcY6OCXdoU+RK5OnxmgEKrhV4SwkNlAiEA6jW9cI6n7esFCSlbKLPsuwz1rS0KyD3SecCzgZeL7PI="}]},"maintainers":[{"name":"jpetitte","email":"john.n.petitte@gmail.com"},{"name":"rafaelmatsumoto","email":"rafaelmatsumoto43@gmail.com"},{"name":"paulo.rieck_amplifi","email":"paulo.rieck@amplifilabs.com"}],"_npmUser":{"name":"jpetitte","email":"john.n.petitte@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/peer_0.5.3_1590594332046_0.18914247100305204"},"_hasShrinkwrap":false},"0.5.4":{"name":"@amplifi_labs/peer","version":"0.5.4","description":"PeerJS server component","main":"dist/src/index.js","bin":{"peerjs":"bin/peerjs"},"keywords":["peerjs","webrtc","signaling"],"homepage":"https://github.com/peers/peerjs-server#readme","bugs":{"url":"https://github.com/peers/peerjs-server/issues"},"repository":{"type":"git","url":"git+https://github.com/peers/peerjs-server.git"},"author":{"name":"Amplifi Labs, John Petitte"},"license":"MIT","scripts":{"preversion":"npm run clean && npm run build","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.3","@types/ws":"^7.2.3","body-parser":"^1.19.0","cors":"^2.8.5","express":"^4.17.1","uuid":"^3.4.0","ws":"^7.2.3","yargs":"^15.3.1"},"devDependencies":{"@types/chai":"^4.2.11","@types/mocha":"^7.0.2","@types/node":"^10.17.17","@types/uuid":"^3.4.8","@typescript-eslint/eslint-plugin":"^2.24.0","@typescript-eslint/parser":"^2.24.0","chai":"^4.2.0","eslint":"^6.8.0","mocha":"^7.1.1","mock-socket":"8.0.5","nodemon":"^1.19.4","npm-run-all":"^4.1.5","rimraf":"^3.0.2","sinon":"^7.5.0","ts-node":"^8.7.0","typescript":"^3.8.3"},"engines":{"node":">=10"},"gitHead":"7ca60842b117d7aa463be930375ff36a617df743","_id":"@amplifi_labs/peer@0.5.4","_nodeVersion":"12.16.2","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Gqu086oTWsEUZa6YL6Scm6q+pvx99ef7nouMh8TqnpnOAegpBrjYvmcrjMmD09DygRll6d3qnhyqkXGj5E/0mQ==","shasum":"df1cd41ceb6cb34b6665c600dd3e4869058ca2ab","tarball":"https://registry.npmjs.org/@amplifi_labs/peer/-/peer-0.5.4.tgz","fileCount":30,"unpackedSize":41567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezpEDCRA9TVsSAnZWagAAq4kP/2hiBas/JFazjVBm5ZYn\n3qXLHH5A6VwmB7e2Y3y7I24EeOQnI+xjyDcGvL3Ct3wJkzNoUALmdbAMgdrB\nI73EzleO+P4l35FCjN8v6FqIhu8V5GtOETQgcZzHhCaXPJnw+HAVvMYbQzWH\ncAhbjPMdToDlGkWeTEnG8Ud7taVDXp0ygrM4QfLRM+RIReI/2Uh/yWF2nEuL\nauE0oT1/h7MEE3zcjiW07H4tSZb/aFZnm/28XdO8CZ5jfq54K1vJYoQ8VOIr\n6NRdmJhQvnmsPVxLvo8iFVgiKpWL//3ZlwowE/ifTs+0lhP2iZSwiMujZnhN\nmEVp3GkDUNsenWBMgHHs402JK8SoVe1v+9tbXZaEsNkdcs2FxrsqvCqAdVwV\nBrS8SCK6k146XJMAj1MG3rHJVRJJkrxjQ7X6h8HV3KcpVkIAWTHsOaJtYivY\njWLC8btHQsxFoAKh0OfIOG9TRFYXpJVCfEHoBLPP2AI9Hoos86JVjz7gRr8C\nFT/jX9gvrxK7arnTSpJGpS17BQ6n20MYI/457mHWrHzqZ9qVEsq9hOeKVDwJ\niuJc4IdFSSzn+/1FQ5TXaNEiB62Wqz//3Ro7GaYzxFYXxYwUSlKipJbYwma4\nBgDGrjUQKdq4RWlDqN5X2cXnkK98aFPDv5JvRRjtwssK4rMSrCQaipVJvHeZ\nIj7M\r\n=PRof\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICvQETy0XRZL/1zurSJCvg6YM8/xoHUAKcZS3hNt8kA4AiEA1csbCtzTlSBlG1GmGtvDoWoQIalNW3Rsw/ysWvzPSnw="}]},"maintainers":[{"name":"jpetitte","email":"john.n.petitte@gmail.com"},{"name":"paulo.rieck_amplifi","email":"paulo.rieck@amplifilabs.com"},{"name":"rafaelmatsumoto","email":"rafaelmatsumoto43@gmail.com"}],"_npmUser":{"name":"jpetitte","email":"john.n.petitte@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/peer_0.5.4_1590595843499_0.7197323652147491"},"_hasShrinkwrap":false},"0.5.5":{"name":"@amplifi_labs/peer","version":"0.5.5","description":"PeerJS server component","main":"dist/src/index.js","bin":{"peerjs":"bin/peerjs"},"keywords":["peerjs","webrtc","signaling"],"homepage":"https://github.com/peers/peerjs-server#readme","bugs":{"url":"https://github.com/peers/peerjs-server/issues"},"repository":{"type":"git","url":"git+https://github.com/peers/peerjs-server.git"},"author":{"name":"Amplifi Labs, John Petitte"},"license":"MIT","scripts":{"preversion":"npm run clean && npm run build","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.3","@types/ws":"^7.2.3","body-parser":"^1.19.0","cors":"^2.8.5","express":"^4.17.1","uuid":"^3.4.0","ws":"^7.2.3","yargs":"^15.3.1"},"devDependencies":{"@types/chai":"^4.2.11","@types/mocha":"^7.0.2","@types/node":"^10.17.17","@types/uuid":"^3.4.8","@typescript-eslint/eslint-plugin":"^2.24.0","@typescript-eslint/parser":"^2.24.0","chai":"^4.2.0","eslint":"^6.8.0","mocha":"^7.1.1","mock-socket":"8.0.5","nodemon":"^1.19.4","npm-run-all":"^4.1.5","rimraf":"^3.0.2","sinon":"^7.5.0","ts-node":"^8.7.0","typescript":"^3.8.3"},"engines":{"node":">=10"},"gitHead":"5857b5ec9fcdd95f559edaf70c886c47b83f666b","_id":"@amplifi_labs/peer@0.5.5","_nodeVersion":"12.16.2","_npmVersion":"6.14.4","dist":{"integrity":"sha512-O85Ax9saHnQAJcmPVbZ8QJIFew3nKY+xjitTjUR3D621GYwYS8kNw2SribY/3IhhM9ckla2w7yG52NBa0pG4Fw==","shasum":"a391c9f221dd8199b8f4e1225ae78d1309871ef0","tarball":"https://registry.npmjs.org/@amplifi_labs/peer/-/peer-0.5.5.tgz","fileCount":30,"unpackedSize":41567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezpL8CRA9TVsSAnZWagAAzyMP/2t5FKhrbY+JYj9mtLDl\nfeT6oXoN7AtjoR5eWbXuPsVyhDG27DwM++rKKs/cIA9lW6gJbbdhDnTG0cwY\nIVN8Kz8utLTw7Xc3k5+6QkHRW+537Fd/3Q71VI4+B3j0+cDONzBTGso5+Hk2\nqIqbIZ/m/Uwnxzr+1JGECLZZayzkaPYsAL56uXSMs8wYEpJcEYS5vBdViF7P\nCycNneo3Nyl3jQlMIXubxlBvPjppWFQKnKWWnKZ+HCop8W9OVrbn5PJ5kf1f\nI0tkjymRrYEUeZPCEbRY0/UT/uhxAod0keBqta05TmbxxalEEFxcREvhOtKN\nywFW5NIgaPUCFgGjft2acpOs6iF5IGHwJmlXwvaH/gANB2pElMF3CdGOO4kR\nq8dXqae+GbSDtuB0ZPLHzxM7hFhU7H5T+ZfPuQYH9wFzk8wXn98vxGXLVMxv\nBK74MozvfL8KFLjDW1didadSqUd47hz3cOXECTVamyxvZZRcvDs8lGqJANZr\nVJW5OC1q28OeBtnh1in+JM64ZJTNfxx9e7fQ4YTdajITLFZR4YQkzx2Pzp7o\nH10xEQHsy5ZSE7pvcbkPPdnpNHGHpsJLF9lhJwZjGWKMqdGqeu8jjZ0wzKKj\nm46sKD/wnQVIbGqjISjJDk83oSgKma775p8jUduKW5AD9dNhxjarbe2s4c+W\n8INe\r\n=fx87\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBHdyy634x6zk/eB535T7k6IWOAHVZwvA0LZ33hQ8QSDAiAPo9VNLPX3lBS/0lFebMTWUCaENKojkgIpuSKHM2Q+/w=="}]},"maintainers":[{"name":"jpetitte","email":"john.n.petitte@gmail.com"},{"name":"paulo.rieck_amplifi","email":"paulo.rieck@amplifilabs.com"},{"name":"rafaelmatsumoto","email":"rafaelmatsumoto43@gmail.com"}],"_npmUser":{"name":"jpetitte","email":"john.n.petitte@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/peer_0.5.5_1590596347866_0.224020118122348"},"_hasShrinkwrap":false},"0.5.6":{"name":"@amplifi_labs/peer","version":"0.5.6","description":"PeerJS server component","main":"dist/src/index.js","bin":{"peerjs":"bin/peerjs"},"keywords":["peerjs","webrtc","signaling"],"homepage":"https://github.com/peers/peerjs-server#readme","bugs":{"url":"https://github.com/peers/peerjs-server/issues"},"repository":{"type":"git","url":"git+https://github.com/peers/peerjs-server.git"},"author":{"name":"Amplifi Labs, John Petitte"},"license":"MIT","scripts":{"preversion":"npm run clean && npm run build","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.3","@types/ws":"^7.2.3","body-parser":"^1.19.0","cors":"^2.8.5","express":"^4.17.1","uuid":"^3.4.0","ws":"^7.2.3","yargs":"^15.3.1"},"devDependencies":{"@types/chai":"^4.2.11","@types/mocha":"^7.0.2","@types/node":"^10.17.17","@types/uuid":"^3.4.8","@typescript-eslint/eslint-plugin":"^2.24.0","@typescript-eslint/parser":"^2.24.0","chai":"^4.2.0","eslint":"^6.8.0","mocha":"^7.1.1","mock-socket":"8.0.5","nodemon":"^1.19.4","npm-run-all":"^4.1.5","rimraf":"^3.0.2","sinon":"^7.5.0","ts-node":"^8.7.0","typescript":"^3.8.3"},"engines":{"node":">=10"},"gitHead":"803e1880da6f5365525d08e997e8a2112bf9cf20","_id":"@amplifi_labs/peer@0.5.6","_nodeVersion":"12.16.2","_npmVersion":"6.14.4","dist":{"integrity":"sha512-kPBrlh5XSLj6ewIohB65+N5sAXv2PKOU9xDKForG8VF068wiP1C53S/D9mXN+Tg9z1t9XUn7p1HPb0wq88C7mA==","shasum":"9577159b2715250d9c09ca3d3c8bc59d4cfef403","tarball":"https://registry.npmjs.org/@amplifi_labs/peer/-/peer-0.5.6.tgz","fileCount":30,"unpackedSize":41567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezpO+CRA9TVsSAnZWagAAznEP/1QtGNqGSLeRl3c/Yaqj\n3hokAnNTOREBZJ5be8YnoBYH0N7xbtV2p4yN/5Qlvb2XsqzsZgmjhcNewgj/\noisUFJm1wXPkbSfIn+l3MleMydryiIHhIaqE497Hnf02WWbI+iv2YAw48cVB\nvxVdGsfpsB4hHLzLJ9qcRNCB3y+qTIWpvFUCBt+Sir/Pb5CmyN6N5nnpj+5Z\nR6i6ZXNVRB9a7r5vwnNFF8UQsiHc80Ef+1KFZzZB3uP+wO+RaWs0myRhnFoI\n2EA/JlKyUgpEVfXlt3lU097QTsx1t3BkOCn2L6q8R0gUHctbt0EwHJHeS1Nf\nqNPfs4qmFHT3tq1r/wDEs3vv3n3SY8ZIS11DwtVBQRTjDVO/Z1ZjS2lAsW+i\n2AfZIUZZUxYqdrPG/sEFJwaJYC+fXMYHsH0AHNrReHj58evrYFWQTWIfOu9S\np4MFRXtS+2J2OqhO7wJRJ2D8IOeFLokNfsKEwVpfYJuH56lNf4Ont0xem9AW\nePKxGg1bZdjaJ5SEfx5Pa3mNudCq/1AhpC7LM9aXB2FQAL7786oMw3i8su2q\nsnNUBXBo7qTv9LPsYnj4E/+f0xPNkHEcE1X2/d1aLH7tR2I/gtPUM/QqwDWl\ns1NTVCES2K44bsMtoeI40ZaYovgFJvJoSHxaNARka0AuygoxDcjfnZwHQ9ZV\nRB85\r\n=WkHD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWnpH6lwlhZ+hGyoh99AUdvDm+RD4btTP4ekdP3kDqBwIhAL04VwboPTV96DgQ0VnRKs9RfHDYLFkZoUoOXurmqN+o"}]},"maintainers":[{"name":"jpetitte","email":"john.n.petitte@gmail.com"},{"name":"paulo.rieck_amplifi","email":"paulo.rieck@amplifilabs.com"},{"name":"rafaelmatsumoto","email":"rafaelmatsumoto43@gmail.com"}],"_npmUser":{"name":"jpetitte","email":"john.n.petitte@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/peer_0.5.6_1590596542505_0.46763274196727234"},"_hasShrinkwrap":false}},"time":{"created":"2020-05-27T15:45:31.797Z","0.5.3":"2020-05-27T15:45:32.155Z","modified":"2022-04-04T13:52:15.442Z","0.5.4":"2020-05-27T16:10:43.601Z","0.5.5":"2020-05-27T16:19:07.967Z","0.5.6":"2020-05-27T16:22:22.612Z"},"maintainers":[{"name":"jpetitte","email":"john.n.petitte@gmail.com"},{"name":"paulo.rieck_amplifi","email":"paulo.rieck@amplifilabs.com"},{"name":"rafaelmatsumoto","email":"rafaelmatsumoto43@gmail.com"}],"description":"PeerJS server component","homepage":"https://github.com/peers/peerjs-server#readme","keywords":["peerjs","webrtc","signaling"],"repository":{"type":"git","url":"git+https://github.com/peers/peerjs-server.git"},"author":{"name":"Amplifi Labs, John Petitte"},"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![node](https://img.shields.io/node/v/peer)\n![David](https://img.shields.io/david/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[![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/peerjs/peerjs-server)](https://hub.docker.com/r/peerjs/peerjs-server)\n# PeerServer: A server for PeerJS #\n\nPeerServer helps establishing 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## Usage\n\n### Run server\nIf you don't want to develop anything, just enter few commands below.\n\n1. Install the package globally:\n    ```sh\n    $ npm install peer -g\n    ```\n2. Run the server:\n    ```sh\n    $ peerjs --port 9000 --key peerjs --path /myapp\n\n      Started PeerServer on ::, port: 9000, path: /myapp (v. 0.3.2)\n    ```\n3. Check it: http://127.0.0.1:9000/myapp It should returns JSON with name, description and website fields.\n\nAlso, you can use Docker image to run a new container:\n```sh\n$ docker run -p 9000:9000 -d peerjs/peerjs-server\n```\n\n### Create a custom server:\nIf you have your own server, you can attach PeerServer.\n\n1. Install the package:\n    ```sh\n    #$ cd your-project-path\n    $ npm install peer\n    ```\n2. Use PeerServer object to create a new server:\n    ```javascript\n    const { PeerServer } = require('peer');\n\n    const peerServer = PeerServer({ port: 9000, path: '/myapp' });\n    ```\n\n3. Check it: http://127.0.0.1:9000/myapp It should returns JSON with name, description and website fields.\n\n### Connecting to the server from client PeerJS:\n\n```html\n<script>\n    const peer = new Peer('someid', {\n      host: 'localhost',\n      port: 9000,\n      path: '/myapp'\n    });\n</script>\n```\n\n## Config / CLI options\nYou can provide config object to `PeerServer` function or specify options for `peerjs` CLI.\n\n| CLI option | JS option | Description | Required | Default |\n| -------- | ------- | ------------- | :------: | :---------: |\n| `--port, -p` | `port` | Port to listen (number) | **Yes** | |\n| `--key, -k` | `key` | Connection key (string). Client must provide it to call API methods | No | `\"peerjs\"` |\n| `--path` | `path` | Path (string). The server responds for requests to the root URL + path. **E.g.** Set the `path` to `/myapp` and run server on 9000 port via `peerjs --port 9000 --path /myapp` Then open http://127.0.0.1:9000/myapp - you should see a JSON reponse. | No | `\"/\"` |\n| `--proxied` | `proxied` | Set `true` if PeerServer stays behind a reverse proxy (boolean) | No | `false` |\n| `--expire_timeout, -t` | `expire_timeout` | The amount of time after which a message sent will expire, the sender will then receive a `EXPIRE` message (milliseconds). | No | `5000` |\n| `--alive_timeout` | `alive_timeout` | Timeout for broken connection (milliseconds). If the server doesn't receive any data from client (includes `pong` messages), the client's connection will be destroyed. | No | `60000` |\n| `--concurrent_limit, -c` | `concurrent_limit` | Maximum number of clients' connections to WebSocket server (number) | No | `5000` |\n| `--sslkey` | `sslkey` | Path to SSL key (string) | No |  |\n| `--sslcert` | `sslcert` | Path to SSL certificate (string) | No |  |\n| `--allow_discovery` | `allow_discovery` |  Allow to use GET `/peers` http API method to get an array of ids of all connected clients (boolean) | No |  |\n|  | `generateClientId` | A function which generate random client IDs when calling `/id` API method (`() => string`) | No | `uuid/v4` |\n\n## Using HTTPS\nSimply pass in PEM-encoded certificate and key.\n\n```javascript\nconst fs = require('fs');\nconst { PeerServer } = require('peer');\n\nconst peerServer = 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');\n\nconst peerServer = PeerServer({\n  port: 9000,\n  path: '/myapp',\n  proxied: true\n});\n```\n\n## Custom client ID generation\nBy default, PeerServer uses `uuid/v4` npm package to generate random client IDs.\n\nYou can set `generateClientId` option in config to specify a custom function to generate client IDs.\n\n```javascript\nconst { PeerServer } = require('peer');\n\nconst customGenerationFunction = () => (Math.random().toString(36) + '0000000000000000000').substr(2, 16);\n\nconst peerServer = PeerServer({\n  port: 9000,\n  path: '/myapp',\n  generateClientId: customGenerationFunction\n});\n```\n\nOpen http://127.0.0.1:9000/myapp/peerjs/id to see a new random id.\n\n## Combining with existing express app\n\n```javascript\nconst express = require('express');\nconst { ExpressPeerServer } = require('peer');\n\nconst app = express();\n\napp.get('/', (req, res, next) => res.send('Hello world!'));\n\n// =======\n\nconst server = app.listen(9000);\n\nconst peerServer = ExpressPeerServer(server, {\n  path: '/myapp'\n});\n\napp.use('/peerjs', peerServer);\n\n// == OR ==\n\nconst http = require('http');\n\nconst server = http.createServer(app);\nconst peerServer = ExpressPeerServer(server, {\n  debug: true,\n  path: '/myapp'\n});\n\napp.use('/peerjs', peerServer);\n\nserver.listen(9000);\n\n// ========\n```\n\nOpen the browser and check http://127.0.0.1:9000/peerjs/myapp\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## HTTP API\n\nRead [/src/api/README.md](src/api/README.md)\n\n## Running tests\n\n```sh\n$ npm test\n```\n\n## Docker\n\nWe have 'ready to use' images on docker hub:\nhttps://hub.docker.com/r/peerjs/peerjs-server\n\n\nTo run the latest image:  \n```sh\n$ docker run -p 9000:9000 -d peerjs/peerjs-server\n```\n\nYou can build a new image simply by calling:\n```sh\n$ docker build -t myimage https://github.com/peers/peerjs-server.git\n```\n\nTo run the image execute this:  \n```sh\n$ docker run -p 9000:9000 -d myimage\n```\n\nThis will start a peerjs server on port 9000 exposed on port 9000 with key `peerjs` on path `/myapp`.\n\nOpen your browser with http://localhost:9000/myapp It should returns JSON with name, description and website fields. http://localhost:9000/myapp/peerjs/id - should returns a random string (random client id)\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"}