0

How does the Heroku routing layer (what I assume is effectively a reverse proxy) manage client IP addresses even as it rewrites them, and how much of this is specific just to Heroku vs other reverse proxies?

Background - I was trying to debug an internal IP-related issue with Django, when I found that self.request.META['REMOTE_ADDR'] in logs seemed to change whenever I redeployed the dyno. It seems reasonable to conclude the proxy is stripping out my client's IP address and inserting its own, before sending it to my Django app.

But the routing layer must be storing my 'real' client IP somewhere in a reliable way, since it has to actually make a connection with the client, right? Is it, say, encoded in a TCP segment somewhere? Is it, say persisted in a lookup table in the Heroku routing layer itself?

mallyvai
  • 1,698
  • 14
  • 20
  • 2
    Possible duplicate of [Get client's real IP address on Heroku](http://stackoverflow.com/questions/18264304/get-clients-real-ip-address-on-heroku) – solarissmoke Jun 29 '16 at 06:27
  • That's an interesting question, but my goal is to understand how a reverse proxy like Heroku's routing layer may actually store/encode the state, what parts of the packet it might rewrite, etc. – mallyvai Jun 29 '16 at 06:28
  • Not sure the question is appropriate for SO then, if it isn't directly related to programming. – solarissmoke Jun 29 '16 at 06:29

0 Answers0