how to solve slow p2p connection on turnserver using webrtc? - sockets

I've created the video Call App for using webrtc and also using turn server for p2p connection,
Sometimes TurnServer not working properly
in a P2P connection,
User A Wants to connect the UserB, and the socket Server received the data, but
UserB Video Doesn't show by UserA &&
UserA Video Doesn't show by UserB
I refer to creating turn server using coturn
https://gabrieltanner.org/blog/turn-server/
how to resolve it?
Thanks

Related

Video call on Unity with WebRTC without server

I'd like to make a video call app using WebRTC on Unity. I have investigated almost of the WebRTC services and found out that the WebRTC services require "my own server" for authentication(to give users privileges to access the server). Some companies even say "no server needed" but I actually had to register my server domain to use their services - sounds weird...
my questions are :
why do we need to prepare server (It seems the service provider could have prepared auth servers as well)
Is there any WebRTC service as a complete sever bundle(really woking with client-side app only)
Thanks.
For webrtc you need at at least to exchange the candidate between the peer to allow them to connect (it's called signaling int the webrtc architechture), you also need server to handle network path if nat doesn't allow it (stun/turn server).
There is a lot of server and client depending on your use case complexity and stack. (kurento, Freeswitch, peerJs server ... )

Python & Flask Push Messages

I am developing a sort of IoT type system, where there is control software, a server, and client devices (which are embedded linux devices).
I have a flask server running a REST web service. Control software sends messages for a specific device to the flask web service running on the server. When these messages are received, they are stored in a database.
Client devices poll the sever to determine if there is a new message waiting for the device. This works well but becomes prohibitive as the number of devices grows.
I'd like to find a way to have the messages sent directly from the server to the device as they are received at the server. Is there a simple way to add this functionality to flask? This seems a bit like push notifications.
Is it possible to have each device open a socket like communication to the server and keep it open? Is this a bad idea if I just use TCP sockets for this?

Socket and peer-to-peer connection at once

Is it possible, to mix a socket connection and a peer-to-peer connection within the same script? Let's say a chat application is running on socket.io and the 1 on 1 private messaging should be done within a peer-to-peer connection: Is it necessary to disconnect the running socket.io connection then?
It's both possible and super common. In fact, it's hard to establish a WebRTC peer connection without having a socket connection first.
This is because WebRTC requires exchanging offer/answer SDP and trickle-ICE messages between the peers ahead of establishing a direct connection.
The MDN tutorial does exactly this. Click on a username in the chat to establish a private video call (demo).

unknown client trying to connect watson IoT device continiously

i had connected Watson IoT-sensor-Simulator to Watson IoT device by entering device credentials, a few days back and closed the connection.
now the device is continuously connected and receiving messages as"The client id was reused" thereby increasing the data usage rate .
I need help in disconnecting the connection.
message
The log messages showing "The client ID was reused" indicates that you are running multiple clients using the same credentials - so although you have closed the connection from one client, the other clients continue to connect. If you can't find these clients (the log messages will contain the IP addresses to help you find them) then you can revoke access for the other clients by changing the device's password. This will prevent the spurious clients from connecting.

Is XMPP good choice for this solution?

I want to build communication solution for my project. Thinking about not to develop everything from scratch, but to use XMPP servers.
My project consist of many "mini-servers" (based on raspberry pi) scattered around different locations. Every mini-server should be reachable for mobile applications on its own network, this network could be isolated from internet. Every "mini-server" has to be autonomous and be able to live without internet, autethicate its own mobile client and respond to their requests. So mini-servers could be on private offline networks, could be on known static or unknown dynamic IP addresses behind firewalls.
Some mini-server users want theirs mini-servers to be reachable from the internet. So there is one more, let's call it cloud. This cloud would be responsible for routing request from mobile clients from the internet to their mini-servers.
My idea was to use XMPP server on every mini-server, my application would log in to this server on localhost and create chatroom. Every mobile client would connect to xmpp server and chat with my application request-response. When mini-server owner wants to connect to the interet to be reachable from outside, I would just reconfigure xmpp server to connect to my cloud XMPP cluster (on known public domain) and mobile app to connect to this public cloud server if not on private network. Every mini-server will have its own users, managed by other app on it. Mini-server has also log, this could be written for example to another chatroom. Mini-servers or mobile users does not want to talk to each other. It is pure mobile user to mini-server request-response realtime communication.
Can cloud-XMPP servers route request to mini-server xmpp server?
Is this possible with XMPP? Is it good use? Some better ideas?
What you describe looks like XMPP server-to-server federation, with some local Raspberry PI XMPP domains and some other XMPP servers on the internet.
So, I think yes, what you would like to achieve is doable with XMPP server.
A server like ejabberd works very well on Raspberry Pi.