So in my django application, i'm running a task that will request from an api some data in the form of json.
in order for me to get this data, i need to give the IP address of where the requests are going to come from (my heroku app)
how do i get the ip address in which my heroku application will request at
Heroku attaches a “x-forwarded-for” header to requests, and gives you an array of IP Addresses as the value. All you need to do is read this array by splitting the raw string at “,” and then find the last item in the array. This will be the real IP address of the client.
Heroku does not provide Static IP addresses in the Common Runtime Environment. In Heroku Private Spaces, which costs thousands of dollars a month, Static IP's are available, but they aren't load balanced, run on dedicated proxies, or highly customizable.
Here's how to find the IP address on the Android phone:Go to your phone's settings. Select “About device.” Tap on “Status.” Here you can find information about your device, including the IP address.
All Heroku services are hosted on Amazon's EC2 cloud-computing platform.
Heroku does not provide a static IP by itself but you can use addons to achieve this goal. This limitation is discussed here - https://devcenter.heroku.com/articles/apex-domains
Generally sites use URL instead of IP address to authenticate requests. You can use zerigo_dns to get an static IP address for your Heroku app.
To my knowledge you can not get an ip for a heroku application. You could create a proxy with a known ip that serves as a middleman for the application. Otherwise you might want to look at whether heroku is still the correct solution for you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With