封闭 LTE 网络内的本地眩晕服务器

local stun server inside a closed LTE network

首先,如果标题与描述不符,我们深表歉意。

我们在我们的组织中致力于 peer-peer 封闭 LTE 网络中的视频通信解决方案。为此,我们使用开源 webrtc 客户端 peerjs 及其本地 peerjs 服务器。服务器默认是指google stun server.

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?

我已经设置了一个开源的 stun 服务器[https://github.com/enobufs/stun]但是未能与客户端进行进一步的连接。

我按照 link 中提供的说明设置服务器。现在,我放置了 'local-ip-address:port' 而不是默认的 stun server ,并尝试在对等方之间建立连接。但它确实有效。

var configuration = { "iceServers": [{ "urls": "local-ip-address:port" }] };
pc = new RTCPeerConnection(configuration);

我是不是做错了? 请指导我。

提前致谢

Coturn 是非常受欢迎的 stun/turn 服务器,具有活跃的社区支持。 https://github.com/coturn/coturn/wiki/Downloads

提供的预构建包

您可以使用 sample demo

测试服务器

如果双方在同一网络中,则无需配置凭证之类的转弯内容。 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);