2017-04-01 16:15:56 +00:00
|
|
|
extern crate xmpp;
|
|
|
|
|
|
|
|
use xmpp::jid::Jid;
|
|
|
|
use xmpp::component::ComponentBuilder;
|
|
|
|
|
|
|
|
use std::env;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let jid: Jid = env::var("JID").unwrap().parse().unwrap();
|
|
|
|
let pass = env::var("PASS").unwrap();
|
|
|
|
let host = env::var("HOST").unwrap();
|
|
|
|
let port: u16 = env::var("PORT").unwrap().parse().unwrap();
|
|
|
|
let mut component = ComponentBuilder::new(jid.clone())
|
|
|
|
.password(pass)
|
|
|
|
.host(host)
|
|
|
|
.port(port)
|
|
|
|
.connect()
|
|
|
|
.unwrap();
|
2017-05-24 23:22:40 +00:00
|
|
|
component.main().unwrap();
|
2017-04-01 16:15:56 +00:00
|
|
|
}
|