ThinkSSL🔒 一键申购 5分钟快速签发 30天无理由退款 购买更放心 广告
[TOC] > [github](https://github.com/webRTC-io/webRTC.io) ## 概述 客户端 ``` <video id="local" autoplay="autoplay"></video> <video id="remote" autoplay="autoplay"></video> <script src="/webrtc.io.js"></script> <script> // note: make sure hostname available to all connecting clients // (ie. probably not `localhost`) rtc.connect('ws://yourserveraddress:8001'); rtc.createStream({"video": true, "audio":false}, function(stream){ // get local stream for manipulation rtc.attachStream(stream, 'local'); }); rtc.on('add remote stream', function(stream){ // show the remote video rtc.attachStream(stream, 'remote'); }); // more rtc callbacks are available </script> ``` 服务器 ``` var webRTC = require('webrtc.io').listen(8001); ```