LAN上的Android WebRTC:仅将候选127.0.0.1发送到信令服务器

时间:2019-03-16 08:48:56

标签: android localhost webrtc lan libjingle

我正在尝试创建一个基于WebRTC的 Android视频聊天应用程序,以便在本地网络上进行部署。设置很简单:在同一局域网(Ethernet)上有2个Android终端和1个Linux服务器。没有STUN或TURN服务器。仅主机候选者和信令服务器(HTTP + WS)。

试图比较两个版本,我意识到发送到信令服务器的候选者列表是:

  • 每个网络接口使用libjingle版本的候选人
  • 只有127.0.0.1和::: 1(带有google-webrtc版本)

这似乎是由于在两者之间引入了称为Trickle ICE的WebRTC机制。而且我不知道如何配置WebRTC来声明与我的本地网络接口相对应的候选对象。

是否有WebRTC Android SDK的API允许我这样做?

谢谢!

PS:发送到信令服务器的候选者列表。

使用libjingle-9127

{"type":"candidate","payload":{"label":0,"id":"audio","candidate":"candidate:2316705582 1 udp 2122260223 192.168.237.1 34869 typ host generation 0"},"from":"-Dl0-BWMLUwmKvvcAAAD"}]

,{"type":"candidate","payload":{"label":1,"id":"video","candidate":"candidate:2316705582 1 udp 2122260223 192.168.237.1 34869 typ host generation 0"},"from":"-Dl0-BWMLUwmKvvcAAAD"}]

,{"type":"candidate","payload":{"label":1,"id":"video","candidate":"candidate:2316705582 1 udp 2122260223 192.168.237.1 34869 typ host generation 0"},"from":"-Dl0-BWMLUwmKvvcAAAD"}]

,{"type":"candidate","payload":{"label":0,"id":"audio","candidate":"candidate:3614478314 1 udp 2122194687 172.17.84.124 52163 typ host generation 0"},"from":"-Dl0-BWMLUwmKvvcAAAD"}]

,{"type":"candidate","payload":{"label":1,"id":"video","candidate":"candidate:3614478314 1 udp 2122194687 172.17.84.124 52163 typ host generation 0"},"from":"-Dl0-BWMLUwmKvvcAAAD"}]

,{"type":"candidate","payload":{"label":0,"id":"audio","candidate":"candidate:1846788752 1 udp 2122129151 172.17.116.134 45915 typ host generation 0"},"from":"-Dl0-BWMLUwmKvvcAAAD"}]

,{"type":"candidate","payload":{"label":1,"id":"video","candidate":"candidate:1846788752 1 udp 2122129151 172.17.116.134 45915 typ host generation 0"},"from":"-Dl0-BWMLUwmKvvcAAAD"}]

,{"type":"candidate","payload":{"label":0,"id":"audio","candidate":"candidate:13699457 1 udp 2122063615 10.11.239.176 51039 typ host generation 0"},"from":"-Dl0-BWMLUwmKvvcAAAD"}]

,{"type":"candidate","payload":{"label":1,"id":"video","candidate":"candidate:13699457 1 udp 2122063615 10.11.239.176 51039 typ host generation 0"},"from":"-Dl0-BWMLUwmKvvcAAAD"}]

,{"type":"candidate","payload":{"label":0,"id":"audio","candidate":"candidate:3298157534 1 tcp 1518280447 192.168.237.1 36295 typ host tcptype passive generation 0"},"from":"-Dl0-BWMLUwmKvvcAAAD"}]

,{"type":"candidate","payload":{"label":1,"id":"video","candidate":"candidate:3298157534 1 tcp 1518280447 192.168.237.1 36295 typ host tcptype passive generation 0"},"from":"-Dl0-BWMLUwmKvvcAAAD"}]

,{"type":"candidate","payload":{"label":0,"id":"audio","candidate":"candidate:2582868762 1 tcp 1518214911 172.17.84.124 44376 typ host tcptype passive generation 0"},"from":"-Dl0-BWMLUwmKvvcAAAD"}]

,{"type":"candidate","payload":{"label":1,"id":"video","candidate":"candidate:2582868762 1 tcp 1518214911 172.17.84.124 44376 typ host tcptype passive generation 0"},"from":"-Dl0-BWMLUwmKvvcAAAD"}]

,{"type":"candidate","payload":{"label":0,"id":"audio","candidate":"candidate:546324064 1 tcp 1518149375 172.17.116.134 41308 typ host tcptype passive generation 0"},"from":"-Dl0-BWMLUwmKvvcAAAD"}]

使用google-webrtc-1.0.26405

03-15 18:29:47.008  2318  2347 D RoomRTCClient: GAE->C #1 : {"type":"candidate","label":0,"id":"0","candidate":"candidate:1510613869 1 udp 2121932543 127.0.0.1 58474 typ host generation 0 ufrag rhKZ network-id 4"}

03-15 18:29:47.009  2318  2347 D RoomRTCClient: GAE->C #2 : {"type":"candidate","label":0,"id":"0","candidate":"candidate:559267639 1 udp 2122005759 ::1 46169 typ host generation 0 ufrag rhKZ network-id 5"}

0 个答案:

没有答案