高大上企业网站,网页制作代码大全,石家庄做外贸网站建设,长宁长沙网站建设js套件地址 https://github.com/muaz-khan/RTCMultiConnection
server套件地址 https://github.com/muaz-khan/RTCMultiConnection-Server
要解决的就是server代码的跨域问题
原装写法#xff1a; 解决写法#xff1a;
// 喜欢组合语法的自己组
const io new ioServer.S…js套件地址 https://github.com/muaz-khan/RTCMultiConnection
server套件地址 https://github.com/muaz-khan/RTCMultiConnection-Server
要解决的就是server代码的跨域问题
原装写法 解决写法
// 喜欢组合语法的自己组
const io new ioServer.Server(httpApp, {cors: {origin: *}
});io.on(connection, function(socket) {RTCMultiConnectionServer.addSocket(socket, config);// ----------------------// below code is optionalconst params socket.handshake.query;if (!params.socketCustomEvent) {params.socketCustomEvent custom-message;}socket.on(params.socketCustomEvent, function(message) {socket.broadcast.emit(params.socketCustomEvent, message);});
});ok齐活搞定不谢