Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4718

Reflect back to the client their IP address

$
0
0

At Discourse we often need to know what IP address a user might be coming from to diagnose their problems.

We just got rid of a droplet that was serving this function and replaced it with a Lua function running inside HAProxy:

reflectip = function(applet)
  applet:set_status(200)
  applet:add_header("cache-control", "none")
  applet:add_header("content-type", "text/plain")
  applet:start_response()
  applet:send(applet.f:src())
end

core.register_service("reflectip", "http", reflectip)

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4718

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>