diff options
Diffstat (limited to 'src/diplonat.rs')
-rw-r--r-- | src/diplonat.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/diplonat.rs b/src/diplonat.rs index 22ebd6e..6b282eb 100644 --- a/src/diplonat.rs +++ b/src/diplonat.rs @@ -3,12 +3,14 @@ use tokio::try_join; use crate::{ config::ConfigOpts, consul_actor::ConsulActor, fw_actor::FirewallActor, igd_actor::IgdActor, + stun_actor::StunActor, }; pub struct Diplonat { consul: ConsulActor, firewall: FirewallActor, igd: IgdActor, + stun: StunActor, } impl Diplonat { @@ -28,22 +30,30 @@ impl Diplonat { ) .await?; + let sa = StunActor::new( + &rt_cfg.consul, + &rt_cfg.stun, + &rt_cfg.consul.node_name, + ); + let ctx = Self { consul: ca, igd: ia, firewall: fw, + stun: sa, }; - return Ok(ctx); + Ok(ctx) } pub async fn listen(&mut self) -> Result<()> { try_join!( self.consul.listen(), self.igd.listen(), - self.firewall.listen() + self.firewall.listen(), + self.stun.listen(), )?; - return Ok(()); + Ok(()) } } |