不急不徐,持之以恒。

          http://blog.gopersist.com/

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            24 隨筆 :: 0 文章 :: 52 評論 :: 0 Trackbacks
          在使用WebRTC進行即時通訊時,需要使瀏覽器進行P2P通訊,但是由于NAT環境的復雜性,并不是所有情況下都能進行P2P,這時需要TURN Server來幫助客戶端之間轉發數據。rfc5766-turn-server是一個高性能的開源TURN Server實現。
          以下是在EC2上使用Ubuntu操作系統安裝rfc5766-turn-server:
          1. 下載安裝包:
          $ wget http://ftp.cn.debian.org/debian/pool/main/r/rfc5766-turn-server/rfc5766-turn-server_3.2.4.4-1_amd64.deb
          2. 安裝:
          $ sudo apt-get update
          $ sudo apt-get install gdebi-core
          $ sudo gdebi rfc5766-turn-server_3.2.4.4-1_amd64.deb
          安裝完后,在/usr/share/doc/rfc5766-turn-server下有很多文檔可參考。
          3. 配置:
          $ sudo vi /etc/turnserver.conf
          ---------------------------------------
          // 配置IP,EC2下需要配置listening-ip和external-ip
          listening-ip=172.31.4.37
          external-ip=54.223.149.60
          // 當TURN Server用于WebRTC時,必須使用long-term credential mechanism
          lt-cred-mech
          // 增加一個用戶
          user=username1:password1
          // 設定realm
          realm=mycompany.org
          ---------------------------------------
          4. 啟動:
          sudo turnserver -c /etc/turnserver.conf --daemon
          5. 服務啟動后,在上一個WebRTC示例中更改iceServers后測試:
          "iceServers": [{
              "url": "stun:stun.l.google.com:19302"
          }, {
              "url": "turn:54.223.149.60",
              "username": "username1",
              "credential": "password1"
          }]
          更多安裝信息在:http://turnserver.open-sys.org/downloads/v3.2.4.4/INSTALL
          rfc5766-turn-server當然也有STUN Server的能力,但是需要給它配置2個IP,以幫助探測客戶端所在NAT環境的行為,這里沒有做。
          posted on 2014-10-22 14:23 老林 閱讀(8399) 評論(3)  編輯  收藏 所屬分類: 即時通訊(IM)

          評論

          # re: Ubuntu下安裝TURN Server (rfc5766-turn-server) 2014-12-06 12:05 莫非
          不需要配置兩個 ip吧~!  回復  更多評論
            

          # 12321 2015-02-16 21:45 23
          大華股份胡椒粉v個會  回復  更多評論
            

          # re: Ubuntu下安裝TURN Server (rfc5766-turn-server) 2015-06-18 17:09 frostmourner

          @莫非
          求指導  回復  更多評論
            

          主站蜘蛛池模板: 新河县| 郧西县| 庆城县| 卓资县| 卫辉市| 新兴县| 顺昌县| 墨江| 商水县| 兴隆县| 临桂县| 霍州市| 江山市| 梅州市| 定日县| 大城县| 晋城| 台安县| 灌南县| 万安县| 兴山县| 赣州市| 平阴县| 汤原县| 徐州市| 兴隆县| 巩留县| 九寨沟县| 西林县| 蒙阴县| 卢湾区| 梁河县| 舟山市| 布拖县| 安乡县| 玛纳斯县| 景东| 新巴尔虎右旗| 河间市| 五莲县| 卓尼县|