24 lines
610 B
Rust
24 lines
610 B
Rust
mod options;
|
|||
|
|
|
||
|
|
use crate::options::OPTIONS;
|
||
|
|
use common::{read_string, Request};
|
||
|
|
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(())
|
||
|
|
}
|