View definition

(*ReqProxyConds).HandleConnectFunc

Defined in github.com/elazarl/goproxy/dispatcher.go

Description

HandleConnectFunc is equivalent to HandleConnect, for example, accepting CONNECT request if they contain a password in header

io.WriteString(h,password)
passHash := h.Sum(nil)
proxy.OnRequest().HandleConnectFunc(func(host string, ctx *ProxyCtx) (*ConnectAction, string) {
	c := sha1.New()
	io.WriteString(c,ctx.Req.Header.Get("X-GoProxy-Auth"))
	if c.Sum(nil) == passHash {
		return OkConnect, host
	}
	return RejectConnect, host
})

HandleConnectFunc is referenced in 5 repositories

github.com/elazarl/goproxy github.com/mimoto-xxxxxx/dockerns github.com/mzimmerman/whitelistproxy

...