2024-11-02 15:58:35 -07:00
|
|
|
mod options;
|
|
|
|
|
|
|
|
|
|
use crate::options::OPTIONS;
|
2024-11-03 11:44:03 -08:00
|
|
|
use common::io::read_string;
|
|
|
|
|
use common::request::Request;
|
2024-11-02 15:58:35 -07:00
|
|
|
use std::os::unix::net::UnixStream;
|
|
|
|
|
|
|
|
|
|
fn main() -> std::io::Result<()> {
|
|
|
|
|
let mut stream = UnixStream::connect(&OPTIONS.socket_name)?;
|
|
|
|
|
println!("Connected to server");
|
|
|
|
|
|
|
|
|
|
let request = Request {
|
|
|
|
|
userid: OPTIONS.username.clone(),
|
|
|
|
|
password: OPTIONS.password.clone(),
|
|
|
|
|
service: "ignore-this".to_string(),
|
|
|
|
|
realm: "also-ignore-this".to_string(),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
request.write_to_stream(&mut stream)?;
|
|
|
|
|
let response = read_string(&mut stream)?;
|
|
|
|
|
println!("Response: {}", response);
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|