最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - PHP Ratchet and WebRTC - Stack Overflow

programmeradmin0浏览0评论

I am trying to develop streaming webrtc on a PHP website.

I want to establish streaming peer to peer with webrtc.

I know webrtc works fine on node and socket to make all the configuration to stablish webrtc connection.

Can I use Ratchet and PHP in place of node and socket?

Does Ratchet support https?

I am trying to develop streaming webrtc on a PHP website.

I want to establish streaming peer to peer with webrtc.

I know webrtc works fine on node and socket to make all the configuration to stablish webrtc connection.

Can I use Ratchet and PHP in place of node and socket?

Does Ratchet support https?

Share Improve this question edited Oct 21, 2016 at 6:33 jwpfox 5,24211 gold badges48 silver badges42 bronze badges asked Oct 20, 2016 at 20:30 AbrahamAbraham 6057 silver badges9 bronze badges 1
  • 2 https yes . You will need signaling , very simply just send msg everybody on receive candidate. Clients do everything .For config ratchet to work with php session you will need more research i cant help you in that point. – Nikola Lukic Commented Feb 1, 2017 at 13:19
Add a comment  | 

3 Answers 3

Reset to default 8

Almost all the tutorials says WebRTC is simple, but at the same time they keep repeating only the same webrtc.org basic examples and using almost only Node.js.

I found this nice early WebRTC+PHP GitHub project that codes a simple signaling server using PHP and MySQL (although it could be replace by a text file). I think it could be useful to you. Is outdated, last change was 6 years ago, but I could explain you the changes in the code needed to run it using PHP 7 and the last Firefox and Chrome versions.

I'm planning to share a fork when I could achieve to code a multiple (not a fixed number) users version. But the lack of examples make it harder.

So you want to develop a streaming webrtc example on a PHP website.

If you use shared hosting, it is going to be difficult with PHP because then you do not have commandline access on the server, which you need for a WebSocket implementation. Then you can use my project at https://github.com/nielsbaloe/webrtc-php to do WebRtc without websockets with SSE (ServerSideEvents). Works great for say less than hundred users.

If you are not on shared hosting, then you can use any PHP package which supports websocket, like Ratchet. However, that is what nobody does these days. You can also switch to using node.js and have a signalling server with less than 10 lines of code.

Yes, WebRTC works well with PHP hosts. The important fact here is that practically anything can be used as a signalling server. You can literally write SDP descriptions and ICE candidates down on paper and send them back and forth using homing pidgins. But where PHP is involved, yes, Ratchet, Workerman, Swoole etc can each be used for creating signalling servers. Most WebRTC gateways also have PHP friendly plugins allowing PHP hosts to play a more active roll in establishing connections between peers when conference servers, SFUs, MCUs etc are thrown into the mix.

发布评论

评论列表(0)

  1. 暂无评论