Update lib.rs

This commit is contained in:
nora 2021-07-05 15:10:56 +02:00 committed by GitHub
parent 9c3d94f581
commit d9a17a6464
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@ type StreamResult = Result<TcpStream, Box<dyn Error>>;
pub fn listen() -> StreamResult {
println!("Listening on {}:8080", local_ipaddress::get().unwrap());
let listener = TcpListener::bind(("127.0.0.1", 80))?;
let listener = TcpListener::bind(("127.0.0.1", 8080))?;
let stream = listener.incoming().next().unwrap()?;
println!("Connected.");
println!("other adress: {}", stream.peer_addr()?.ip());