1
0
mirror of https://github.com/actix/examples synced 2024-11-27 16:02:57 +01:00

Merge pull request #15 from caulagi/listen-localhost

Listen to localhost instead of all network interfaces
This commit is contained in:
Nikolay Kim 2018-05-31 13:09:19 -07:00 committed by GitHub
commit 42f6e68525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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();

View File

@ -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();