首先,如果标题与描述不符,请道歉。
我们组织正在封闭的LTE网络中开展对等视频通信解决方案。为此,我们使用开源webrtc客户端peerjs及其本地peerjs服务器。默认情况下,服务器是指谷歌眩晕服务器。
1. Is stun server required in case of closed LTE network?
2. If yes, can we make use of a open source stun server which could run locally instead of the default one?
3. If no, what are the changes I would need to do?
我已经设置了一个开源眩晕服务器[https://github.com/enobufs/stun]但未能与客户端进一步建立连接。
我按照链接中提供的说明设置服务器。现在,而不是默认的stun服务器,我把' local-ip-address:port'并试图在同伴之间建立联系。但它有效。
var configuration = { "iceServers": [{ "urls": "local-ip-address:port" }] };
pc = new RTCPeerConnection(configuration);
我做错了吗? 请指导我。
提前致谢
答案 0 :(得分:0)
Coturn is very popular stun/turn server with active community support. Pre-built packages available at https://github.com/coturn/coturn/wiki/Downloads
You can test the server with sample demo
If both the parties are in same network, then no need to configure turn stuff like credentials. Read more
Configuring the peerConnection:
STUN server: //server_ip is coturn instance ip should be reachable from clients
var iceServers= [{"url": "stun:server_ip:port"}];
or TURN server:
var iceServers= [{"url":["turn:server_ip:port"],"username":"turn_username","credential":"turn_password"}];
var pc_config = {"iceServers": iceServers};
var pc_constraints = {
"optional": [{"DtlsSrtpKeyAgreement": true}]
};
pc = new RTCPeerConnection(pc_config, pc_constraints);