root@ip-172-31-25-102:/home/ubuntu# ./goproxy-basic
2016/03/09 13:28:29 [180] WARN: Error copying to client: read tcp 172.31.25.102:8080->188.68.224.51:32895: write tcp 172.31.25.102:8080->188.68.224.51:32895: use of closed network connection
2016/03/09 13:29:34 [073] WARN: Error copying to client: read tcp 172.31.25.102:48632->212.74.50.1:443: write tcp 172.31.25.102:48632->212.74.50.1:443: use of closed network connection
2016/03/09 13:31:08 [081] WARN: Error copying to client: read tcp 172.31.25.102:8080->188.68.224.51:43394: write tcp 172.31.25.102:8080->188.68.224.51:43394: use of closed network connection
func isBlacklisted() goproxy.ReqCondition {
return goproxy.ReqConditionFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) bool {
return true;
})
}
proxy.OnRequest(isBlacklisted()).HandleConnect(goproxy.AlwaysReject)
isBlacklisted
func is being called but the ReqConditionFunc
is not, I have also tried that without the wrapper
Hello, my name is Liora and I am currently hunting open source projects for company NeuraLegion (www.neuralegion.com)
We just launched a free annual subscription for open source projects for our AIAST tool NexPloit.
If you are interested, please, reach us on opensource@neuralegion.com!
Thank you for your time and consideration! If you have any questions, please do not hesitate to contact us!
Best,
Hi
I am trying to cache request using elazarl/goproxy. If request is not cached, it needs to be routed through an external proxy.
proxy.OnRequest().DoFunc(func(req *http.Request,ctx *goproxy.ProxyCtx)(*http.Request,*http.Response) {
if alreadyCached {
return req, getCachedResponse(req)
}
//Here I want to route req via external proxy, I tried the following
transport := &http.Transport{Proxy: http.ProxyURL(proxyUrl), TLSClientConfig: &tls.Config{InsecureSkipVerify: true},}
proxtResponse, err := client.Do(proxyReq)
//cache the response
return req, response
}
But some sites are not loading properly on using the client.Do method.
Any suggestion to route http.Request via proxy.