Skip to content
Snippets Groups Projects
Unverified Commit 97c0895a authored by Rohith Jayawardene's avatar Rohith Jayawardene Committed by GitHub
Browse files

Logging & Keepalive (#321)

- making the upstream keepalive default to true
- fixing a small logging
parent 57736a41
Branches
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ FEATURES: ...@@ -6,6 +6,7 @@ FEATURES:
* Added the ability to control the timeout on the initial openid configuration from .well-known/openid-configuration [#PR315](https://github.com/gambol99/keycloak-proxy/pull/315) * Added the ability to control the timeout on the initial openid configuration from .well-known/openid-configuration [#PR315](https://github.com/gambol99/keycloak-proxy/pull/315)
* Updated to Golang version 1.10 [#PR316](https://github.com/gambol99/keycloak-proxy/pull/316) * Updated to Golang version 1.10 [#PR316](https://github.com/gambol99/keycloak-proxy/pull/316)
* Added the X-Auth-Audience to the upstream headers [#PR319](https://github.com/gambol99/keycloak-proxy/pull/319) * Added the X-Auth-Audience to the upstream headers [#PR319](https://github.com/gambol99/keycloak-proxy/pull/319)
* Changed the upstream-keepalive to default to true [#PR321](https://github.com/gambol99/keycloak-proxy/pull/321)
#### **2.1.1** #### **2.1.1**
......
...@@ -30,8 +30,8 @@ func newDefaultConfig() *Config { ...@@ -30,8 +30,8 @@ func newDefaultConfig() *Config {
AccessTokenDuration: time.Duration(720) * time.Hour, AccessTokenDuration: time.Duration(720) * time.Hour,
CookieAccessName: "kc-access", CookieAccessName: "kc-access",
CookieRefreshName: "kc-state", CookieRefreshName: "kc-state",
EnableAuthorizationHeader: true,
EnableAuthorizationCookies: true, EnableAuthorizationCookies: true,
EnableAuthorizationHeader: true,
EnableTokenHeader: true, EnableTokenHeader: true,
Headers: make(map[string]string), Headers: make(map[string]string),
LetsEncryptCacheDir: "./cache/", LetsEncryptCacheDir: "./cache/",
...@@ -46,6 +46,7 @@ func newDefaultConfig() *Config { ...@@ -46,6 +46,7 @@ func newDefaultConfig() *Config {
Tags: make(map[string]string, 0), Tags: make(map[string]string, 0),
UpstreamExpectContinueTimeout: 10 * time.Second, UpstreamExpectContinueTimeout: 10 * time.Second,
UpstreamKeepaliveTimeout: 10 * time.Second, UpstreamKeepaliveTimeout: 10 * time.Second,
UpstreamKeepalives: true,
UpstreamResponseHeaderTimeout: 1 * time.Second, UpstreamResponseHeaderTimeout: 1 * time.Second,
UpstreamTLSHandshakeTimeout: 10 * time.Second, UpstreamTLSHandshakeTimeout: 10 * time.Second,
UpstreamTimeout: 10 * time.Second, UpstreamTimeout: 10 * time.Second,
......
...@@ -458,8 +458,7 @@ func (r *oauthProxy) createHTTPListener(config listenerConfig) (net.Listener, er ...@@ -458,8 +458,7 @@ func (r *oauthProxy) createHTTPListener(config listenerConfig) (net.Listener, er
getCertificate = m.GetCertificate getCertificate = m.GetCertificate
} else { } else {
r.log.Info("tls support enabled", r.log.Info("tls support enabled", zap.String("certificate", config.certificate), zap.String("private_key", config.privateKey))
zap.String("certificate", config.certificate), zap.String("private_key", config.privateKey))
// creating a certificate rotation // creating a certificate rotation
rotate, err := newCertificateRotator(config.certificate, config.privateKey, r.log) rotate, err := newCertificateRotator(config.certificate, config.privateKey, r.log)
if err != nil { if err != nil {
...@@ -552,8 +551,8 @@ func (r *oauthProxy) createUpstreamProxy(upstream *url.URL) error { ...@@ -552,8 +551,8 @@ func (r *oauthProxy) createUpstreamProxy(upstream *url.URL) error {
proxy.Logger = httplog.New(ioutil.Discard, "", 0) proxy.Logger = httplog.New(ioutil.Discard, "", 0)
r.upstream = proxy r.upstream = proxy
// create the http transport // update the tls configuration of the reverse proxy
tp := &http.Transport{ r.upstream.(*goproxy.ProxyHttpServer).Tr = &http.Transport{
Dial: dialer, Dial: dialer,
DisableKeepAlives: !r.config.UpstreamKeepalives, DisableKeepAlives: !r.config.UpstreamKeepalives,
ExpectContinueTimeout: r.config.UpstreamExpectContinueTimeout, ExpectContinueTimeout: r.config.UpstreamExpectContinueTimeout,
...@@ -562,9 +561,6 @@ func (r *oauthProxy) createUpstreamProxy(upstream *url.URL) error { ...@@ -562,9 +561,6 @@ func (r *oauthProxy) createUpstreamProxy(upstream *url.URL) error {
TLSHandshakeTimeout: r.config.UpstreamTLSHandshakeTimeout, TLSHandshakeTimeout: r.config.UpstreamTLSHandshakeTimeout,
} }
// update the tls configuration of the reverse proxy
r.upstream.(*goproxy.ProxyHttpServer).Tr = tp
return nil return nil
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment