Skip to content

PeerJSによるWebRTC実装部分の書き直し#138

Open
toshi3221 wants to merge 3 commits intomasterfrom
peerjs
Open

PeerJSによるWebRTC実装部分の書き直し#138
toshi3221 wants to merge 3 commits intomasterfrom
peerjs

Conversation

@toshi3221
Copy link
Copy Markdown
Member

webrtc.io.jsではFirefoxとの接続が全くできない状態になった(MacFF27で例外出続けて全く動かない)
webrtc.ioは去年で開発がストップしており、今後のメンテナンスがもう期待できない。
PeerJSは現在活発に更新されており、乗り換えた方がよさそう。

@toshi3221
Copy link
Copy Markdown
Member Author

#132 でPeerJSを少し調べた形跡がある

@toshi3221 toshi3221 added this to the x milestone Mar 11, 2014
@toshi3221
Copy link
Copy Markdown
Member Author

$ npm install peer
$ cd cd node_modules/peer/bin/
$ ./peerjs -p 9000

でpeerjsサーバが立ち上がるところまでは確認。

@toshi3221 toshi3221 self-assigned this Mar 16, 2014
@toshi3221
Copy link
Copy Markdown
Member Author

http://peerjs.com/peerserver のPeerJSが用意してくれているクラウドサービスをまず利用して実現。とりあえずFirefoxが(相変わらず不安定だが)利用出来る状態にまでは戻った。

webrtc.io.jsと仕組み的に最も大きく違うのは、チャットルーム的な指定が無く、シグナリングを自分でやらなければいけない。
tiramisuでは、pusherを利用して相手に先に自分のpeer.idを教えておいて、ビデオチャットに接続した際に現在接続中のpusherメンバーに対してP2P接続を行うようにした。

残作業は

  • 上のコメントの、peerjsサーバを立ち上げて、指定できるようにする
  • stunサーバを指定出来るようにする
  • http://html5experts.jp/mganeko/5554/ で紹介されているrfc5766-turn-serverを試してChromeとFFのstunサーバ、turnサーバを共有化できるか試す
  • peer.min.jsをCDNから自前フォルダに取り込んでリンク

stunサーバを指定出来るようにする
peer.jsをCDNから自前フォルダに取り込んでリンク #138
@toshi3221
Copy link
Copy Markdown
Member Author

peerjsサーバ、stunサーバを指定できるようにした。あとは設置。

$ wget https://rfc5766-turn-server.googlecode.com/files/turnserver-3.2.1.4-CentOS6-x86_64.tar.gz
$ tar zxvf turnserver-3.2.1.4-CentOS6-x86_64.tar.gz
$ cd turnserver-3.2.1.4
$ ./install.sh

でいける。バージョンは最新のものを取得すること。
特に/etc/turnserver/turnserver.confはいじらなくても、

sudo /etc/init.d/turnserver start

にて3478ポートでstunサーバが上がった。

@toshi3221
Copy link
Copy Markdown
Member Author

#136 を先にしょりしてください

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant