mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-14 03:55:58 +08:00
支持获取http反向代理真实客户端ip: #1388
This commit is contained in:
@@ -670,6 +670,11 @@ bool HttpSession::emitHttpEvent(bool doInvoke){
|
||||
return consumed;
|
||||
}
|
||||
|
||||
std::string HttpSession::get_peer_ip() {
|
||||
GET_CONFIG(string, forwarded_ip_header, Http::kForwardedIpHeader);
|
||||
return forwarded_ip_header.empty() ? TcpSession::get_peer_ip() : _parser.getHeader()[forwarded_ip_header];
|
||||
}
|
||||
|
||||
void HttpSession::Handle_Req_POST(ssize_t &content_len) {
|
||||
GET_CONFIG(size_t,maxReqSize,Http::kMaxReqSize);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user