WebRTC(AppRTC) 本地部署

虚拟机配置

建议安装64位Ubuntu-14.04.1-desttop LTS版,apprtc官方安装说明上也提及了该版本,异常问题较少,整个过程需要翻墙,设置好代理

设置系统代理

以下代理IP需自行替换
/etc/profile末尾添加

http_proxy= http://10.159.32.155:8080  
https_proxy= http://10.159.32.155:8080  
ftp_proxy= ftp://10.159.32.155:8080  
export http_proxy https_proxy ftp_proxy  

保存退出后执行 $ source /etc/profile 更新生效

设置apt-get代理

/etc/apt/apt.conf(没有就自己创建)末尾添加

Acquire:: http::Proxy "http://10.159.32.155:8080";  
Acquire:: https::Proxy "https://10.159.32.155:8080 ";  
Acquire:: ftp::Proxy "ftp://10.159.32.155:8080 ";  

保存退出后更新源 $ apt-get -o Debug:: Acquire::http=true update

设置 git 代理(临时)

$ git config --global http.proxy http://10.159.32.155:8080
$ git config --global https.proxy http://10.159.32.155:8080

设置npm代理(临时)

$ npm config set proxy http://10.159.32.155:8080
$ npm config set https-proxy http://10.159.32.155:8080


安装apprtc

下载源码

$ git clone https://github.com/webrtc/apprtc.git
不要下载到共享文件夹中,否则可能出现各种异常问题

安装方法

参考README.md
安装grunt之前先安装nodejs,npm是nodejs的管理工具
$ sudo apt-get install nodejs
$ sudo npm install -g npm
如需升级node,使用nvm,具体参考帖子

在Ubuntu14.04版本上默认安装是/usr/bin/nodejs,但是grunt需要的是/usr/bin/node,可以安装nodejs-legacy这个包解决。
$ sudo apt-get intsll nodejs-legacy
使用npm安装grunt-cli是最简单的方式,-g为全局安装
$ sudo npm install grunt-cli -g
最后进入apprtc目录,安装所有依赖包
$ sudo npm install

在这个阶段,可能会遇到一个问题

Downloading http://dl.google.com/closure-compiler/compiler-latest.tar.gz … Download failed: Error: connect ETIMEDOUT
Unfortunately, ClosureCompiler.js could not be configured. See: https://github.com/dcodeIO/ClosureCompiler.js (create an issue maybe)

这个帖子中找到一个不算很好的方案,但确实解决了问题。原因在于执行的脚本下载包时没有使用代理,方法是注释掉脚本中下载失败后退出语句,手动下载包并解压到指定路径,具体查看笔记《closure-compiler install error》

在Ubuntu上,还需要安装webtest
$ sudo apt-get install python-webtest
在启动AppRTC或每次修改代码后

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值