mirror of
https://github.com/actix/examples
synced 2025-02-02 09:39:03 +01:00
Listen to localhost instead of all network interfaces
This commit is contained in:
parent
e8582c14cc
commit
5e9e524f5a
@ -40,7 +40,7 @@ fn main() {
|
|||||||
))
|
))
|
||||||
// register simple route, handle all methods
|
// register simple route, handle all methods
|
||||||
.resource("/", |r| r.f(index))
|
.resource("/", |r| r.f(index))
|
||||||
}).bind("0.0.0.0:8080")
|
}).bind("127.0.0.1:8080")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.start();
|
.start();
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ fn main() {
|
|||||||
// start http server
|
// start http server
|
||||||
server::new(move || {
|
server::new(move || {
|
||||||
App::new().resource("/", |r| r.method(http::Method::GET).with(index))
|
App::new().resource("/", |r| r.method(http::Method::GET).with(index))
|
||||||
}).bind("0.0.0.0:8080")
|
}).bind("127.0.0.1:8080")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.start();
|
.start();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user