This is a question relating to my thread
How to create a "TCP/IP relay" server? on this forum. I decided to spawn it since it relates to a specific Indy component...
I need to create a connection point for access to a TCP server in my application. The normal way would be to just start listening on a specific TCP port in the application and wait for a client to connect.
But this is not possible since the network router the application is behind is not given a public IP address so I cannot port forward from the router to the device where the application runs (a RaspberryPi).
I am using the Indy10 networking components and it has a mapping utility named TIdMappedPortTCP but I cannot find any examples of usage unfortunately...
What I have in mind is to make a relaying application, which would run on another Raspberry Pi server which does have a public IP address into the network it is on.
This application will have two socket connections, one for the "hidden" server on the other network to connect to and the other for the actual client to connect to.
When the main "hidden" application starts up it would connect to the "server" port of the relay application and then wait for data to arrive.
Now any application that needs to talk to the "hidden" application will connect to the relaying app on its "client" port and this app will forward whatever is sent to the server connected to its "server" port.
When I asked this on the Indy forum I did not know of TIdMappedPortTCP but got a short answer that it exists but no other clue as to its usage...
So my question is this:Can TIdMappedPortTCP be used for the purpose described above or do I need another solution?
It seems like it is designed to go the "other way", i.e. to allow a connection to be done from a client to a server by redirecting the socket connection from the client...
All other solution suggestions should be discussed in
my other thread. Like using SSH or VPN and the like.