使用 Socket.IO 和 NodeJS 实现音频聊天

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29140037/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 18:32:50  来源:igfitidea点击:

Implementing Audio chat with Socket.IO and NodeJS

node.jssocket.iosails.jswebrtc

提问by Abhishek

I have created a chat application using sails.js(node.js) and socket.IO.

我已经使用sails.js( node.js) 和socket.IO.

I need to implement audio chatand file transfersalong with it.

我需要实施audio chatfile transfers随之实施。

Could anyone help me in getting basic tutorial links for integrating WebRTCwith socket.IO?

可在获得基础教程链接整合谁能帮我WebRTCsocket.IO

Thanks in advance.

提前致谢。

回答by peveuve

If I were you, I would use a WebRTC library providing both the client and the server side. Check EasyRTC, SimpleWebRTC, PeerJSor others. Most libraries are implemented in Javascript and run in Node.js.

如果我是你,我会使用提供客户端和服务器端的 WebRTC 库。检查EasyRTCSimpleWebRTCPeerJS或其他。大多数库都是用 Javascript 实现的,并在 Node.js 中运行。

You will find tutorials in their respective websites.

您可以在他们各自的网站上找到教程。

I personally use PeerJS, the code and documentation are both very good, and it fully supports data channels (useful for file transfer). The only thing is that there are only 2 founders, and the community seems quite small.

我个人使用PeerJS,代码和文档都非常好,并且完全支持数据通道(用于文件传输)。唯一的问题是只有2个创始人,社区似乎很小。

回答by Iqbal

I am also planning to make your kind of app on nodejs. During my research I found that WEBRTC support for mobile browsers is limited. In todays world whenever we are building a Web app we consider that a major portion of our users are going to use it on mobile phone. WebRtc is supported on android browsers like chrome, Firefox and opera. But on iPhone it doesn't support safari nor windows phone browsers. You should take a look at Wowza streaming cloud at https://www.wowza.com/docs/wowza-streaming-cloud-free-trial

我还计划在 nodejs 上制作您的那种应用程序。在我的研究中,我发现 WEBRTC 对移动浏览器的支持是有限的。在当今世界,每当我们构建 Web 应用程序时,我们都会考虑大部分用户将在手机上使用它。WebRtc 支持 chrome、Firefox 和 Opera 等安卓浏览器。但在 iPhone 上它不支持 safari 也不支持 windows 手机浏览器。您应该在https://www.wowza.com/docs/wowza-streaming-cloud-free-trial 上查看 Wowza 流媒体云