mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-09-25 14:19:45 +00:00
Accept wider range of IP for proxies and RTC relay
This commit is contained in:
@@ -13,6 +13,7 @@ use crate::data::config::conf;
|
||||
use crate::data::error::{ExecError, Res};
|
||||
use crate::helpers::events_helper;
|
||||
use crate::helpers::events_helper::Event;
|
||||
use crate::utils::network_utils::match_ip;
|
||||
|
||||
struct RtcRelayActor {}
|
||||
|
||||
@@ -245,7 +246,7 @@ pub async fn open_ws(req: actix_web::HttpRequest,
|
||||
let conf = conf().rtc_relay.as_ref().unwrap();
|
||||
|
||||
// Check remote IP address
|
||||
if !ip.ip().to_string().eq(&conf.ip) {
|
||||
if !match_ip(&conf.ip, ip.ip().to_string().as_str()) {
|
||||
eprintln!("A relay from {} tried to connect to the server but the IP address is not authorized!", ip);
|
||||
return Ok(actix_web::HttpResponse::Unauthorized().body("Access denied!"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user