mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
For #1488, pass client ip to http callback.3.0.85
This commit is contained in:
commit
316cab794a
7 changed files with 56 additions and 1 deletions
|
@ -626,6 +626,17 @@ SrsRequest* SrsHttpMessage::to_request(string vhost)
|
|||
if (req->host == SRS_CONSTS_RTMP_DEFAULT_VHOST) {
|
||||
req->host = _uri->get_host();
|
||||
}
|
||||
|
||||
// Set ip by remote ip of connection.
|
||||
if (conn) {
|
||||
req->ip = conn->remote_ip();
|
||||
}
|
||||
|
||||
// Overwrite by ip from proxy.
|
||||
string oip = srs_get_original_ip(this);
|
||||
if (!oip.empty()) {
|
||||
req->ip = oip;
|
||||
}
|
||||
|
||||
return req;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue