Skip to content

Commit

Permalink
Use X-Forwarded-For header as remote host
Browse files Browse the repository at this point in the history
  • Loading branch information
DataBeaver committed May 17, 2021
1 parent a691b73 commit 281a963
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 281a963

Please sign in to comment.