traefik/vendor/github.com/vulcand/oxy/forward/headers.go

67 lines
1.7 KiB
Go
Raw Normal View History

2017-02-07 21:33:23 +00:00
package forward
// Headers
2017-02-07 21:33:23 +00:00
const (
XForwardedProto = "X-Forwarded-Proto"
XForwardedFor = "X-Forwarded-For"
XForwardedHost = "X-Forwarded-Host"
2017-08-20 17:02:02 +00:00
XForwardedPort = "X-Forwarded-Port"
XForwardedServer = "X-Forwarded-Server"
2017-10-23 14:12:03 +00:00
XRealIp = "X-Real-Ip"
Connection = "Connection"
KeepAlive = "Keep-Alive"
ProxyAuthenticate = "Proxy-Authenticate"
ProxyAuthorization = "Proxy-Authorization"
Te = "Te" // canonicalized version of "TE"
Trailers = "Trailers"
TransferEncoding = "Transfer-Encoding"
Upgrade = "Upgrade"
ContentLength = "Content-Length"
SecWebsocketKey = "Sec-Websocket-Key"
SecWebsocketVersion = "Sec-Websocket-Version"
SecWebsocketExtensions = "Sec-Websocket-Extensions"
SecWebsocketAccept = "Sec-Websocket-Accept"
2017-02-07 21:33:23 +00:00
)
// HopHeaders Hop-by-hop headers. These are removed when sent to the backend.
2017-02-07 21:33:23 +00:00
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html
// Copied from reverseproxy.go, too bad
var HopHeaders = []string{
Connection,
KeepAlive,
ProxyAuthenticate,
ProxyAuthorization,
Te, // canonicalized version of "TE"
Trailers,
TransferEncoding,
Upgrade,
}
// WebsocketDialHeaders Websocket dial headers
var WebsocketDialHeaders = []string{
Upgrade,
Connection,
SecWebsocketKey,
SecWebsocketVersion,
SecWebsocketExtensions,
SecWebsocketAccept,
}
// WebsocketUpgradeHeaders Websocket upgrade headers
var WebsocketUpgradeHeaders = []string{
Upgrade,
Connection,
SecWebsocketAccept,
2018-01-22 11:16:03 +00:00
SecWebsocketExtensions,
}
2017-10-23 14:12:03 +00:00
// XHeaders X-* headers
2017-10-23 14:12:03 +00:00
var XHeaders = []string{
XForwardedProto,
XForwardedFor,
XForwardedHost,
XForwardedPort,
XForwardedServer,
XRealIp,
}