New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ice auth support #37
Conversation
Had a quick look, what about something like this? impl Default for RtcIceServerConfig {
fn default() -> Self {
Self {
urls: vec![
"stun:stun.l.google.com:19302".to_string(),
//"stun:stun.johanhelsing.studio:3478".to_string(),
//"turn:stun.johanhelsing.studio:3478".to_string(),
],
credentials: Default::default(),
}
}
}
#[derive(Debug)]
pub struct RtcIcePasswordCredentials {
username: String,
credential: String,
}
#[derive(Debug)]
pub struct RtcIceOathCredentials {
//Todo
}
#[derive(Debug)]
pub enum RtcIceCredentials {
None,
Password(RtcIcePasswordCredentials),
Oauth(RtcIceOathCredentials),
}
impl Default for RtcIceCredentials {
fn default() -> Self {
RtcIceCredentials::None
}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't use the RtcIceCredentialType yet as it's not exposed. I made a comment about it
} | ||
|
||
#[derive(Debug)] | ||
pub enum RtcIceCredentialType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one needs to be exposed over here https://github.com/johanhelsing/matchbox/blob/turn-support/matchbox_socket/src/lib.rs#L5
Pushed my code as I had it lying around, note that target branch is |
WDYT about my suggestion over here? #38 |
8749533
to
8a60986
Compare
MDN says it should not be used
8a60986
to
4ccda06
Compare
@tedsteen I think this should be good to go now. I haven't tested it, though, as I don't have a turn server running. Would you mind testing both implementations with yours? |
I've been using a hosted solution https://xirsys.com/ for my turn needs and I've tried the I've also tried the |
@tedsteen Thanks! |
@tedsteen have you a working example of how to use a TURN server? I am currently trying to figure out how this works but I am a little lost and could need a reference point. |
Hi! For the servers themselves I use a service https://xirsys.com |
Thanks! I appreciate the fast reply. Yeah xirsys looks pretty good. |
credential
andusername
beString
orOption<String>
?[ ] implementFrom
trait for new enumFixes #3