How to access private IP address?

HI,
I'm doing a research on client/server connection. I need to run the server code to open socket connection with the client code. To make the test real, I need to run the server code from a a machine far away from the client over the Internet. IN ORDER TO RUN THE CODE, the client has to know the IP address of the server and port in advance.The question is most of the Internet connection is given a private IP address which not real.

Is there any way other than using static IP address???

:confused::confused::confused::confused::confused:

Have the router in question forward the relevant port to the internal IP.

I don't think it will be possible unless you get a static IP for your connection from ISP. So far whatever I have seen, ISP machine will receive and deliver the packets to your private IP machine, the actual machines on internet will never know/see your machine's IP.

In this case you will not be able to communicate with such a machine.

If you had a machine with a genuine external IP on some other service, you could set up a VPN server (perhaps with openvpn) to bridge them both. Both connect to this server, and then they could communicate with each other through it. (A VPN frequently acts like just another local private subnet, once it's operating. Ours is 172.16.x.x)