Hey everyone I am facing an issue with rust sdk. I...
# sdk-rust
h
Hey everyone I am facing an issue with rust sdk. I am unable to join the room. Code to join the room is following
Copy code
fn genereate_room_token(
    room_name: String,
    participant_name: Option<String>,
    metadata: Option<String>,
) -> Result<String> {
    let default_identity = "user".to_string();
    let default_metadata = "".to_string();

    let token = livekit_api::access_token::AccessToken::with_api_key(
        &CONFIG.livekit_api_key,
        &CONFIG.livekit_api_sec,
    )
    .with_identity(
        participant_name
            .as_ref()
            .unwrap_or_else(|| &default_identity),
    )
    .with_metadata(metadata.as_ref().unwrap_or_else(|| &default_metadata))
    .with_grants(livekit_api::access_token::VideoGrants {
        room_join: true,
        room: room_name,
        can_publish: true,
        can_subscribe: true,
        ..Default::default()
    });

    Ok(token.to_jwt().context("error generating room join token")?)
}


let room_token = genereate_room_token(
            self.wa_ctx.room_name.clone(),
            Some(self.wa_ctx.participant_name.clone()),
            None,
        )?;

let (_room, mut room_ev_rx) = Room::connect(&url, &room_token, RoomOptions::default()).await?;
Last set of logs I get before it ends up failing
Copy code
2025-11-11T13:34:59.670644Z  WARN livekit::rtc_engine: failed to connect: Signal(Client(401, "missing authorization header")), retrying... (3/3)
2025-11-11T13:34:59.670835Z  INFO livekit_api::signal_client::signal_stream: connecting to <wss://dev-zfx0d2lt.livekit.cloud/rtc?sdk=rust&protocol=16&auto_subscribe=1&adaptive_stream=0&version=0.7.24>
2025-11-11T13:34:59.866846Z  INFO livekit_api::signal_client: fallback connection to: <https://dev-zfx0d2lt.ohyderabad1a.production.livekit.cloud>
2025-11-11T13:34:59.867133Z  INFO livekit_api::signal_client::signal_stream: connecting to <wss://dev-zfx0d2lt.ohyderabad1a.production.livekit.cloud/rtc?sdk=rust&protocol=16&auto_subscribe=1&adaptive_stream=0&version=0.7.24>
2025-11-11T13:34:59.966752Z  INFO livekit_api::signal_client: fallback connection to: <https://dev-zfx0d2lt.omumbai1a.production.livekit.cloud>
2025-11-11T13:34:59.966888Z  INFO livekit_api::signal_client::signal_stream: connecting to <wss://dev-zfx0d2lt.omumbai1a.production.livekit.cloud/rtc?sdk=rust&protocol=16&auto_subscribe=1&adaptive_stream=0&version=0.7.24>
2025-11-11T13:35:00.085042Z  INFO livekit_api::signal_client: fallback connection to: <https://dev-zfx0d2lt.odubai1a.production.livekit.cloud>
2025-11-11T13:35:00.085158Z  INFO livekit_api::signal_client::signal_stream: connecting to <wss://dev-zfx0d2lt.odubai1a.production.livekit.cloud/rtc?sdk=rust&protocol=16&auto_subscribe=1&adaptive_stream=0&version=0.7.24>
2025-11-11T13:35:01.019026Z  INFO livekit_api::signal_client: fallback connection to: <https://dev-zfx0d2lt.osingapore1b.production.livekit.cloud>
2025-11-11T13:35:01.019252Z  INFO livekit_api::signal_client::signal_stream: connecting to <wss://dev-zfx0d2lt.osingapore1b.production.livekit.cloud/rtc?sdk=rust&protocol=16&auto_subscribe=1&adaptive_stream=0&version=0.7.24>
2025-11-11T13:35:01.268062Z  INFO livekit_api::signal_client: fallback connection to: <https://dev-zfx0d2lt.ojeddah1a.production.livekit.cloud>
2025-11-11T13:35:01.268296Z  INFO livekit_api::signal_client::signal_stream: connecting to <wss://dev-zfx0d2lt.ojeddah1a.production.livekit.cloud/rtc?sdk=rust&protocol=16&auto_subscribe=1&adaptive_stream=0&version=0.7.24>
2025-11-11T13:35:02.210942Z  INFO livekit_api::signal_client: fallback connection to: <https://dev-zfx0d2lt.ojerusalem1a.production.livekit.cloud>
2025-11-11T13:35:02.211039Z  INFO livekit_api::signal_client::signal_stream: connecting to <wss://dev-zfx0d2lt.ojerusalem1a.production.livekit.cloud/rtc?sdk=rust&protocol=16&auto_subscribe=1&adaptive_stream=0&version=0.7.24>
2025-11-11T13:35:03.129186Z ERROR whatsapp_rtcbridge: error in livekit setup: engine: signal failure: client error: 401 Unauthorized - missing authorization header
I have checked the same request using curl, and it was able to do connection upgrade to websockets successfully. Has anyone else here already faced this same issue?
btw is anyone maintaining rust SDKs of livekit? Or should I switch to some other lanuage? We cannot use python because of its terrible performance in terms of webrtc. The use case for us is feeding the audio from whatsapp’s webrtc to a livekit room.
e
I don't see anything wrong with your code. Things I would try: • double check the key/secret • check if the system clock is correct • try using different crypto libraries it could also be a backend issue on livekit's end - try using the https://meet.livekit.io to validate your settings (livekit url, key, secret) the rust SDK is being actively maintained. btw I'm not part of livekit, I've just been using the rust sdk for years.
h
Hey @enough-zebra-80131 Thanks for replying, It was a TLS issue, but the SDK was showing completely different error, so I downloaded the sdk locally and debugged the error from there.
🙌 1
r
WRT: https://livekit-users.slack.com/archives/C04G4GE0RGX/p1762879461216049?thread_ts=1762878921.287479&cid=C04G4GE0RGX Yes we are actively maintaining the RUST SDK and in fact many of our other libraries like Python depend on it for core functionality.
Also, I do not have a timeline yet but we are working on direct support for WhatsApp too.
🙌 1
We are now looking for folks to beta test our WhatsApp connector and thought you maybe interested. You can signup for the beta here. https://forms.gle/sxaGiqKCv8nQcgoi7
h
We have done it already for all the BSPs (other that whatsapp cloud). But we will involved in testing here just to see if we can do improvements in our implementation.