From b0e215f588e7ba267486d93884984ba8222f3978 Mon Sep 17 00:00:00 2001 From: Joeky Date: Sun, 7 Jul 2024 23:39:58 +0800 Subject: [PATCH] Update dependencies, fix default values Signed-off-by: Joeky --- go.mod | 6 +++--- go.sum | 12 ++++++------ main.go | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index a5779cb..101dcdf 100644 --- a/go.mod +++ b/go.mod @@ -4,12 +4,12 @@ go 1.20 require ( github.com/appleboy/graceful v1.1.1 - github.com/valyala/fasthttp v1.53.0 - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 + github.com/valyala/fasthttp v1.55.0 + golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 ) require ( github.com/andybalholm/brotli v1.1.0 // indirect - github.com/klauspost/compress v1.17.7 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect ) diff --git a/go.sum b/go.sum index dcc7456..863e7e9 100644 --- a/go.sum +++ b/go.sum @@ -2,11 +2,11 @@ github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1 github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/appleboy/graceful v1.1.1 h1:vYqfpBdyEFztXofmw9iL8aohnxbcE+2Nq2j67SCoMBo= github.com/appleboy/graceful v1.1.1/go.mod h1:gjCrWFsKhOX2N6jNY0QyQhK+WE8Z3TFSen4fExHg3wk= -github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= -github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.53.0 h1:lW/+SUkOxCx2vlIu0iaImv4JLrVRnbbkpCoaawvA4zc= -github.com/valyala/fasthttp v1.53.0/go.mod h1:6dt4/8olwq9QARP/TDuPmWyWcl4byhpvTJ4AAtcz+QM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= +github.com/valyala/fasthttp v1.55.0 h1:Zkefzgt6a7+bVKHnu/YaYSOPfNYNisSVBo/unVCf8k8= +github.com/valyala/fasthttp v1.55.0/go.mod h1:NkY9JtkrpPKmgwV3HTaS2HWaJss9RSIsRVfcxxoHiOM= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= diff --git a/main.go b/main.go index f83381b..cf061ac 100644 --- a/main.go +++ b/main.go @@ -21,14 +21,14 @@ const ( DefaultMaxConcurrent = 512 DefaultAddr = ":13002" DefaultDNS = "" - DefaultTimeout = 20 * time.Second + DefaultTimeout = 60 * time.Second ) var ( addrF = flag.String("a", DefaultAddr, `Listen address.`) maxConcurrentF = flag.Int("c", DefaultMaxConcurrent, "Max concurrency for fasthttp server") - dnsresolversF = flag.String("n", "", `DNS nameserves, E.g. "8.8.8.8:53" or "1.1.1.1:53,8.8.8.8:53". Default is empty`) - timeoutF = flag.Duration("t", 20*time.Second, `Connection timeout. Examples: 1m or 10s`) + dnsresolversF = flag.String("n", DefaultDNS, `DNS nameserves, E.g. "8.8.8.8:53" or "1.1.1.1:53,8.8.8.8:53". Default is empty`) + timeoutF = flag.Duration("t", DefaultTimeout, `Connection timeout. Examples: 1m or 10s`) usageF = flag.Bool("h", false, "Show usage") addr string