Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReverseProxy ¶
type ReverseProxy struct { RedirectURL url.URL ResponseTimeout time.Duration OnError func(http.ResponseWriter, *http.Request, int) error Logger *log.Entry }
ReverseProxy is an HTTP Handler that takes an incoming request and sends it to another server (jenkins), proxying the response back to the client if it is received within a timeout (responseTimeout). In case the handler does not recieve any response from the server within the timeout, a 302 to the same URL is sent back to the client.
func NewReverseProxy ¶
func NewReverseProxy(redirectURL url.URL, responseTimeout time.Duration, onError func(http.ResponseWriter, *http.Request, int) error, logger *log.Entry) *ReverseProxy
NewReverseProxy returns an instance of reverse proxy on passing redirect url, response timeout, session validity flag and a logger object
func (*ReverseProxy) ServeHTTP ¶
func (rp *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.