(proxy, internal/config, internal/log, docs): opt-in websocket support

This commit is contained in:
Tejasvi Nareddy 2019-05-30 22:20:22 -04:00 committed by Teju Nareddy
parent cf61c6be3d
commit f966e5ab19
6 changed files with 55 additions and 4 deletions

View file

@ -273,7 +273,8 @@ func NewReverseProxyHandler(o *config.Options, proxy *httputil.ReverseProxy, rou
timeout = route.UpstreamTimeout
}
timeoutMsg := fmt.Sprintf("%s failed to respond within the %s timeout period", route.Destination.Host, timeout)
return http.TimeoutHandler(up, timeout, timeoutMsg), nil
timeoutHandler := http.TimeoutHandler(up, timeout, timeoutMsg)
return websocketHandlerFunc(up, timeoutHandler, o), nil
}
// urlParse wraps url.Parse to add a scheme if none-exists.