Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HeaderValuesContainsToken ¶
HeaderValuesContainsToken reports whether any string in values contains the provided token, ASCII case-insensitively.
Types ¶
type HostProxyMap ¶
type HostProxyMap map[string]*pathmatch.Matcher[*ProxyTarget]
func (HostProxyMap) MatchHost ¶
func (hpm HostProxyMap) MatchHost(host string) (matcher *pathmatch.Matcher[*ProxyTarget], ok bool)
type ProxyTarget ¶
ProxyTarget is the target of specific path.
func (*ProxyTarget) NextTargetURL ¶
func (pt *ProxyTarget) NextTargetURL(path string) (targetURL *url.URL)
NextTargetURL returns the target url based on round robin strategy. Locking mechanism isn't applied, so that it may not perfectly distribute the requests.
type ReverseFroxy ¶
type ReverseFroxy struct { // HostProxyMap maps host to basepath matcher, which maps basepath to proper ProxyTarget. HostProxyMap HostProxyMap // contains filtered or unexported fields }
func ConfigReverseProxy ¶
func ConfigReverseProxy(rpsm map[string]map[string][]string) (*ReverseFroxy, error)
func (*ReverseFroxy) ServeHTTP ¶
func (rf *ReverseFroxy) ServeHTTP(w http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.