WebRTC 服务器 Java 实现
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25058897/
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
WebRTC Server Java implementation
提问by javagc
I am starter in WebRTC , I want to create simple application with call, but i can not understand what is the server? Is the WebSocket enough? or I need other server?
我是 WebRTC 的初学者,我想通过调用创建简单的应用程序,但我不明白服务器是什么?WebSocket 就够了吗?或者我需要其他服务器?
my scenario is very simple two chrome users A
and B
, A
call B
我的方案是非常简单的双镀铬的用户A
和B
,A
呼B
采纳答案by jakub.petr
It depends on your application but you probably want to use server for signaling. The browsers are after establishing session connected peer-to-peer. (it isn't going through your server)
这取决于您的应用程序,但您可能希望使用服务器进行信令。浏览器在建立会话后建立对等连接。(它不会通过您的服务器)
For more detail http://www.html5rocks.com/en/tutorials/webrtc/basics/.
有关更多详细信息,请访问 http://www.html5rocks.com/en/tutorials/webrtc/basics/。
回答by HelloNicole
Agree you will probably need a server for signaling. My company OnSIP offers a hosted solution for this, so you would not need to manage servers, but whether you decide to or not - here is an explainer vid on signaling & why you'll need it. Rather than write an explanation here, I'm just going to link it:
同意您可能需要一个服务器来发送信号。我的公司 OnSIP 为此提供了一个托管解决方案,因此您不需要管理服务器,但无论您决定与否 - 这里有一个关于信号的解释视频以及您为什么需要它。与其在这里写解释,我只想链接它:
https://www.youtube.com/watch?v=-waKd_edBGw
https://www.youtube.com/watch?v=-waKd_edBGw
Also, if you intend to run an application that reliably sets up calls 90%+ time, you'll also need media relay (TURN) servers. This is to handle NAT and firewall traversal, which can mess with P2P call setup in real life networking situations as the endpoints have private IP addresses. Media relay servers have a public IP address and literally relay the media stream. These require a lot of bandwidth to run—?I don't believe any cloud hosting service will suffice. Again, my company offers this as part of a hosted solution with simple APIs. It is doable to do this all on your own.
此外,如果您打算运行一个应用程序来可靠地建立呼叫 90% 以上的时间,您还需要媒体中继 (TURN) 服务器。这是为了处理 NAT 和防火墙穿越,在现实生活中的网络情况下,由于端点具有私有 IP 地址,这可能会干扰 P2P 呼叫设置。媒体中继服务器有一个公共 IP 地址,可以直接中继媒体流。这些需要大量带宽才能运行——我认为任何云托管服务都不够。同样,我的公司将其作为具有简单 API 的托管解决方案的一部分提供。自己做这一切是可行的。
Competitive services that handle signaling & media relay & provide developer APIs: EasyRTC & TokBox.
处理信令和媒体中继并提供开发人员 API 的竞争服务:EasyRTC 和 TokBox。