好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

PeerJS

PeerJS 介绍

Peerjs 提供了 一个 完整、可配置、易于使用、基于WebRTC的点对点的数据通信。Peerjs是 一个 开源的JavaScript库,目的是允许运行在不同系统上的Web应用程序相互联系。Peerjs开发者称,Peerjs完善了WebRTC,因为作为视频连接协议,WebRTC并没有说明基于WebRTC的客户端应该如何定位连接的 用户 。

Peerjs有 一个 简单的API,允许通过三行 代码 来实现对等连接。PeerServer作为Peerjs的后端,这是 一个 基于Node.js的web服务器,这也是开源的。

Setup

Include the library

with npm: npm install peerjs and the usage:

import Peer from 'peerjs';

Create a Peer

const peer = new Peer('pick-an-id');

// You can pick your own id or omit the id if you want to get a random one from the server.

Data connections

Connect

const conn = peer.connect('another-peers-id');

conn.on('open',() => {

conn.send('hi!');

});

Receive

peer.on('connection',(conn) => {

conn.on('data',(data) => {

// Will print 'hi!'

console.log(data);

});

});

网站地址 : http://peerjs.com

GitHub: https://github.com/peers/peerjs/

网站描述: 一个 完整、可配置、易于使用、基于WebRTC的点对点API

PeerJS官方网站

官方网站: http://peerjs.com

如果觉得 网站内容还不错,欢迎将 网站 推荐给程序员好友。

查看更多关于PeerJS的详细内容...

  阅读:53次

上一篇

下一篇

第1节:thinkPHP    第2节:johnny-five    第3节:Yii    第4节:WePY    第5节:ShareDB    第6节:RxJS    第7节:d3-dag    第8节:egg-react-ssr    第9节:Deep playground    第10节:Guess.js    第11节:hyperapp    第12节:Avalon.js    第13节:Inferno    第14节:HTTPie    第15节:ITPUB    第16节:dva    第17节:Quasar    第18节:graphql-yoga    第19节:Next.js    第20节:IronJS    第21节:mpvue    第22节:react    第23节:marked.js    第24节:SAPUI5    第25节:Neuro.js    第26节:enyo.js    第27节:wire.js    第28节:ui-router    第29节:vuera    第30节:tether    第31节:Mootools    第32节:graphql.js    第33节:flex.css    第34节:bacon.js    第35节:react-move    第36节:Mithril.js    第37节:Sugar.js    第38节:tabris.js    第39节:snabbdom    第40节:vuesion    第41节:anujs    第42节:Nautil    第43节:rax    第44节:Stencil.js    第45节:dio    第46节:compromise    第47节:crypto.js    第48节:imba    第49节:alt.js    第50节:svelte    第51节:react-sortable-hoc    第52节:react-snap    第53节:Fortune.js    第54节:Qatrix    第55节:KaTeX    第56节:preactjs    第57节:Lisk    第58节:Vanilla JS    第59节:es4x    第60节:styled-components    第61节:JustAuth    第62节:html2canvas    第63节:backbone    第64节:ml.js    第65节:virtual-dom    第66节:nw.js    第67节:umbrella.js    第68节:Walt    第69节:MXFlutter    第70节:FileSaver.js    第71节:Rivets.js    第72节:way.js    第73节:Flight.js    第74节:react-static    第75节:rethinkdb    第76节:Chromeless    第77节:i18next    第78节:Choo    第79节:jsMind    第80节:knockout.js    第81节:nuxt.js    第82节:Mpx    第83节:Vue    第84节:Meteor.js    第85节:Towxml    第86节:vue-resource    第87节:DefinitelyTyped    第88节:Aurelia    第89节:jsrender    第90节:Dahlia    第91节:tfjs-core    第92节:is.js    第93节:immer.js    第94节:STDLib    第95节:angular-seed    第96节:Cube.js    第97节:SproutCore    第98节:vecty.js    第99节:Maquette    第100节:Redux    第101节:Javascript Fun    第102节:moon    第103节:Ember    第104节:react-redux    第105节:falcor    第106节:normalizr    第107节:Automerge    第108节:PapaParse    第109节:LokiJS    第110节:Megalo    第111节:Selection.js    第112节:react-router    第113节:Manta    第114节:ccxt    第115节:CloudBoost    第116节:cool-admin    第117节:Vapper    第118节:ramda    第119节:Scala.js    第120节:limejs    第121节:Senna.js    第122节:fuelux    第123节:emotion    第124节:eeui    第125节:Riot.js    第126节:HooX    第127节:linaria    第128节:Keras.js    第129节:worker-dom    第130节:vite    第131节:Mermaid    第132节:Chameleon    第133节:quicklink    第134节:lovli.js    第135节:localForage    第136节:Cycle.js    第137节:Konva.js    第138节:ConvNetJS    第139节:IPFS    第140节:angular-dart    第141节:DojotoolKit    第142节:InversifyJS    第143节:cash    第144节:react-motion    第145节:hox    第146节:KISSY    第147节:mind.js    第148节:Leaflet.js    第149节:Omi    第150节:vue-router    第151节:graphql-js    第152节:vue-rx    第153节:asm-dom    第154节:weui.js    第155节:react-server    第156节:togetherjs    第157节:Duktape    第158节:Zebkit    第159节:MontageJS    第160节:Underscore.js    第161节:CanJS    第162节:Tesseract.js    第163节:sheetjs    第164节:Rocket    第165节:construct-js    第166节:rrweb    第167节:Neataptic    第168节:Flux    第169节:aframe    第170节:ThingJS    第171节:Midway    第172节:webdnn    第173节:Brain.js    第174节:UmiJs(五米)    第175节:reactxp    第176节:TensorFlow.js    第177节:Kbone    第178节:relay    第179节:H-ui    第180节:AngularJS    第181节:after.js    第182节:Dojo    第183节:jsoneditor    第184节:react-360    第185节:truffle    第186节:ale.js    第187节:pico.js    第188节:PathFinding.js    第189节:NodeList.js    第190节:interact.js    第191节:Immutable.js    第192节:cell    第193节:QuoJS    第194节:zepto.js    第195节:flutter-desktop-embedding    第196节:fre.js    第197节:Razzle    第198节:ocLazyLoad    第199节:eventproxy    第200节:vuex    第201节:angularfire2    第202节:socket.io    第203节:SkateJS    第204节:polymer    第205节:Electron    第206节:Nerv    第207节:Mind elixir    第208节:PeerJS    第209节:React Router    第210节:joi    第211节:single-spa    第212节:workbox    第213节:san    第214节:apify-js    第215节:Bootstrap    第216节:Angular    第217节:QucikUI    第218节:Expressjs    第219节:ThinkJS    第220节:Nest JS    第221节:Laravel    第222节:CodeIgniter    第223节:Zend Framework    第224节:CakePHP    第225节:Symfony    第226节:StartMVC