I need an extension written for the CocoaAsyncSocket. Normally you can easily startup a server with:
[asyncSocketServer acceptOnPort: 12932 error:&err];
The client are now able to connect to the server with:
[asyncSocketClient1 connectToHost: [url removed, login to view] on- Port: 12932 withTimeout:10.0 error:&aError];
In my example the server has a public ip address [url removed, login to view] and can be reached with the port 12932.
The clients have a local ip addresses and are behind a router / firewall. I've illustrated this with image1.png.
In my project the server should only be used that the clients can find each other. The goal is that the two client start communicating to each other directly without the server. For this client to client communication the already open sockets to the server should be used because the clients are otherwise not reachable through the router / firewall with their local ip address. I've illustrated this with image2.png.
I'm not searching for an explanation how a port forwarding rule is established inside a router or how a firewall is configured but I'm searching for a solution for the challenge described above.
I've read a lot about this in the web but don't want to bring to much theory in here with the hope that somebody already has done this before. Please contact me if you need more background information.