Hi guys, I didn't find any docs about this behavior, but seems like it's 
related to a previous issue discussed in Google Chrome 
<https://bugs.chromium.org/p/chromium/issues/detail?id=377581> about the 
way that HAProxy handle timeouts 
<http://blog.haproxy.com/2014/05/26/haproxy-and-http-errors-408-in-chrome/>
. 

The lines below are appearing after http requests against a private 
application. Do you have any tips in how to resolve this issue?

2017/12/28 18:31:34 Unsolicited response received on idle HTTP channel 
starting with "HTTP/1.0 408 Request Time-out\r\nCache-Control: 
no-cache\r\nConnection: close\r\nContent-Type: 
text/html\r\n\r\n<html><body><h1>408 Request Time-out</h1>\nYour browser 
didn't send a complete request in time.\n</body></html>\n\n"; err=<nil>
2017/12/28 18:31:34 Unsolicited response received on idle HTTP channel 
starting with "HTTP/1.0 408 Request Time-out\r\nCache-Control: 
no-cache\r\nConnection: close\r\nContent-Type: 
text/html\r\n\r\n<html><body><h1>408 Request Time-out</h1>\nYour browser 
didn't send a complete request in time.\n</body></html>\n\n"; err=<nil>
2017/12/28 18:31:34 Unsolicited response received on idle HTTP channel 
starting with "HTTP/1.0 408 Request Time-out\r\nCache-Control: 
no-cache\r\nConnection: close\r\nContent-Type: 
text/html\r\n\r\n<html><body><h1>408 Request Time-out</h1>\nYour browser 
didn't send a complete request in time.\n</body></html>\n\n"; err=<nil>

I'm using a custom http client as shown below, also I'm appending a context 
with timeout in every http request:

t := &http.Transport{
  Proxy: http.ProxyFromEnvironment,
    DialContext: (&net.Dialer{
    Timeout:   30 * time.Second,
    KeepAlive: 30 * time.Second,
    DualStack: true,
  }).DialContext,
 MaxIdleConnsPerHost:   500,
 MaxIdleConns:          1000,
 IdleConnTimeout:       90 * time.Second,
 TLSHandshakeTimeout:   10 * time.Second,
 ExpectContinueTimeout: 1 * time.Second,
 ResponseHeaderTimeout: 30 * time.Second,
}


c := http.Client{
  Timeout: 5 * time.Second,
  Transport: t,
}

If it can help, I can spend some time building an runnable example (some go 
files and maybe a HAProxy docker image).

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to