diff --git a/cmd/anubis/main.go b/cmd/anubis/main.go index 8ab370d..5f858f3 100644 --- a/cmd/anubis/main.go +++ b/cmd/anubis/main.go @@ -17,6 +17,7 @@ import ( "os/signal" "regexp" "strconv" + "strings" "sync" "syscall" "time" @@ -82,7 +83,11 @@ func setupListener(network string, address string) (net.Listener, string) { case "unix": formattedAddress = "unix:" + address case "tcp": - formattedAddress = "http://localhost" + address + if strings.HasPrefix(address, ":") { // assume it's just a port e.g. :4259 + formattedAddress = "http://localhost" + address + } else { + formattedAddress = "http://" + address + } default: formattedAddress = fmt.Sprintf(`(%s) %s`, network, address) } @@ -245,10 +250,10 @@ func main() { h = internal.XForwardedForToXRealIP(h) srv := http.Server{Handler: h} - listener, url := setupListener(*bindNetwork, *bind) + listener, listenerUrl := setupListener(*bindNetwork, *bind) slog.Info( "listening", - "url", url, + "url", listenerUrl, "difficulty", *challengeDifficulty, "serveRobotsTXT", *robotsTxt, "target", *target, diff --git a/docs/docs/CHANGELOG.md b/docs/docs/CHANGELOG.md index a11650d..0ac4eee 100644 --- a/docs/docs/CHANGELOG.md +++ b/docs/docs/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Verification page now shows hash rate and a progress bar for completion probability. - Added the `--debug-benchmark-js` flag for testing proof-of-work performance during development. - Use `TrimSuffix` instead of `TrimRight` on containerbuild +- Fix the startup logs to correctly show the address and port the server is listening on - Add [LibreJS](https://www.gnu.org/software/librejs/) banner to Anubis JavaScript to allow LibreJS users to run the challenge ## v1.15.0