zoukankan      html  css  js  c++  java
  • WEBRTC配置安装

    WEBRTC配置安装

    免费stun服务器
    stun.ekiga.net
    nat type: Symmetric
    local end: 0.0.0.0:63012
    public end: 117.159.6.115:46304

    stun.schlund.de
    117.159.6.115:32896

    117.159.6.115

    [root@localhost ~]# firewall-cmd --zone=public --add-port=5350/tcp --permanent
    success
    [root@localhost ~]# firewall-cmd --reload
    success
    [root@localhost ~]# systemctl restart firewalld

    turnserver -o -v -f -a -m 2 --max-bps=100000 --min-port=32355 --max-port=65535 --user=phz:1 -r phzled.cn -L 192.168.1.66

    turnserver -o -f -v -a -m 2 --max-bps=100000 --min-port=32355 --max-port=65535 --user=phz:1 -r phzled.cn -X 117.159.6.115/192.168.1.66 -X 117.159.6.115/192.168.1.66

    turnserver --no-auth --stun-only -v
    turnserver -v --user=zjf:1 --realm apprtc --no-stun
    stun/turn服务同时开启:turnserver -v --user=zjf:1 --realm apprtc
    /sbin/iptables -I INPUT -p tcp --dport 3478 -j ACCEPT
    /sbin/iptables -I INPUT -p tcp --dport 3479 -j ACCEPT
    /sbin/iptables -I INPUT -p tcp --dport 5349 -j ACCEPT
    /sbin/iptables -I INPUT -p tcp --dport 5350 -j ACCEPT

    config={"iceServers":[{"urls":["turn:192.168.1.66"],"username":"zjf","credential":"1"}],"iceTransportPolicy":"all","iceCandidatePoolSize":"0"}
    config={"iceServers":[{"urls":["stun:192.168.1.66"],"username":"","credential":""}],"iceTransportPolicy":"all","iceCandidatePoolSize":"0"}
    config={"iceServers":[{"urls":["turn:192.168.1.66"],"username":"zjf","credential":"1"},{"urls":["stun:192.168.1.66"],"username":"","credential":""}],"iceTransportPolicy":"all","iceCandidatePoolSize":"0"}

    建立连接的日志:
    第一步:创建本机的PeerConnection
    Created local peer connection object localConnection
    main.js:50 Created send data channel
    main.js:66 Created remote peer connection object remoteConnection
    第而不:获得本机的媒体信息sdp,为了向对方发offer
    main.js:113 Offer from localConnection
    v=0
    o=- 6842214109041335097 2 IN IP4 127.0.0.1
    s=-
    t=0 0
    a=group:BUNDLE 0
    a=msid-semantic: WMS
    m=application 9 UDP/DTLS/SCTP webrtc-datachannel
    c=IN IP4 0.0.0.0
    a=ice-ufrag:b7Wc
    a=ice-pwd:PubgL1+G4v2+/YtZIG51WQJs
    a=ice-options:trickle
    a=fingerprint:sha-256 B4:F5:75:B7:C7:09:49:E1:AF:8C:80:B5:C4:5E:BD:90:10:C1:72:AA:D4:E1:A8:75:94:19:02:BF:6A:BC:12:45
    a=setup:actpass
    a=mid:0
    a=sctp-port:5000
    a=max-message-size:262144

    第三步:对端收到offer后,携带自己的sdp进行应答answer
    main.js:122 Answer from remoteConnection
    v=0
    o=- 2820179291816102784 2 IN IP4 127.0.0.1
    s=-
    t=0 0
    a=group:BUNDLE 0
    a=msid-semantic: WMS
    m=application 9 UDP/DTLS/SCTP webrtc-datachannel
    c=IN IP4 0.0.0.0
    b=AS:30
    a=ice-ufrag:bx6n
    a=ice-pwd:pS0bo2Hys8gwD724KI5FTcW2
    a=ice-options:trickle
    a=fingerprint:sha-256 14:DA:D8:33:82:6E:B8:05:3F:17:58:6F:2E:FC:74:2C:8A:DE:5F:61:90:11:FF:31:76:DF:24:A8:21:93:B5:4E
    a=setup:active
    a=mid:0
    a=sctp-port:5000
    a=max-message-size:262144
    ----------媒体信息交换完成,走完协商第一步,开始交换网络信息--------------
    第四步:从ice服务器获得公网ip,发送给对端peer,
    main.js:140 remotePeerConnection ICE candidate: candidate:1613033416 1 udp 2113937151 c83d25f9-2ef3-43af-b124-18e2be66ce56.local 54362 typ host generation 0 ufrag bx6n network-cost 999
    main.js:140 localPeerConnection ICE candidate: candidate:1613033416 1 udp 2113937151 c83d25f9-2ef3-43af-b124-18e2be66ce56.local 54360 typ host generation 0 ufrag b7Wc network-cost 999
    2main.js:148 AddIceCandidate success.
    main.js:170 Send channel state is: open
    main.js:156 Receive Channel Callback
    main.js:185 Receive channel state is: open
    main.js:140 localPeerConnection ICE candidate: candidate:2992052952 1 udp 33562367 192.168.1.66 59877 typ relay raddr 192.168.1.233 rport 54360 generation 0 ufrag b7Wc network-cost 999
    main.js:140 localPeerConnection ICE candidate: (null)
    main.js:148 AddIceCandidate success.
    main.js:140 remotePeerConnection ICE candidate: candidate:2992052952 1 udp 33562367 192.168.1.66 51287 typ relay raddr 192.168.1.233 rport 54362 generation 0 ufrag bx6n network-cost 999
    main.js:140 remotePeerConnection ICE candidate: (null)
    3main.js:148 AddIceCandidate success.
    -----------网络信息交换完成---------------------------------

    参考
    https://www.jianshu.com/p/43957ee18f1a
    https://www.jianshu.com/p/915eab39476d
    http://www.51testing.com/html/89/n-3720989.html

  • 相关阅读:
    element-ui分页组件修改当前页current-page后current-change事件不触发
    使用element-ui 的table 组件 表格线条不对齐
    vue 禁止浏览器自带的后退功能
    echart 柱图的(层叠柱图和柱图)label只显示总数 ,折线图的legent上显示总数
    element-ui table组件,分别设置表头和表格内容的居中,自定义渲染
    vue-cli-3+element-ui 按需引入element-ui的配置
    今天使用ElementUI与vue-quill-editor的时候发现,富文本编辑框选项对齐出现了点问题。
    vue-router 切换页面的时候,页面没有请求,
    msvcp140.dll缺失解决办法
    CTF中RSA题目的pem文件处理
  • 原文地址:https://www.cnblogs.com/windlog/p/13592228.html
Copyright © 2011-2022 走看看