From 1518fbe8e261a65188544c8440bed5f7bf630258 Mon Sep 17 00:00:00 2001 From: Jasper Hugo Date: Wed, 9 Mar 2022 19:36:29 +0700 Subject: [PATCH] Implement PLAIN auth for gst-meet --- gst-meet/src/main.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gst-meet/src/main.rs b/gst-meet/src/main.rs index 9e7fe7a..85f29b1 100644 --- a/gst-meet/src/main.rs +++ b/gst-meet/src/main.rs @@ -47,6 +47,15 @@ struct Opt { )] focus_jid: Option, + #[structopt( + long, + help = "If not specified, anonymous auth is used." + )] + xmpp_username: Option, + + #[structopt(long)] + xmpp_password: Option, + #[structopt( long, default_value = "vp9", @@ -223,7 +232,13 @@ async fn main_inner() -> Result<()> { let (connection, background) = Connection::new( &opt.web_socket_url, xmpp_domain, - Authentication::Anonymous, + match opt.xmpp_username { + Some(username) => Authentication::Plain { + username, + password: opt.xmpp_password.context("if xmpp-username is provided, xmpp-password must also be provided")?, + }, + None => Authentication::Anonymous, + }, #[cfg(feature = "tls-insecure")] opt.tls_insecure, #[cfg(not(feature = "tls-insecure"))]