apprtc demo的app.yaml分析

本文解析了AppRTC项目的源码结构,重点介绍了src目录下的关键文件夹,包括collider信令服务器代码、third_party第三方库及web_app相关文件。同时详细分析了app_enginee目录下的app.yaml配置文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

apprtc的src目录下,有几个文件夹,其中有app_enginee、collider、third_party和web_app。

其中collider是信令服务器相关的code。之后在分析。
third_party里面是一些库之类的东西。在其readme.txt中有一段话:

These are libraries that are required but not provided by AppEngine.

third_party中还有一个requirements.txt,readme.txt涉及到这个文件的是

pip install --target=third_party --upgrade -r third_party/requirements.txt

pip是python包管理工具,类似npm之于nodejs的关系。通过requirements.txt来对python工程所需的包进行管理。
总的说来third_party是第三方包。

web_app是web_app所需的一些文件内容。在apprtc的编译grunt build后移到out/app_enginee中。

转到src/app_enginee/app.yaml分析,文件内容

application: apprtc
version: 9
runtime: python27
threadsafe: true
api_version: 1

handlers:
- url: /(.*\.html)
  static_files: html/\1
  upload: html/(.*\.html)

- url: /manifest.json
  static_files: html/manifest.json
  upload: html/manifest.json

- url: /robots.txt
  static_files: html/robot.txt
  upload: html/robots.txt

- url: /callstats
  static_dir: third_party/callstats

- url: /images
  static_dir: images

- url: /js
  static_dir: js

- url: /css
  static_dir: css

- url: /compute/.*
  script: apprtc.app
  login: admin

- url: /probe.*
  script: probers.app
  secure: always

- url: /.*
  script: apprtc.app
  secure: always

libraries:
- name: jinja2
  version: latest
- name: ssl
  version: latest
- name: pycrypto
  version: latest

env_variables:
  BYPASS_JOIN_CONFIRMATION: false
  # Only change these while developing, do not commit to source!
  # Use appcfg.py --env_variable=CALLSTATS_APP_ID:ID  \
  #               --env_variable=CALLSTATS_APP_SECRET:SECRET \
  #               --env_variable=ICE_SERVER_API_KEY:KEY \
  # in order to replace variables when deploying.
  CALLSTATS_APP_ID: none
  CALLSTATS_APP_SECRET: none
  ICE_SERVER_API_KEY: none

依据http://blog.youkuaiyun.com/day_day_up1991/article/details/52604671介绍,可知其中的application是app的ID,和GAE平台上注册之后见的网络应用名相同。runtime和api_version表示依赖的运行环境和版本。
handlers表示不同url时,不同的处理方式。

 url: /manifest.json
  static_files: html/manifest.json
  upload: html/manifest.json

表示如果url后面为/manifest.json,则对应的静态文件为html/mainfest.json。
如果是动态内容,则是脚本,比如

- url: /compute/.*
script: apprtc.app
login: admin

如果url为/compute/任意内容,则用apprtc.app来处理。
不过从实际产生作用角度,是apprtc.py在处理。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值