get original ip instead of proxy ip, for rtc api (#2514)
This commit is contained in:
parent
7739d8c7da
commit
84d04adfff
|
|
@ -14,7 +14,7 @@
|
||||||
#include <srs_protocol_utility.hpp>
|
#include <srs_protocol_utility.hpp>
|
||||||
#include <srs_app_config.hpp>
|
#include <srs_app_config.hpp>
|
||||||
#include <srs_app_statistic.hpp>
|
#include <srs_app_statistic.hpp>
|
||||||
|
#include <srs_app_utility.hpp>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
@ -96,6 +96,11 @@ srs_error_t SrsGoApiRtcPlay::do_serve_http(ISrsHttpResponseWriter* w, ISrsHttpMe
|
||||||
}
|
}
|
||||||
if (clientip.empty()) {
|
if (clientip.empty()) {
|
||||||
clientip = dynamic_cast<SrsHttpMessage*>(r)->connection()->remote_ip();
|
clientip = dynamic_cast<SrsHttpMessage*>(r)->connection()->remote_ip();
|
||||||
|
// Overwrite by ip from proxy.
|
||||||
|
string oip = srs_get_original_ip(r);
|
||||||
|
if (!oip.empty()) {
|
||||||
|
clientip = oip;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string api;
|
string api;
|
||||||
|
|
@ -314,6 +319,11 @@ srs_error_t SrsGoApiRtcPublish::do_serve_http(ISrsHttpResponseWriter* w, ISrsHtt
|
||||||
}
|
}
|
||||||
if (clientip.empty()){
|
if (clientip.empty()){
|
||||||
clientip = dynamic_cast<SrsHttpMessage*>(r)->connection()->remote_ip();
|
clientip = dynamic_cast<SrsHttpMessage*>(r)->connection()->remote_ip();
|
||||||
|
// Overwrite by ip from proxy.
|
||||||
|
string oip = srs_get_original_ip(r);
|
||||||
|
if (!oip.empty()) {
|
||||||
|
clientip = oip;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string api;
|
string api;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user