diff --git a/CHANGELOG.md b/CHANGELOG.md index b3c59a1..161caf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to hp (hittyping) will be documented in this file. +## [0.8.6] - 2026-05-17 + +### Changed + +- Bump Go toolchain: 1.25.6 → 1.26.2 +- Bump dependencies: `golang.org/x/sys` 0.38.0 → 0.43.0, `golang.org/x/crypto` 0.45.0 → 0.50.0, `golang.org/x/net` 0.47.0 → 0.53.0, `golang.org/x/text` 0.31.0 → 0.36.0 + +### Fixed + +- Skip local DNS lookup when proxy environment variables are set + ## [0.8.5] - 2026-03-04 ### Changed diff --git a/CLAUDE.md b/CLAUDE.md index 805daa6..deca4d4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -81,7 +81,7 @@ HTTPS_PROXY=socks5://host:port hp cloudflare.com # Via SOCKS5 proxy ## Architecture -Go application using `spf13/pflag` for POSIX-style CLI flags. Uses latest stable Go (currently 1.25). +Go application using `spf13/pflag` for POSIX-style CLI flags. Uses latest stable Go (currently 1.26). Key functions: diff --git a/ROADMAP.md b/ROADMAP.md index 02b5213..25ecc45 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -74,6 +74,11 @@ If hp evolves toward interactive features, consider migrating to [Bubble Tea](ht ## Completed +### v0.8.6 - Toolchain & Dependency Refresh + +- [x] Bump Go toolchain to 1.26.2 +- [x] Update `golang.org/x/sys`, `x/crypto`, `x/net`, `x/text` to latest patch series + ### v0.8.5 - Timeline Date Display - [x] Include date in timeline when session spans multiple calendar days diff --git a/go.mod b/go.mod index 24a09f0..f570ca0 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,16 @@ module github.com/ac/hp -go 1.25.6 +go 1.26.2 require ( github.com/quic-go/quic-go v0.59.0 github.com/spf13/pflag v1.0.10 - golang.org/x/sys v0.38.0 + golang.org/x/sys v0.43.0 ) require ( github.com/quic-go/qpack v0.6.0 // indirect - golang.org/x/crypto v0.45.0 // indirect - golang.org/x/net v0.47.0 // indirect - golang.org/x/text v0.31.0 // indirect + golang.org/x/crypto v0.50.0 // indirect + golang.org/x/net v0.53.0 // indirect + golang.org/x/text v0.36.0 // indirect ) diff --git a/go.sum b/go.sum index 2c803fb..73eee19 100644 --- a/go.sum +++ b/go.sum @@ -12,13 +12,13 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko= go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o= -golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= -golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= -golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= -golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= -golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= -golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= -golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= +golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI= +golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= +golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= +golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= +golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= +golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= +golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/main.go b/main.go index b24b58e..5db4b50 100644 --- a/main.go +++ b/main.go @@ -22,7 +22,7 @@ import ( // cleanly pause rendering before the process is actually stopped. var displayMu sync.Mutex -const version = "0.8.5" +const version = "0.8.6" const ( // ANSI colors @@ -189,13 +189,13 @@ func main() { displayURL := host - // Resolve hostname to IP for display (and validate it exists) + // Resolve hostname to IP for display (and validate it exists). + // Skipped when a proxy is configured: the proxy resolves the host + // (e.g. socks5h), so the local resolver may legitimately fail. resolvedIP := "" // Strip brackets from IPv6 for parsing and display hostForLookup := strings.TrimPrefix(strings.TrimSuffix(displayURL, "]"), "[") - // Check if it's already an IP address - if ip := net.ParseIP(hostForLookup); ip == nil { - // It's a hostname, resolve it + if ip := net.ParseIP(hostForLookup); ip == nil && !proxyConfigured() { ips, err := net.LookupHost(hostForLookup) if err != nil { fmt.Fprintf(os.Stderr, "Error: cannot resolve %s: %v\n", hostForLookup, err) @@ -440,6 +440,17 @@ func measureRTT(client *http.Client, url string, protoLevel int) (time.Duration, return elapsed, nil } +// proxyConfigured reports whether any HTTP/HTTPS proxy env var is set. +// Mirrors the variables consulted by http.ProxyFromEnvironment. +func proxyConfigured() bool { + for _, k := range []string{"HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy"} { + if os.Getenv(k) != "" { + return true + } + } + return false +} + func createClient(protoLevel int, timeout time.Duration, insecure bool) *http.Client { if protoLevel == protoHTTP3 { return newHTTP3Client(timeout, insecure)