mirror of
https://github.com/XRPLF/clio.git
synced 2026-08-22 05:00:52 +00:00
feat: Proxy support (#2490)
Add client IP resolving support in case when there is a proxy in front of Clio.
This commit is contained in:
@@ -45,9 +45,9 @@ struct ConnectionBase : public util::Taggable {
|
||||
protected:
|
||||
boost::system::error_code ec_;
|
||||
bool isAdmin_ = false;
|
||||
std::string clientIp_;
|
||||
|
||||
public:
|
||||
std::string const clientIp;
|
||||
bool upgraded = false;
|
||||
|
||||
/**
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
* @param ip The IP address of the connected peer
|
||||
*/
|
||||
ConnectionBase(util::TagDecoratorFactory const& tagFactory, std::string ip)
|
||||
: Taggable(tagFactory), clientIp(std::move(ip))
|
||||
: Taggable(tagFactory), clientIp_(std::move(ip))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -119,5 +119,16 @@ public:
|
||||
{
|
||||
return isAdmin_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the IP address of the client.
|
||||
*
|
||||
* @return The IP address of the client.
|
||||
*/
|
||||
[[nodiscard]] std::string const&
|
||||
clientIp() const
|
||||
{
|
||||
return clientIp_;
|
||||
}
|
||||
};
|
||||
} // namespace web
|
||||
|
||||
Reference in New Issue
Block a user