I've contacted some website administrators for their API, in return, they have asked for source IP, in order to whitelist it, so that only requests from that IP will be considered as legit (it is ok even if it is a shared IP).
So, now the problem is how do i get the ip of the site. Being a PHP developer, I've tried gethostbyname()
which gives random ip's & also $_SERVER['REMOTE_ADDR']
(called from other server) which always gives the single IP. I'm totally confused with this, also I've very less time to give them my source IP.
I don't have paid hosting. I always use, free tiers of appfog (*.aws.af.cm) & openshift (*-name.rhcloud.com). It would be great if someone can tell me the process for finding any of those IP addresses or show me a way to get a static IP (which i could share with them) for free or another host. Also, they have given permission to use this API only for 10days.
UPDATE: I've also tried ping mysite.aws.af.cm
(which is same as gethostbyname()
) gives different IPs for different calls.