mirror of
https://github.com/Noratrieb/terminal-chat.git
synced 2026-01-14 16:35:10 +01:00
fix listen bound ip
This commit is contained in:
parent
d9a17a6464
commit
9cbbaca88a
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(("0.0.0.0", 8080))?;
|
||||||
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