diff --git a/src/commands/tunnel/types.rs b/src/commands/tunnel/types.rs index 6825c43..30bfffb 100644 --- a/src/commands/tunnel/types.rs +++ b/src/commands/tunnel/types.rs @@ -20,7 +20,7 @@ pub enum TonneruPacket { port: u16, }, Connect { - container_id: String, + resource_id: String, }, } @@ -56,7 +56,7 @@ impl<'de> Deserialize<'de> for TonneruPacket { .ok_or_else(|| serde::de::Error::custom("container_id is not a string"))?; Ok(TonneruPacket::Connect { - container_id: container_id.to_string(), + resource_id: container_id.to_string(), }) } _ => Err(SerdeDeError::custom("invalid opcode received")), diff --git a/src/commands/tunnel/utils.rs b/src/commands/tunnel/utils.rs index 2d16223..2611935 100644 --- a/src/commands/tunnel/utils.rs +++ b/src/commands/tunnel/utils.rs @@ -126,7 +126,7 @@ impl TonneruSocket { let packet = serde_json::to_vec(&TonneruPacket::Auth { token: self.token.clone(), - resource_id: self.deployment_id.clone(), + resource_id: self.resource_id.clone(), port: self.port, })?; @@ -141,7 +141,7 @@ impl TonneruSocket { match socket.read(&mut buf).await { Ok(n) => match serde_json::from_slice::(&buf[..n]) { - Ok(TonneruPacket::Connect) => Ok(socket), + Ok(TonneruPacket::Connect { .. }) => Ok(socket), _ => Err(anyhow!( "Unexpected packet. Received: {}", String::from_utf8_lossy(&buf[..n])