Please Explain Google talk's working as a p2p Application - p2p

I was going through some article and found that chat Clients are mostly p2p. If Google Talk is a p2p client then how is it able to save our chat in Gmail ?

The simple answer is that the audio is streamed from browser to browser without any server in between using the Jingle protocol.
So things like text chat and audio chat is peer-to-peer whereas all other functionality is provided by Google servers.
he chat it self uses Jabber (XMPP), but conversation logs are automatically saved to a Chats area in the user's Gmail account. This means that chats involve three parties (your computer, your mates computer and Googles Gmail server cluster)

Related

Python chat server with selectable specific user to chat

I am trying to write simple chat based desktop support app. The gui is not problem, but I have problem with sending messages. The server sends it to all connected clients, but I want request and response to be private between server (or admin) and specific user. I have tried sockets and twisted, but can't figure out how to choose client to contact with.
So if there is any project like what I am trying to achieve on python 3 link or comment for reference. This is my school project for school local network.
Thanx in advance.

Passing Local Storage to Unreal Client

I'm working on a BSC blockchain game developed in unreal. The game itself right now is hosted via a NodeJS server for multiplayer purposes.
The game is a simple card game, with people being able to access special cards in-game for holding ERC20 tokens. The game will be run in a react application, either in an iframe or using the unreal HTML5 package.
There is no need to "write" to blockchain, but a permissioned read is important. Essentially, I think it makes the most sense for people to connect to the blockchain via the react app, this is something I already have. If they're connected to blockchain via the react app, and they have those ERC20 tokens, the game will let them utilize the special cards.
There aren't any plugins or straight forward solutions that I am aware of for the specific BSC/unreal combination.
I've been exploring a few ways to do this, including:
Game itself makes a Web3 request to get the data
Nodejs Authoritative Server for the game can get blockchain data, user has to pair the unreal client to the wallet (not preferable for UX)
Web3 connections are stored in browser local storage, could the unreal client detect that data from the player's specific browser if detected and load the relevant info?
Option #3 would be the most ideal, but I haven't been able to find documentation on how an unreal game could listen/fetch data on the client side for local storage such as the web3 connection.
Anyone have any suggestions or advice on what to research? Is it possible to have and unreal client pull local browser data?

Is data traffic made via WebRTC measured on a platform like Heroku for example?

I want to build a Facetime clone app using NodeJS, ReactJS and WebRTC.
I am new to WebRTC and I don't know how data is transferred between clients.
My question is that if I will deploy the app on a platform like Heroku, the data transferred via video call is measured by Heroku ? That will mean huge costs to make some realtime video calls
WebRTC is peer-to-peer so would not use your Heroku data for the audio/video. Just for the matching, signing up, etc. The peers (web browsers) connect to each other and pass data directly.
However, WebRTC can only handle so many connected clients before each client cannot keep up. So a server system that relays the videos or mirrors the video (itself acting as one of the peers) would use bandwidth. But for only two videos, peer-to-peer should be ok assuming the client's bandwidth is sufficient.

Advice on how to design a good architecture for a chat app?

Hello I'm going to implement a social chat app that I what it to meet some requeriments but I'm not sure how to achieve this.
Required:
The app "frontend" should be written in React Native
Support end to end encryption
Support user to user chats
OAuth2.0
Push notifications
History
Django or Node backend
The problems comes in the backend design. I'm thinking on Node.js with websockets or Django with channels but I don't know which is a good DB design to store chats (like telegram) nor how to build a message queue.
Can anyone give me some tips on the design of a chat app? Thanks
Here is my advise
You actually have 3 choices:
Build everything from scratch (as you wrote in your initial question).
It's actually does not matter here will you use Node.js Websockets, Django Channels or Rails Action Cable. They will have pretty the same performance (or maybe Node.js will be a little bit better). You also can use any DB for this: MySQL, PostgreSQL or MongoDB.
For example, you can have these DB tables structure:
Conversations
id
created_at
updated_at
type
name
description
avatar
participants_ids
last_message_id
owner_id
unread_messages_count
Messages
id
created_at
updated_at
conversation_id
text
sender_id
recipient_id
attachments_ids
read_ids
delivered_ids
Users
id
created_at
updated_at
login
fullname
avatar
Attachments
id
created_at
updated_at
type
link
Then, all your users will have a persistent websocket connection with your server and will use it to send/receive messages. Your server will store all messages in DB in appropriate tables.
Also, you Server will provide REST API to retrieve a list of conversations, messages, attachments, other users profile.
I would say, this option is for small load, small amount of users (because of chosen technologies (Node.js/Python/Ruby) and also because you will build it by yourself, not sure you have enough experience in real time apps building)
Use some open source Chat server, like Ejabberd, Tigase, Openfire. They actually already implemented all real time chat things and have good high-load capabilities (people spent 10 years for building them). You just need to integrate them with your App Server.
Probably your App server will provide REST API to retrieve a list of conversations, messages, attachments, other users profile.
Chat server will provide a way to connect, send/receive messages. You also need to write a plugin for chosen Chat server which will track all messages and put them in you Server App DB.
Use some ready to go Cloud Messaging platforms. There are also many examples in the wild, e.g Twillio, ConnectyCube, Layer etc.
For example - ConnectyCube - Messaging and Video calling provider with messaging capabilities, user base, push notifications, video calling, chat bots. You can integrate your App Server with its REST API. Or even do not write your own App Server at all and use completely this platform. Hence save lots of time and money.
With such platforms you do no care about server hosting, server monitor, server up-time and others server related stuff, you just use their APIs and SDKs in your app. Mostly such platforms provide FREE plans along with dedicated Enterprise solutions where you own your data (it is deployed on your own AWS account for example). So highly recommended.
So something like these is possible in your case.
Here is a tutorial of AWS. It uses Node and Redis as the backend.
I followed the tutorial and built a online chat app, which fulfills all your requirements except for the first one because my app only needs web clients.
BTW, I used Redis to do clustering and DynamoDB to save all messages because I am not quite sure about the reliability of Amazon ElastiCache for Redis. In my test Redis works well and it didn't lost any message in 3 months, but my workmates insist that Redis is not reliable(well, they did not provide any data to prove that), as a result I added DynamoDB to ensure the reliability.

Multifunctional videochat

I'm building a video chat website and i got stuck on the video steaming.
The Local video is working but i can't get the peer to peer connection between them. I've checked out some examples on the web but those are not where i'm looking for. because they only work when you have a local stream.
I've a page for this chat so no rooms are necessary the user needs to connect immediately but only with text chat and users who share their webcam. 16 users can share their webcam and 'unlimited' users can join the page and see those 16 users and chat in text. the text chat goes via socket.io on a node.js server.
is it possible to realize this and if it is can someone please help me out on this or give me a useful example
Edit 1:
My code so far
rtc.connect('ws://127.0.0.1:3000');
function joinVideo(){
console.log('test');
rtc.createStream({"video": true, "audio":false}, function(stream){
// get local stream for manipulation
rtc.attachStream(stream, 'local');
});
}
rtc.on('add remote stream', function(stream){
// show the remote video
rtc.attachStream(stream, 'remote');
});
Thanks anyway,
Stefan
If you are trying to set up video chat between peers, check out Icecomm (http://icecomm.io/). It is a wrapper for WebRTC and you'll be able to exchange streams for your multi-person conferencing app in less than a dozen lines of code.

Resources