Skip to content

Commit

Permalink
add port to playit address
Browse files Browse the repository at this point in the history
  • Loading branch information
CheatCod committed Jun 15, 2024
1 parent e00872f commit 53ca235
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/playitgg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ pub async fn get_tunnels(
let tunnels_value = response.get("tunnels");
if let Some(tunnels_value) = tunnels_value {
let tunnels = tunnels_value.as_array();

if let Some(tunnels) = tunnels {
let mut res: Vec<PlayitTunnelInfo> = vec![];
for tunnel in tunnels {
Expand Down Expand Up @@ -396,6 +395,7 @@ pub async fn get_tunnels(
let local_port_value = origin_data.get("local_port");
let local_ip_value = origin_data.get("local_ip");
let assigned_domain_value = alloc_data.get("assigned_domain");
let assigned_port_value = alloc_data.get("port_start");

if !(local_port_value.is_some()
&& local_ip_value.is_some()
Expand All @@ -410,6 +410,7 @@ pub async fn get_tunnels(
let local_port = local_port_value.unwrap().as_i64();
let local_ip = local_ip_value.unwrap().as_str();
let assigned_domain = assigned_domain_value.unwrap().as_str();
let assigned_port = assigned_port_value.unwrap().as_i64();

if !(local_port.is_some() && local_ip.is_some() && assigned_domain.is_some()) {
return Err(Error {
Expand All @@ -424,7 +425,7 @@ pub async fn get_tunnels(
name,
tunnel_id: TunnelUuid(id),
active,
server_address: assigned_domain.unwrap().to_string(),
server_address: format!("{}:{}", assigned_domain.unwrap(), assigned_port.unwrap()),
});
}
Ok(Json(res))
Expand Down

0 comments on commit 53ca235

Please sign in to comment.