How do messengers (IM) work (listening)?

My task is to write a Messenger program for internal and external employees, I really did it. However, I believe that this is not a good approach, using client software to save "check-mesg" from the server. So I think I'm just mimicking an IM program.

I want the client application to become a listening server and allow the p2p user to talk without the "mesg center" on the main server (if offline mesg was not disabled). The question is, how can I tell an external user (another client application) my location while I'm behind the router?

Are these other IM programs running on the client machine like a server? and how do they go?

Thanks in advance!

+3
source share
1 answer

It is difficult to connect to the systems behind the router and is not always possible. A well-documented way to do this with UDP is the STUN protocol (used mainly for VoIP-based SIP ). If it is impossible to go beyond the router, you can only use a server on an open network as an intermediary (some P2P systems also facilitate connecting peers to such intermediaries). SIP uses TURN for use as an intermediate protocol. SIP protocol to find the right solution for the client, ICE .

. NAT.

+1

Source: https://habr.com/ru/post/1746967/


All Articles