[mod] disable ipv6 by default

git-svn-id: file:///srv/svn/repo/yukari/trunk@24 f3bd38d9-da89-464d-a02a-eb04e43141b5
This commit is contained in:
asciimoo 2016-10-30 18:31:13 +00:00
parent c678b7763e
commit 63b833ac86

View File

@ -28,7 +28,6 @@ const (
)
var CLIENT *fasthttp.Client = &fasthttp.Client{
Dial: fasthttp.DialDualStack,
MaxResponseBodySize: 10 * 1024 * 1024, // 10M
}
@ -640,9 +639,14 @@ func main() {
listen := flag.String("listen", "127.0.0.1:3000", "Listen address")
key := flag.String("key", "", "HMAC url validation key (hexadecimal encoded) - leave blank to disable")
ipv6 := flag.Bool("ipv6", false, "Allow IPv6 HTTP requests")
requestTimeout := flag.Uint("timeout", 2, "Request timeout")
flag.Parse()
if *ipv6 {
CLIENT.Dial = fasthttp.DialDualStack
}
p := &Proxy{RequestTimeout: time.Duration(*requestTimeout) * time.Second}
if *key != "" {