[go-nuts] Reliably test for connection establishment error

2018-02-20 Thread Marco Jantke
I need to do retries for HTTP requests when the connection can't be established initially. As soon as there was a successful connection no retry should happen anymore. While there is error as return from the http.RoundTripper I'm not sure how I can accomplish to find out whether a connection wa

[go-nuts] Re: Writing correct response writer wrappers

2018-01-17 Thread Marco Jantke
> rrw := w.(RetryResponseWriter) >> switch v := rrw.ResponseWriter.(type) { >> case http.Hijacker: >> … >> case http.Flusher: >> … >> case http.CloseNotifier: >> … >> } >> … >> >>

[go-nuts] Writing correct response writer wrappers

2018-01-16 Thread Marco Jantke
Hi everyone, I am currently working on a retry middleware for an http proxy. It is wrapping the original response writer and only in case the forwarded request should not be retried, it passes calls to `Write()`, `WriteHeader()` etc directly through to the original response writer. Now I am s