Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy represents a reverse proxy for load balancing algorithms.
func (*Proxy) GetLoading ¶
GetLoading returns the current loading of the proxy.
func (*Proxy) IsAvailable ¶
IsAvailable returns whether the proxy origin was successfully connected at the last check time.
func (*Proxy) ServeHTTP ¶
func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP handles the incoming HTTP request and forwards it to the underlying proxy server. It increments the load counter by 1 before forwarding the request and decrements it by the given value after the request is processed. This method is part of the Proxy struct and implements the http.Handler interface.
Parameters: - w: The http.ResponseWriter used to write the response back to the client. - r: The http.Request representing the incoming request.