Changeset 24 in code for trunk/morty.go


Ignore:
Timestamp:
Oct 30, 2016, 6:31:13 PM (9 years ago)
Author:
asciimoo
Message:

[mod] disable ipv6 by default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/morty.go

    r23 r24  
    2929
    3030var CLIENT *fasthttp.Client = &fasthttp.Client{
    31         Dial:                fasthttp.DialDualStack,
    3231        MaxResponseBodySize: 10 * 1024 * 1024, // 10M
    3332}
     
    641640        listen := flag.String("listen", "127.0.0.1:3000", "Listen address")
    642641        key := flag.String("key", "", "HMAC url validation key (hexadecimal encoded) - leave blank to disable")
     642        ipv6 := flag.Bool("ipv6", false, "Allow IPv6 HTTP requests")
    643643        requestTimeout := flag.Uint("timeout", 2, "Request timeout")
    644644        flag.Parse()
    645645
     646        if *ipv6 {
     647                CLIENT.Dial = fasthttp.DialDualStack
     648        }
     649
    646650        p := &Proxy{RequestTimeout: time.Duration(*requestTimeout) * time.Second}
    647651
Note: See TracChangeset for help on using the changeset viewer.