mirror of
https://github.com/Noratrieb/terminal-chat.git
synced 2026-01-14 16:35:10 +01:00
Update lib.rs
This commit is contained in:
parent
c3e4016547
commit
9c3d94f581
1 changed files with 1 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ type StreamResult = Result<TcpStream, Box<dyn Error>>;
|
||||||
|
|
||||||
pub fn listen() -> StreamResult {
|
pub fn listen() -> StreamResult {
|
||||||
println!("Listening on {}:8080", local_ipaddress::get().unwrap());
|
println!("Listening on {}:8080", local_ipaddress::get().unwrap());
|
||||||
let listener = TcpListener::bind(("127.0.0.1", 8080))?;
|
let listener = TcpListener::bind(("127.0.0.1", 80))?;
|
||||||
let stream = listener.incoming().next().unwrap()?;
|
let stream = listener.incoming().next().unwrap()?;
|
||||||
println!("Connected.");
|
println!("Connected.");
|
||||||
println!("other adress: {}", stream.peer_addr()?.ip());
|
println!("other adress: {}", stream.peer_addr()?.ip());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue