Add disabled-by-default insecure-tcp feature to tokio-xmpp for use by component connections

This commit is contained in:
moparisthebest 2024-01-01 01:13:51 -05:00
commit 019450ff4b
No known key found for this signature in database
GPG key ID: 88C93BFE27BC8229
9 changed files with 112 additions and 12 deletions

View file

@ -31,7 +31,11 @@ pub struct Component<C: ServerConnector> {
impl<C: ServerConnector> Component<C> {
/// Start a new XMPP component
pub async fn new(jid: &str, password: &str, connector: C) -> Result<Self, Error> {
pub async fn new_with_connector(
jid: &str,
password: &str,
connector: C,
) -> Result<Self, Error> {
let jid = Jid::from_str(jid)?;
let password = password.to_owned();
let stream = component_login(connector, jid.clone(), password).await?;