cd ~
sudo apt-get update
apt-get install git unzip lrzsz nodejs npm automake autoconf libtool nodejs-legacy python-webtest golang -y
哪个软件安装失败就重新装
apt-get 软件名称
cd /usr/lib/jvm/
tar -zxvf jdk-8u191-linux-x64.tar.gz
cd /etc/
vim profile
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_191
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
source /etc/profile
java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
cd ~
git clone https://github.com/webrtc/apprtc.git
cd apprtc/
git checkout v1.0
npm -g install grunt-cli
npm install
npm cache clean -f
npm install -g n
n stable
node -v
npm install // 再来安装一次
rm node_modules/ -rf //删掉
npm config set registry https://registry.npm.taobao.org //切换淘宝源
npm info underscore //使其生效
npm install // 再来安装一次
grunt build
npm install
requests.exceptions.SSLError
grunt build -force
Done.with warrings 或者 Done.with out error
表示成功
cd out/app_engine/
vim constants.py
TURN_BASE_URL = 'https://www.域名'
ICE_SERVER_BASE_URL = 'https://www.域名
WSS_INSTANCE_HOST_KEY = 'www.域名:8089'
WSS_INSTANCES = [{
WSS_INSTANCE_HOST_KEY: 'www.域名:8089',
WSS_INSTANCE_NAME_KEY: 'wsserver-std',
WSS_INSTANCE_ZONE_KEY: 'us-central1-a'
}, {
WSS_INSTANCE_HOST_KEY: 'www.域名:8089',
WSS_INSTANCE_NAME_KEY: 'wsserver-std-2',
WSS_INSTANCE_ZONE_KEY: 'us-central1-f'
}]
var servers=[{
credential:"helloword",
username:"helloword",
urls:["turn:服务器外网ip:3478?transport=udp",
"turn:服务器外网ip:3478?transport=tcp",
"turn:服务器外网ip:3479?transport=udp",
"turn:服务器外网ip:3479?transport=tcp"
]
}];
cd ~/apprtc/out/app_engine/js
vi apprtc.debug.js
做出如下修改
if (!isChromeApp()) {
roomLink=roomLink.substring("http","https"); //新增加的
window.history.pushState({"roomId":roomId, "roomLink":roomLink}, roomId, roomLink);
}
//peerConnectionConfig: {{ pc_config | safe }},
//turnRequestUrl: '{{ turn_url }}',
//iceServerRequestUrl: '{{ ice_server_url }}',
3.添加
peerConnectionConfig:{"rtcpMuxPolicy":"require","iceServers":servers,"bundlePolicy":"max-bundle"},
cd ~
unzip google_appengine_1.9.80.zip
vi /etc/profile
export PATH=$PATH:/root/google_appengine/
source /etc/profile
mkdir logs
cd logs
touch room.log collider.log turn.log //创建文件
chmod 777 room.log collider.log turn.log //修改权限
tail -f ./logs/room.log
cd ~
nohup ./google_appengine/dev_appserver.py --host 内网ip --enable_host_checking false ./apprtc/out/app_engine > ./logs/room.log 2>&1 &
打开https://域名/
能正常访问,则成功
如果报错找不到 callstats.min.js 下载地址
socket.io.js 下载地址
下载后上传到
/root/apprtc/out/app_engine/third_party/callstats
重新打开网页就好