This commit is contained in:
Neemek 2025-10-05 12:23:29 +02:00
parent 565e400e8d
commit 05bc8cc8fc
2 changed files with 3 additions and 3 deletions

View file

@ -53,7 +53,7 @@ pub struct EncryptedStream {
} }
impl EncryptedStream { impl EncryptedStream {
pub fn bind(address: &str) -> Result<EncryptedStream, Error> { pub fn connect(address: &str) -> Result<EncryptedStream, Error> {
let secret = EphemeralSecret::random(); let secret = EphemeralSecret::random();
let public = PublicKey::from(&secret); let public = PublicKey::from(&secret);

View file

@ -1,7 +1,7 @@
use hermes::EncryptedStream; use hermes::EncryptedStream;
use std::env::args; use std::env::args;
use std::io::{Read, Write}; use std::io::{Read, Write};
use std::net::{Shutdown, TcpListener}; use std::net::{Shutdown, TcpListener, TcpStream};
use std::process::exit; use std::process::exit;
fn main() { fn main() {
@ -30,7 +30,7 @@ fn main() {
} }
} }
"c" => { "c" => {
let mut client = EncryptedStream::bind("127.0.0.1:2007").unwrap(); let mut client = EncryptedStream::connect("127.0.0.1:2007").unwrap();
println!("successfully connected client"); println!("successfully connected client");
let mut buf = Vec::new(); let mut buf = Vec::new();