From 281a96300352580f1757972d9a1dfad8cf21c7c8 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 17 May 2021 22:57:51 +0300 Subject: [PATCH] Use X-Forwarded-For header as remote host --- network.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/network.cpp b/network.cpp index 4740171..757d383 100644 --- a/network.cpp +++ b/network.cpp @@ -419,6 +419,10 @@ void Network::Worker::process_connection(Connection *conn) if(headers_end+content_length>conn->received_data.size()) break; + i = message.headers.find("X-Forwarded-For"); + if(i!=message.headers.end()) + conn->remote_host = i->second; + message_end = headers_end+content_length; }