美文网首页WebRTC
SkyRTC Configuration on Ubuntu 1

SkyRTC Configuration on Ubuntu 1

作者: 等流心0316 | 来源:发表于2017-04-19 13:34 被阅读0次

Reference http://www.cnblogs.com/wunaozai/p/5520084.html

Step 0 Preparation

  1. make sure you are the root user
  2. apt-get update and apt-get upgrade
  3. make sure git is installed in your Ubuntu. If not, run apt-get install git
  4. make a directory such as mkdir /sky wherever you like.

Step 1 Install Signaling Server

  1. cd /sky
  2. apt-get install nodejs npm
  3. git clone https://github.com/LingyuCoder/SkyRTC-demo
  4. cd SkyRTC-demo
  5. npm install

Step 2 Install Coturn Server

  1. cd /sky
  2. git clone https://github.com/coturn/coturn
  3. cd coturn
  4. ./configure
  5. make
  6. make install

Step 3 Modify Client Configuration

  1. cd /sky/SkyRTC-demo/public
  2. nano SkyRTC-client.js
  3. modify iceServers configuration like
    var iceServer = {
        "iceServers": [
        {
           url: "stun:(you server name, such as 120.120.120.120)"
        },
        {
            url: "turn:(you server name, such as 120.120.120.120)",
            credential:'(set a psw you like)',
            username:'(set your username)'
        }
        ]
    };
  1. cd /sky/coturn/examples/etc and cp turnserver.conf turnserver.conf.bak for file backup, then run nano turnserver.conf, change all the content to
    listening-device=eth1
    listening-ip=(you server name, such as 120.120.120.120)
    min-port=59000
    max-port=65000
    relay-device=eth1
    relay-ip=(you server name, such as 120.120.120.120)
    Verbose
    fingerprint
    lt-cred-mech
    use-auth-secret
    static-auth-secret=4080218913
    stale-nonce
    realm=(you server name, such as 120.120.120.120)
    cert=/sky/coturn/examples/etc/turn_server_cert.pem (you may change this directory)
    pkey=/sky/coturn/examples/etc/turn_server_pkey.pem (you may change this directory)
    no-loopback-peers
    no-multicast-peers
    mobility
    no-cli

Step 4 Start Service

  1. cd /sky/coturn/examples/etc and run the followings to start coturn server (replace username and credential by what you set in step 3)
turnserver -o -a -f -v --mobility -m 10 --max-bps=100000 --min-port=32355 --max-port=65535 --user=(username):(credential) -r demo
  1. cd /sky/SkyRTC-demo and run nodejs server.js to start signaling server and room server

Step 5 Enjoy WebRTC

  1. open your browser and enter
    http://(you server name, such as 120.120.120.120):3000#(rommId)
    for example
    http://120.120.120.120:3000#myroom
    and open another browser tab enter the same URL.

note: Firefox and 360 explorer (Chrome mode) are recommended.

  1. you will see some output messages in your terminal, and you can try some other functions like file sharing provided by SkyRTC.

相关文章

网友评论

    本文标题:SkyRTC Configuration on Ubuntu 1

    本文链接:https://www.haomeiwen.com/subject/utaczttx.html