Sharing a variable with everyone?

39 views
Skip to first unread message

Benz Muircroft

unread,
Jul 12, 2015, 6:09:09 PM7/12/15
to eas...@googlegroups.com
Hi,

Disclamer: My assumptions are probably wrong.

I have been looking at quite a lot of random webrtc stuff lately and it has left me very confused as to 'where its at'. From what I can tell this library looks like it is a/the leading one.

What I have seen so far is that the user must grant permission (some sort of sandbox) to initiate interaction with a peer. Now I can understand this if the interaction wanted access to your video or audio.

I what I am very cloudy about is p2p data shareing. To be specific I would like to share a variable between all clients (however many clients are on the site at the time? maybe lots).

Say my variable is an object: {user_id:1,user_name:'bob',x:145,y:21087',user_img:'foo.png'}

If there are 1000 users on the site don't want a user to have to grant permissions 1000 times to get this data nor do I want the user to have to grant permission to the app to share this trivial info with all the other users (I feel that clicking confirm ruins the experience).

Would this be the case?

If so would there be a way around this... Is there a way of transmitting things to a shared global object between the peers so you are not directly sharing?

PS: just to be clear I don't want to share audio or video at all at this time, just data

Eric Davies

unread,
Jul 13, 2015, 10:48:18 AM7/13/15
to eas...@googlegroups.com
P2P makes sense if you have a high volume of data or you need to believe that outsiders can't listen in on the data even if they have your server keys.

For what you are describing, I would simply propagate the information using websockets or long polling. A client sends a message to the websocket server which then relays it to all the other clients.

If you throw P2P into the mix, you have a lot more connections to worry about failing, the need for turn servers, and there will be some clients you can't reach even with turn servers.



Reply all
Reply to author
Forward
0 new messages