#pragma once // clang-format off #include #include // clang-format on #include #include namespace base::http { /// A helper which returns the real IP address of a user behind a reverse proxy such as /// NGINX, Apache, Caddy, or CloudFlare (or other reverse proxies - this list does not pretend to be exhaustive). /// /// # Remarks /// If BASE_HTTP_REVERSE_PROXY_SUPPORT is not defined, this function /// simply returns the fallback address, so it is safe to use in all contexts where a proxied /// address might be used (in fact, it might be a good idea to just leave calls in regardless of configuration.) asio::ip::address GetProxyAddress(asio::ip::address fallback, beast::http::request& req); } // namespace base::http