Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
Proxy Protocol
Browse files Browse the repository at this point in the history
- porting the fix to the proxy protocol
  • Loading branch information
gambol99 committed May 18, 2017
1 parent bfe20b8 commit 767967c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
)

var (
release = "v2.0.4"
release = "v2.0.7"
gitsha = "no gitsha provided"
version = release + " (git+sha: " + gitsha + ")"
)
Expand Down
12 changes: 6 additions & 6 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,12 @@ func createHTTPListener(config listenerConfig) (net.Listener, error) {
}
}

// step: does it require proxy protocol?
if config.proxyProtocol {
log.Infof("enabling the proxy protocol on listener: %s", config.listen)
listener = &proxyproto.Listener{Listener: listener}
}

// step: does the socket require TLS?
if config.certificate != "" && config.privateKey != "" {
log.Infof("tls enabled, certificate: %s, key: %s", config.certificate, config.privateKey)
Expand Down Expand Up @@ -410,12 +416,6 @@ func createHTTPListener(config listenerConfig) (net.Listener, error) {
}
}

// step: does it require proxy protocol?
if config.proxyProtocol {
log.Infof("enabling the proxy protocol on listener: %s", config.listen)
listener = &proxyproto.Listener{Listener: listener}
}

return listener, nil
}

Expand Down

0 comments on commit 767967c

Please sign in to comment.