ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
[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); ```