This message was deleted.
# sdk-rust
s
This message was deleted.
m
cc @boundless-energy-78552
a
@incalculable-ambulance-68856 quick question: for the value of
url
is it a
ws
/`wss` or `http`/`https` scheme? I haven't come across this, but`Room::connect` will require a
ws
or
wss
scheme, and if using
wss
should have a valid certificate
i
oh.. It is a
wss://
link. Is the access token not just enough? how do I get the certificate?
a
You don't have to load the cert client-side if it's signed publicly (like with Caddy). If you're using Livekit Cloud, then you should be gtg. If you're self-hosting, then you can test with the connection tester here: https://livekit.io/connection-test
i
Thanks @ambitious-lunch-95812 . I have a self hosted server. I verified that there url and token works with the connection test
a
Ok. In that case, 2 other quick things to check:
i
The url is hosted on cloudflare
a
1. I would test using the crate form the
main
branch, like so (in your `Cargo.toml`:
Copy code
livekit = { git = "<https://github.com/livekit/client-sdk-rust.git>", branch = "main" }
livekit-webrtc = { git = "<https://github.com/livekit/client-sdk-rust.git>", branch = "main" }
livekit-api = { git = "<https://github.com/livekit/client-sdk-rust.git>", branch = "main" }
livekit-protocol = { git = "<https://github.com/livekit/client-sdk-rust.git>", branch = "main" }
2. Copy the
.cargo/config
from here: https://github.com/livekit/client-sdk-rust/blob/main/.cargo/config into your project
i
Thanks for your help. I will try it out tonight
b
Hey I just created this basic_room example to run it on my Ubuntu 20.04 machine and everything is working correctly. Can you provide a minimal reproducible example?
i
Hi @boundless-energy-78552, Thanks for your help! Here is the sample code.. I am running ubuntu 22.10
Copy code
use livekit::prelude::*;

#[tokio::main]
async fn main() {
    println!("Hello, world!");

    let url = "<wss://sn4p-nrdfch-webrtc.s2.spotai.co>";
    let token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODM3NDAxNzYsImlzcyI6IkFQSWdUUGdTTURCb2tveSIsImp0aSI6Il9IdU1vNkFjbDd5bElETVJQMDIxSyIsIm5iZiI6MTY4MzY1Mzc3Niwic3ViIjoiX0h1TW82QWNsN3lsSURNUlAwMjFLIiwidmlkZW8iOnsiY2FuUHVibGlzaCI6dHJ1ZSwiY2FuU3Vic2NyaWJlIjp0cnVlLCJyb29tIjoic240cC1ucmRmY2gtLTI4MTMiLCJyb29tSm9pbiI6dHJ1ZX19.NUkQNiiJqpjYXJxpZFQB0Evsi8zZt67GlpFRW1hKiOY";

    println!("before calling romm connect");
    //let (room, mut room_events) = Room::connect(&url, &token).await?;
    let res = Room::connect(&url, &token).await;

    match res {
        Ok((room, re)) => {
            let mut room_events = re;
            while let Some(event) = room_events.recv().await {
                match event {
                    RoomEvent::TrackSubscribed { track, publication, participant } => {
                        println!("received room events");
                    }

                    _ => {}
                }
            }
        }
        Err(err) => {
           println!("error trying to connect to room e:{}", err);
        }
    }


}
The URL and the token is valid and verified with the https://livekit.io/connection-test
b
On which
arch
are you on?
i
x86_64 intel processor
🙏 1
linux kernel
5.19.0-41-generic
b
are the tests inside livekit-webrtc working?
cargo test -- --nocapture
i
Oh interesting.. All the tests say
running 0 tests
. Except for access_token, peer_connection and rtc_error tests which all passed
Copy code
running 1 test
test access_token::tests::test_access_token ... ok
running 1 test
test peer_connection::tests::create_pc ... ok
running 3 tests
test rtc_error::tests::serialize_deserialize ... ok
test rtc_error::tests::throw_error ... ok
test jsep::tests::throw_error ... ok
b
Yes I just wanted to check if create_pc was passing
We don’t have a lot of tests (yet) for the livekit implementation
i
Np.. I will try to write some tests..Shoudl I try to install ubuntu 20.04 and try in the same environment?
@boundless-energy-78552 I suspect the problem might be only when Ubuntu 22.10. have you built with Ubuntu 22.10? If so Can you please share any dockerfile you may have? Unfortunately I will have to make it work with 22.10.