Skip to content

Commit

Permalink
feat: control end need to login before access
Browse files Browse the repository at this point in the history
  • Loading branch information
tonylu00 committed Oct 11, 2024
1 parent a2bebeb commit 68586d6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/rendezvous_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,18 @@ impl RendezvousServer {
});
return Ok((msg_out, None));
}
if ph.token.is_empty() && std::env::var("LOGGED_IN_ONLY")
.unwrap_or_default()
.to_uppercase()
== "Y"
{
let mut msg_out = RendezvousMessage::new();
msg_out.set_punch_hole_response(PunchHoleResponse {
other_failure: String::from("The connection is not allowed. You have not logged in."),
..Default::default()
});
return Ok((msg_out, None));
}
let id = ph.id;
// punch hole request from A, relay to B,
// check if in same intranet first,
Expand Down

0 comments on commit 68586d6

Please # to comment.