Skip to content

Instantly share code, notes, and snippets.

@bfgits
Last active April 28, 2017 08:33
Show Gist options
  • Save bfgits/c0f847d3230f10a9fec83b5b82d63f22 to your computer and use it in GitHub Desktop.
Save bfgits/c0f847d3230f10a9fec83b5b82d63f22 to your computer and use it in GitHub Desktop.
webrtc setup

webrtc 配置过程

webrtc github URL

dev environment初步配置 (20170427)

  1. Install google sdk for python

    Google Cloud SDK Documentation

    测试机器为Ubuntu 16.04.2

    1.1 Create an environment variable for the correct distribution:

     export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
    

    1.2 Add the Cloud SDK distribution URI as a package source:

     echo "deb https://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
    

    1.3 Import the Google Cloud public key:

     curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
    

    1.4 Update and install the Cloud SDK:

     sudo apt-get update && sudo apt-get install google-cloud-sdk
    

    1.5 Install google cloud sdk app engine python

     sudo apt install google-cloud-sdk-app-engine-python
    

    1.6 Install google cloud sdk app engine java

     sudo apt install google-cloud-sdk-app-engine-java
    

    1.7 Install python requests module

     pip install requests
    
  2. Install Node.js 6x on Debian and Ubuntu based Linux distribution

    2.1 Install nodejs: Installing Node.js via package manager

     curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
     sudo apt-get install -y nodejs
    

    2.2 Install grunt: install Grunt's CLI globally

     npm install -g grunt-cli
    
  3. compare webrtc demo service

    3.1 Get git files and run service

     git clone https://github.com/webrtc/apprtc.git
     cd apprtc/
     grunt build
     /usr/lib/google-cloud-sdk/platform/google_appengine/dev_appserver.py --host 0.0.0.0 ./out/app_engine
    

    3.2 Then navigate to http://<server_ip:8080> in your browser

    3.3 dev_appserver.py usage:

    
     usage: dev_appserver.py [-h] [-A APP_ID] [--host HOST] [--port PORT]
                         [--admin_host ADMIN_HOST] [--admin_port ADMIN_PORT]
                         [--auth_domain AUTH_DOMAIN] [--storage_path PATH]
                         [--log_level {debug,info,warning,critical,error}]
                         [--max_module_instances MAX_MODULE_INSTANCES]
                         [--use_mtime_file_watcher [USE_MTIME_FILE_WATCHER]]
                         [--threadsafe_override THREADSAFE_OVERRIDE]
                         [--php_executable_path PATH]
                         [--php_remote_debugging [PHP_REMOTE_DEBUGGING]]
                         [--php_gae_extension_path PATH]
                         [--php_xdebug_extension_path PATH]
                         [--appidentity_email_address APPIDENTITY_EMAIL_ADDRESS]
                         [--appidentity_private_key_path APPIDENTITY_PRIVATE_KEY_PATH]
                         [--python_startup_script PYTHON_STARTUP_SCRIPT]
                         [--python_startup_args PYTHON_STARTUP_ARGS]
                         [--jvm_flag JVM_FLAG] [--go_work_dir GO_WORK_DIR]
                         [--custom_entrypoint CUSTOM_ENTRYPOINT]
                         [--runtime RUNTIME] [--blobstore_path BLOBSTORE_PATH]
                         [--mysql_host MYSQL_HOST] [--mysql_port MYSQL_PORT]
                         [--mysql_user MYSQL_USER]
                         [--mysql_password MYSQL_PASSWORD]
                         [--mysql_socket MYSQL_SOCKET]
                         [--datastore_path DATASTORE_PATH]
                         [--clear_datastore [CLEAR_DATASTORE]]
                         [--datastore_consistency_policy {consistent,random,time}]
                         [--require_indexes [REQUIRE_INDEXES]]
                         [--auto_id_policy {sequential,scattered}]
                         [--logs_path LOGS_PATH]
                         [--show_mail_body [SHOW_MAIL_BODY]]
                         [--enable_sendmail [ENABLE_SENDMAIL]]
                         [--smtp_host SMTP_HOST] [--smtp_port SMTP_PORT]
                         [--smtp_user SMTP_USER]
                         [--smtp_password SMTP_PASSWORD]
                         [--smtp_allow_tls [SMTP_ALLOW_TLS]]
                         [--search_indexes_path SEARCH_INDEXES_PATH]
                         [--clear_search_indexes [CLEAR_SEARCH_INDEXES]]
                         [--enable_task_running [ENABLE_TASK_RUNNING]]
                         [--allow_skipped_files [ALLOW_SKIPPED_FILES]]
                         [--api_port API_PORT] [--grpc_api GRPC_APIS]
                         [--grpc_api_port GRPC_API_PORT]
                         [--automatic_restart [AUTOMATIC_RESTART]]
                         [--dev_appserver_log_level {debug,info,warning,critical,error}]
                         [--skip_sdk_update_check [SKIP_SDK_UPDATE_CHECK]]
                         [--default_gcs_bucket_name DEFAULT_GCS_BUCKET_NAME]
                         [--env_var ENV_VARIABLES]
                         [--google_analytics_client_id GOOGLE_ANALYTICS_CLIENT_ID]
                         [--google_analytics_user_agent GOOGLE_ANALYTICS_USER_AGENT]
                         yaml_or_war_path [yaml_or_war_path ...]
    
     
  4. WebRTC servers instruction

    WebRTC in the real world: STUN, TURN and signaling

    WebRTC still needs servers:

    • For clients to exchange metadata to coordinate communication: this is called signaling.
    • To cope with network address translators (NATs) and firewalls.

    Real time communication with WebRTC

