In some messaging systems, two messaging clients send/receive packets directly from each other in chatting or voice call. I think the basic mechanism is (TCP for example): these client programs open a listening TCP socket and tell the messaging/coordinating server their IP/PORT pair. Then the client programs retrieve IP/PORT of the other side from the messaging/coordinating server. And one of them(let's say A) then initiates a TCP with the other one(let's say B) with the retrieved IP/PORT pair of B.
When the passive client B(who waits for the TCP SYN packet) is not behind NAT or a proxy, this is fine. But if B is behind a NAT or a proxy, then the IP/PORT pair is actually the public network interface of the NAT or the proxy.
So my question is, when a NAT or proxy receives a TCP SYN, what is its reaction? How do they relay the TCP SYN to the corresponding host/process behind it?