Last active
August 29, 2015 14:12
-
-
Save hiroeorz/5eaae05564535decc279 to your computer and use it in GitHub Desktop.
WebRTCでビデオ通話するためにpeerjs-serverをインストールした時のメモ ref: http://qiita.com/hiroeorz@github/items/941d8f18cf8ac61fba52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get install libevent-core-2.0-5 libevent-extra-2.0-5 libevent-openssl-2.0-5 libevent-pthreads-2.0-5 libhiredis0.10 libmysqlclient18 libpq5 mysql-common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ wget http://coturn.net/turnserver/v4.3.3.1/turnserver-4.3.3.1-debian-wheezy-ubuntu-mint-x86-64bits.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo npm -g install peer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ /usr/local/bin/peer --port 9000 --key mykey --path /webrtc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo start peer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo stop peer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get install nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd ~/src | |
$ git clone https://github.com/peers/peerjs.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd /usr/share/nginx/html | |
$ sudo cp ~/src/peerjs/examples/videochat ./peerjs | |
$ sudo cp ~/src/peerjs/dist ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ tar xvzf turnserver-4.3.3.1-debian-wheezy-ubuntu-mint-x86-64bits.tar.gz | |
$ dpkg -i coturn_4.3.3.1-1_amd64.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Uncomment it if you want to have the turnserver running as | |
# an automatic system service daemon | |
# | |
TURNSERVER_ENABLED=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo turnadmin -a -u <ユーザ名> -r <realm> -p <パスワード> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo turnadmin -a -u myname -r hogehoge.co.jp -p mypass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo /etc/init.d/coturn start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo /etc/init.d/coturn stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get install nodejs npm | |
$ sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PeerJS object | |
var peer = new Peer({ host: '1.2.3.4', port: 9000, | |
key: 'mykey', path: '/webrtc', debug: 3, | |
config: {'iceServers': [ | |
{ url: 'stun:1.2.3.4:3478' }, | |
{ url: 'turn:[email protected]:3478', credential: 'mypass' }]} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description "PeerJS Server" | |
author "co-meeting Inc." | |
# Saves log to /var/log/upstart/peerjs.log | |
console log | |
# Starts only after drives are mounted. | |
start on started mountall | |
stop on shutdown | |
# Automatically Respawn. But fail permanently if it respawns 10 times in 5 seconds: | |
respawn | |
respawn limit 10 5 | |
script | |
exec node /usr/local/bin/peerjs -p 9000 -k mykey --path /webrtc | |
end script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listening-ip=1.2.3.4 | |
relay-ip=1.2.3.4 | |
fingerprint | |
lt-cred-mech | |
realm=hogehoge.co.jp | |
syslog |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment