From ee58af108a88e6f013a410fada09590f65f09b7c Mon Sep 17 00:00:00 2001 From: Maddie Zhan Date: Wed, 11 Mar 2020 12:37:55 +0800 Subject: [PATCH] Update README --- README.md | 2 +- settings.toml | 4 ++-- web/web.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0997439..c033cad 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ You need Go 1.13+ to compile the binary. 4. Change `settings.toml` according to your environment: ```toml - # bind address + # bind address, use empty string to bind to all interfaces bind_address="127.0.0.1" # backend listen port, default is 8989 listen_port=8989 diff --git a/settings.toml b/settings.toml index 0ce222d..9f6c91a 100644 --- a/settings.toml +++ b/settings.toml @@ -1,5 +1,5 @@ -# bind address -bind_address="127.0.0.1" +# bind address, use empty string to bind to all interfaces +bind_address="" # backend listen port listen_port=8989 # download test chunks diff --git a/web/web.go b/web/web.go index 56aa5fc..53c7340 100644 --- a/web/web.go +++ b/web/web.go @@ -44,7 +44,7 @@ func ListenAndServe(conf *config.Config) error { r.Use(middleware.NoCache) r.Use(middleware.Logger) - log.Infof("Starting backend server on port %s", conf.Port) + log.Infof("Starting backend server on %s", net.JoinHostPort(conf.BindAddress, conf.Port)) r.Get("/*", pages) r.HandleFunc("/empty", empty) r.Get("/garbage", garbage)