diff options
| -rw-r--r-- | README.md | 12 | ||||
| -rw-r--r-- | cmd/gcp/main.go | 7 |
2 files changed, 7 insertions, 12 deletions
@@ -11,13 +11,9 @@ You need to set up the following environment variables for it to work: e.g. `golang.org/x/` for `golang.org/x/image`, and * `VCS` for the type of VCS you are using, e.g. `git`. -Additionally, the version under `gcp/` will use: - -* `ADDR` for the address to listen on, defaulting to every address, and -* `PORT` for the port to listen on, defaulting to 8080. - -See https://golang.org/pkg/net/#Dial for details of the address format. +Additionally, the version under `gcp/` will use `ADDR` for the address +to listen on, defaulting to every address on port 8080. See +https://golang.org/pkg/net/#Dial for details of the address format. If `ADDR` is set and starts with `/`, go-import-redirect will treat it -as the path of a UNIX socket to create and listen on. `PORT` is also -ignored. +as the path of a UNIX socket to create and listen on. diff --git a/cmd/gcp/main.go b/cmd/gcp/main.go index c284bbc..c726408 100644 --- a/cmd/gcp/main.go +++ b/cmd/gcp/main.go @@ -60,11 +60,10 @@ func main() { log.Fatalln("os.Chmod:", err) } } else { - port := os.Getenv("PORT") - if port == "" { - port = "8080" + if addr == "" { + addr = ":8080" } - if l, err = net.Listen("tcp", os.Getenv("ADDR")+":"+port); err != nil { + if l, err = net.Listen("tcp", addr); err != nil { log.Fatalln("net.Listen:", err) } } |
