Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Images streaming using Indy client side
#10
Ok, I read some about TCP/UDP hole punching and I have seen some people asking about it on stack-overflow but I don't understand how to implement it in Indy? Regardless of the protocol HTTP/TCP/UDP.

I believe the idea is that every computer behind a NAT has the 2 components client/server. Let's say that I already know both PCs public IPs beforehand and the ports we are using (setting on used server component TId*Server).

For example:

PC 1:
Private IP: 192.168.1.3
Public IP: 102.186.14.167 //Router IP
TIdTCPServer on Port: 1985

On another location behind another NAT (Router)
PC 2
Private IP: 192.168.1.55
Public IP: 102.205.36.52 //Router IP
TIdTCPServer on Port: 65478

I assume that these ports used in the apps are local ports and are not public and can't be reach from the public internet that's why both apps will not be able to connect to each other unless I open ports on both routers and map them to the local ports then use these public ports instead. But I can't do that for every user that will use this app.

I have seen this question: https://stackoverflow.com/questions/4155...on-refused

I don't understand the idea behind using 4 sockets on each client? I am not planning on making a TIdTCPClient connect to another TIdTCPClient here, in fact I want this to be easy as possible. I wanna use a normal connection between a client and a server on both sides.

Now, how can I achieve this with Indy TCP for example? How can I get the public port? Knowing that I still don't have a "Rendezvous Server". So, for testing purposes this will be an HTTP tunnel using ngrok and that Rendezvous server will be also on PC1.
Reply


Messages In This Thread
RE: Images streaming using Indy client side - by Ahmed Sayed - 05-06-2022, 10:01 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)