webrtc 配置过程

webrtc github URL

dev environment初步配置 (20170427)

  1. Install google sdk for python

    Google Cloud SDK Documentation

    测试机器为Ubuntu 16.04.2

    1.1 Create an environment variable for the correct distribution:

     export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
    

    1.2 Add the Cloud SDK distribution URI as a package source:

     echo "deb https://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
    

    1.3 Import the Google Cloud public key:

     curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
    

    1.4 Update and install the Cloud SDK:

     sudo apt-get update && sudo apt-get install google-cloud-sdk
    

    1.5 Install google cloud sdk app engine python

     sudo apt install google-cloud-sdk-app-engine-python
    

    1.6 Install google cloud sdk app engine java

     sudo apt install google-cloud-sdk-app-engine-java
    

    1.7 Install python requests module

     pip install requests
    
  2. Install Node.js 6x on Debian and Ubuntu based Linux distribution

    2.1 Install nodejs: Installing Node.js via package manager

     curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
     sudo apt-get install -y nodejs
    

    2.2 Install grunt: install Grunt's CLI globally

     npm install -g grunt-cli
    
  3. compare webrtc dev service

    3.1 Get git files and run service

     git clone https://github.com/webrtc/apprtc.git
     cd apprtc/
     grunt build
     /usr/lib/google-cloud-sdk/platform/google_appengine/dev_appserver.py --host 0.0.0.0 ./out/app_engine
    

    3.2 Then navigate to http://<server_ip:8080> in your browser

    3.3 dev_appserver.py usage:

    
     usage: dev_appserver.py [-h] [-A APP_ID] [--host HOST] [--port PORT]
                         [--admin_host ADMIN_HOST] [--admin_port ADMIN_PORT]
                         [--auth_domain AUTH_DOMAIN] [--storage_path PATH]
                         [--log_level {debug,info,warning,critical,error}]
                         [--max_module_instances MAX_MODULE_INSTANCES]
                         [--use_mtime_file_watcher [USE_MTIME_FILE_WATCHER]]
                         [--threadsafe_override THREADSAFE_OVERRIDE]
                         [--php_executable_path PATH]
                         [--php_remote_debugging [PHP_REMOTE_DEBUGGING]]
                         [--php_gae_extension_path PATH]
                         [--php_xdebug_extension_path PATH]
                         [--appidentity_email_address APPIDENTITY_EMAIL_ADDRESS]
                         [--appidentity_private_key_path APPIDENTITY_PRIVATE_KEY_PATH]
                         [--python_startup_script PYTHON_STARTUP_SCRIPT]
                         [--python_startup_args PYTHON_STARTUP_ARGS]
                         [--jvm_flag JVM_FLAG] [--go_work_dir GO_WORK_DIR]
                         [--custom_entrypoint CUSTOM_ENTRYPOINT]
                         [--runtime RUNTIME] [--blobstore_path BLOBSTORE_PATH]
                         [--mysql_host MYSQL_HOST] [--mysql_port MYSQL_PORT]
                         [--mysql_user MYSQL_USER]
                         [--mysql_password MYSQL_PASSWORD]
                         [--mysql_socket MYSQL_SOCKET]
                         [--datastore_path DATASTORE_PATH]
                         [--clear_datastore [CLEAR_DATASTORE]]
                         [--datastore_consistency_policy {consistent,random,time}]
                         [--require_indexes [REQUIRE_INDEXES]]
                         [--auto_id_policy {sequential,scattered}]
                         [--logs_path LOGS_PATH]
                         [--show_mail_body [SHOW_MAIL_BODY]]
                         [--enable_sendmail [ENABLE_SENDMAIL]]
                         [--smtp_host SMTP_HOST] [--smtp_port SMTP_PORT]
                         [--smtp_user SMTP_USER]
                         [--smtp_password SMTP_PASSWORD]
                         [--smtp_allow_tls [SMTP_ALLOW_TLS]]
                         [--search_indexes_path SEARCH_INDEXES_PATH]
                         [--clear_search_indexes [CLEAR_SEARCH_INDEXES]]
                         [--enable_task_running [ENABLE_TASK_RUNNING]]
                         [--allow_skipped_files [ALLOW_SKIPPED_FILES]]
                         [--api_port API_PORT] [--grpc_api GRPC_APIS]
                         [--grpc_api_port GRPC_API_PORT]
                         [--automatic_restart [AUTOMATIC_RESTART]]
                         [--dev_appserver_log_level {debug,info,warning,critical,error}]
                         [--skip_sdk_update_check [SKIP_SDK_UPDATE_CHECK]]
                         [--default_gcs_bucket_name DEFAULT_GCS_BUCKET_NAME]
                         [--env_var ENV_VARIABLES]
                         [--google_analytics_client_id GOOGLE_ANALYTICS_CLIENT_ID]
                         [--google_analytics_user_agent GOOGLE_ANALYTICS_USER_AGENT]
                         yaml_or_war_path [yaml_or_war_path ...]
    
     
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment