WEBRTC Start-APPRTC Server Setup

Source: Internet
Author: User
Tags stunnel

Introduction APPRTC is what, webrtc.org official Experience App Ingredients: ubuntu14.04, other Linux versions are not limited, the official does not specify Chrome M51+stunnle Https://www.stunnel.org/ind Ex.htmlrfc5766-turn-server https://code.google.com/archive/p/rfc5766-turn-server/Google App Engine SDK for Pythonapp RTC HTTPS://GITHUB.COM/WEBRTC/APPRTC steps: Set up proxyBecause of the particularity of the domestic network, this step is very important, if there is no reliable agent, it is likely to end in failure.     Set the agent for the shell environment to add the following to ~/.bashrcexport Http_proxy=http://10.xx.xx.xx:100export https_proxy=http://10.xx.xx.xx:100 Set git proxy to add the following to ~/.gitconfig[http] Proxy = http://10.xx.xx.xx:100 sslverify = False[https] Proxy = http://10.xx.xx.xx:100 Install Google App Engine SDK for Python Https://cloud.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python download, unzip. Recommended to be stored in and APPRTC sibling directory ├──code│├── Google_appengine│├──apprtc Installing APPRTCDownload APPRTC source git clone https://github.com/webrtc/apprtc.git recommended to be stored in the Google_appengine sibling directory ├──code│├──google_appengine│├─ ─apprtc Installing NPMThe following excerpt from [1], if the agent is set up, these steps can successfully complete the Install grunt by first installing NPM. NPM is distributed as part of Nodejs. sudo apt-get install nodejssudo npm install-g npm on Ubuntu 14.04 the default packages installs /usr/bin/nodejsBut the /usr/bin/nodeExecutable is required for grunt. This was installed on some Ubuntu package sets; If it is a missing, you can add this by installing the nodejs-legacyPackage sudo apt-get install nodejs-legacyIt is easiest to install a shared version of grunt-cliFrom npmUsing the -gFlag. This would allow you access the gruntcommand from /usr/local/bin. More information can is found on gruntjsGetting Started. sudo npm -g install grunt-cli

Omitting the flag would install to the current -g grunt-cli directory under the node_modules directory.

Finally, you'll want to install grunt and required grunt dependencies. This can is done from any directory under your checkout of the WEBRTC/APPRTC repository. npm install

On Ubuntu, you'll also need to install the WebTest package:

sudo apt-get install python-webtest compiling APPRTC sudo grunt build --forceEach update modification code should be recompiled, and the compiled generated files are stored in the Out directory Run APPRTCSudo.. /google_appengine//dev_appserver.py./out/app_engine--host 0.0.0.0 Installing Rfc5766-turn-serversudo app-get install rfc5766-turn-server configuration Editor/etc/ trunserver.conf ensure that the following lines of comments are open, and given the correct values, Port,ip value of course to fill in the actual situation, static-auth-secret=4080218913 best not change to other values, Because APPRTC hard code this value, unless you also modify the corresponding place in the APPRTC. realm=cn.cn This no request, fill in their own domain name can. Verbose is not required, open it just so that you can see more output. 18:listening-port=900052:listening-ip=10.58.60.23697:relay-ip=10.58.60.236154:verbose203:use-auth-secret211: static-auth-secret=4080218913289:realm=cn.cn446: Production Certificate?  apprtc git: (RESTAPI)? OpenSSL req-x509-newkey rsa:2048-keyout key.pem-out cert.pem-days 99999-nodesgenerating a 2048 bit RSA private key: ..... +++....................................................+++writing new private key to ' KEY.PEM '-----You is about to is asked to enter information that'll be incorporatedinto your certificate request. What's about-to-enter is called a distinguished Name or a DN. There is quite a few fields but can leave some blankfor some fields there would be a default value,if you enter '. ', t He field would be a left blank.-----Country Name (2 letter code) [Au]:cnstate or province name (full name) [Some-state]:cnloc ality name (eg, city) []:cnorganization name (eg, company) [Internet widgits Pty ltd]:cnorganizational Unit Name (eg, sect ION) []:cncommon name (e.g. server FQDN or YOUR name) []:cnemail Address []:cn  The generation process prompted several times to enter some information, you can just fill in a minute.   Install the generated CERT.PEM and KEY.PEM into the/cert/directory, why put it in this directory, because Collidermain hard-coded to read the following two files.Not put here means to modify the code in the Collidermain, in order to save the trouble, for the moment, along its way. "/cert/cert.pem" "/cert/key.pem"     Installing Stunnlesudo app-get install rfc5766-turn-server configuration edit/usr/local/etc/stunnel/stunnel.conf Add the following [apprtc_main]accept = 443connect = 8080cert =/cert/cert.pem [apprtc_auth]accept = 4431connect = 8081cert =/cert/cert.pem   Installing Golangsudo app-get install Golang compiling the signalingExport gopath=$ (shell pwd) go build-o collidermain src/collider/collidermain/main.go in the APPRTC directory Compile Rfc5766-turn-server Licensing service: Apprtc_turn_authAuthorized Services I did not find the source code, so need to write their own, here to share the author Golang version of the code. Https://github.com/vc60er/apprtc_turn_auth/blob/master/auth.go compiled as follows export gopath=$ (shell pwd) go build-o auth Auth.go to modify the code in APPRTCMake the following changes to APPRTC/SRC, but the IP address should be filled according to the actual situation. The essential step after the modification is to recompile, and don't forget.  diff--git a/src/app_engine/apprtc.py b/src/app_engine/apprtc.pyindex dbe9d84. 2acc179 100755---a/src/app_engine/apprtc.py+++ b/src/app_engine/apprtc.py@@ -292,6 +292,7 @@ def get_room_parameters ( Request, room_id, client_id, is_initiator):    if room_id is not none:     room_link = Reque St.host_url + '/r/' + room_id+    Room_link = room_link.replace ("http", "https")      room_link = Append_url_arguments (Request, Room_link)      params[' room_id '] = room_id     params[' Room_link '] = Room_linkdiff--git a/src/app_engine/constants.py b/src/app_engine/constants.pyindex 430a7a2. 7d4dd73 100644---a/src/app_engine/constants.py+++ b/src/app_engine/constants.py@@ -16,8 +16,8 @@ turn_base_url = ' https://computeengineondemand.appspot.com '  turn_url_template = '%s/turn?username=%s&key=%s '  ceod_ KEY = ' 4080218913 '  -ice_server_base_url = 'https://networktraversal.googleapis.com '-ice_server_url_template = '%s/v1alpha/iceconfig?key=%s ' +ice_server_base _url = ' https://10.58.60.236:4431 '     # ' https://networktraversal.googleapis.com ' +ice_server_url_template = '%s/turn?key=%s '              # '%s/v1alpha/iceconfig?key=%s '  ice_server_api_ KEY = Os.environ.get (' Ice_server_api_key ')   # Dictionary keys in the collider instance info constant.@@ -25,13 + 25,13 @@ wss_instance_host_key = ' host_port_pair '  wss_instance_name_key = ' vm_name '  WSS_INSTANCE_ZONE_KEY = ' zone '  wss_instances = [{-    wss_instance_host_key: ' apprtc-ws.webrtc.org:443 ',+    WSS_ Instance_host_key: ' 10.58.60.236:4432 ',   # ' apprtc-ws.webrtc.org:443 ',     WSS_INSTANCE_ Name_key: ' wsserver-std ',     wss_instance_zone_key: ' Us-central1-a '-}, {-    WSS_INSTANCE_ Host_key: ' apprtc-ws-2.webrtc.org:443 ',-    Wss_instance_namE_key: ' wsserver-std-2 ',-    wss_instance_zone_key: ' Us-central1-f ' +#}, {+#     wss_instance _host_key: ' apprtc-ws-2.webrtc.org:443 ',+#     wss_instance_name_key: ' Wsserver-std-2 ',+#     wss_instance_zone_key: ' us-central1-f '  }]  wss_host_port_pairs = [ins[WSS_INSTANCE_ Host_key] for ins in Wss_instances]diff--git a/src/collider/collidermain/main.go b/src/collider/collidermain/ Main.goindex A499ada. 5E164DD 100644---a/src/collider/collidermain/main.go+++ b/src/collider/collidermain/main.go@@ -6,7 +6,7 @@  Package Main  import (-    "Collider" +    "Collider/collider"       "Flag" & nbsp     "Log"  )?  APPRTC git: (RESTAPI)?    Finally, because the whole process is too cumbersome, the author wrote Makefile in the course of the experiment, now also shared. This makefile in the commissioning process of the lack of a lot of convenience, do not have to knock a bunch of orders each time.  Almost all of the above compiled, run operations, with this file just make xxx on the line? APPRTC git: (RESTAPI)? Cat MAKEFILEALL:APPRTC Auth Collidermain APPRTC:   sudo grunt build --force auth:auth.go env    Go build-o auth auth.go collidermain:src/collider/collidermain/main.go env& nbsp   Go build-o collidermain src/collider/collidermain/main.go clean:    RM auth env:    Export gopath=$ (shell pwd)  test_auth:    Curl http://localhost:8081/turn    Curl http:/ /localhost:8081/v2/turn  run_apprtc:    sudo: /google_appengine//dev_appserver.py./out/app_engine--host 0.0.0.0    2>&1 | Tee app.log run_auth:    sudo./auth-port 8081 run_collidermain:    sudo./collidermain- Port 4432-room-server http://localhost:8080 2>&1 | Tee collider.log run_stunnel:    sudo stunnel run_turnserver:    sudo turnserver & nbsp;. Phony:all Test Clean APPRTC env     Experience   Reference article      [1].HTTPS://GITHUB.COM/WEBRTC /apprtc   not finished ...

WEBRTC Start-APPRTC Server Setup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.