简体   繁体   English

WebRTC 上的信令通道

[英]Signaling channel on WebRTC

I am aiming to create a WebRTC chat (video/audio) application and most of tutorials and demos that I see are using the following signaling channel:我的目标是创建一个 WebRTC 聊天(视频/音频)应用程序,我看到的大多数教程和演示都使用以下信号通道:

signaling.simplewebrtc.com:8888

I even found this great demo, where the developer stated that it does not depend on this signaling channel, but when I went through the code I found it there.我什至发现了这个很棒的演示,开发人员说它不依赖于这个信号通道,但是当我浏览代码时我在那里找到了它。

Can someone explain me, how can I substitute this with my own signaling channel?有人可以解释一下,我如何用我自己的信令通道代替它?

I do not completely understand your question.我不完全理解你的问题。 I guess the URL you provided points to an websocket server.我猜你提供的 URL 指向一个 websocket 服务器。 Websockets are often used for signaling because they provide a permanent, full-duplex connection (this means that the server is able to push messages to the client without an previous request). Websockets 通常用于信令,因为它们提供永久的全双工连接(这意味着服务器能够在没有先前请求的情况下将消息推送到客户端)。

You have to exchange network information between the two parties who want to set up an RTCPeerConnection because of NAT and firewalls etc... How to exchange that information is not part of the WebRTC-specification.由于 NAT 和防火墙等,您必须在想要设置 RTCPeerConnection 的两方之间交换网络信息......如何交换该信息不是 WebRTC 规范的一部分。 You can use any protocol you want, HTTP,Websockets, even EMail (but that would be pretty ugly to implement :) ).您可以使用任何您想要的协议,HTTP、Websockets,甚至电子邮件(但实现起来会非常难看 :))。 But if you want to build your own signaling-server using node.js you can have a look at the tutorial I am currently writing.但是,如果您想使用 node.js 构建自己的信令服务器,您可以查看我目前正在编写的教程。 It explains in detail how to setup your own very simple video-chat using WebRTC and a Node-Server hosted on uberspace.de:它详细解释了如何使用 WebRTC 和托管在 uberspace.de 上的节点服务器来设置您自己的非常简单的视频聊天:

Tutorial: Create your own Videochat-Application with HTML and JavaScript 教程:使用 HTML 和 JavaScript 创建您自己的视频聊天应用程序

If you use my tutorial it would be great if you could tell me if it is understandable.如果您使用我的教程,如果您能告诉我它是否可以理解,那就太好了。

Edit: As I am still getting requests for this old tutorial, please use an up to date one like those: https://www.baeldung.com/webrtc编辑:由于我仍然收到对这个旧教程的请求,请使用像这样的最新教程: https : //www.baeldung.com/webrtc

https://www.html5rocks.com/en/tutorials/webrtc/basics/ https://www.html5rocks.com/en/tutorials/webrtc/basics/

Please take a look at this excellent blog on the signaling options that are available for WebRTC.请查看这篇关于可用于 WebRTC 的信号选项的优秀博客

I have listed a few important blogs and sample WebRTC applications that you might also want to review to help you build your chat application.列出了一些重要的博客和示例 WebRTC 应用程序,您可能还想查看它们以帮助您构建聊天应用程序。

  1. I installed nodejs from Install NodeJS along with the required dependencies at signalmaster我安装的NodeJS安装的NodeJS用在需要的依赖一起signalmaster
  2. Ran node server.js in cmd.在 cmd 中运行node server.js And server started running.服务器开始运行。

  3. PS: Change url option present in simplewebrtc.bundle.js PS:更改 simplewebrtc.bundle.js 中存在的 url 选项

Let me know if you face any problem如果您遇到任何问题,请告诉我

I wonder why no one has mentioned this so far .我想知道为什么到目前为止没有人提到这一点。 You can also use the sip framework based webrtc libraries and clients such as sipml5 , jssip etc .您还可以使用基于 sip 框架的 webrtc 库和客户端,例如 sipml5 、 jssip 等。 Additionally since you mentioned you would like your own server setup to cater to signalling requests , you will have a wide variety of websockets based sip servers to choose from such as officesip , kamailio , mobicents etc .此外,由于您提到您希望自己的服务器设置来满足信令请求,您将有多种基于 websockets 的 sip 服务器可供选择,例如 officeip、kamailio、mobicents 等。

您可以在https://code.google.com/p/sipservlets/wiki/HTML5WebRTCVideoApplication尝试修改 Mobicents 附带的最新应用程序,它允许您进行聊天和视频聊天。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM