Comments (10)
I still get this issue
2016/10/22 15:02:37 [041] WARN: Error copying to client: read tcp 127.0.0.1:1272->127.0.0.1:54737: write tcp 127.0.0.1:1892->127.0.0.1:54737: use of closed network connection
from goproxy.
Thanks for reporting the bug.
This is a known problem, I suspect it's caused by unsynchronized closing of the tunneled TLS connection. I'm still investigating.
Does it have any effect on the actual usage of the proxy?
from goproxy.
No effect whatsoever, everything seems to work fine. Thanks for this great library btw!
from goproxy.
I have met the same bug. Functions defined in proxy.OnRequest().DoFunc() and proxy.OnResponse().DoFunc() would not be executed due to this bug.
from goproxy.
Thanks Lei.
How can I reproduce the bug?
On Aug 19, 2014 2:53 AM, "Lei Zhu" [email protected] wrote:
I have met the same bug. Functions defined in proxy.OnRequest().DoFunc()
and proxy.OnResponse().DoFunc() would not be executed due to this bug.—
Reply to this email directly or view it on GitHub
#48 (comment).
from goproxy.
Hi Elazar, I'm more than happy to share what I have so far.
package main
import (
"github.com/elazarl/goproxy"
"log"
"net/http"
)
func main() {
proxy := goproxy.NewProxyHttpServer()
proxy.Verbose = true
proxy.OnRequest().DoFunc(
func(r *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) {
log.Printf("inside the onRequest for proxy %s", r.RequestURI)
return r, nil
})
proxy.OnResponse().DoFunc(
func(resp *http.Response, ctx *goproxy.ProxyCtx) *http.Response {
log.Printf("inside the onResponse for proxy %s", resp.Request.URL)
return resp
})
log.Fatal(http.ListenAndServe(":2222", proxy))
}
Here are the steps
- execute
curl -x http://localhost:2222 "http://mobile.walmart.com/m/j?service=Vod&method=getVod&e=1&e=1&40cc=1"
, which is a http call, will execute OnRequest().DoFunc() and OnResponse().DoFunc() with no problem. - execute
curl -x http://localhost:2222 "https://mobile.walmart.com/m/j?service=Authentication&method=guestLogin&e=1"
, which is a https call with GET (...), will output a
2014/08/19 10:11:40 [005] INFO: Running 0 CONNECT handlers
2014/08/19 10:11:40 [005] INFO: Accepting CONNECT to mobile.walmart.com:443
2014/08/19 10:11:41 [005] WARN: Error copying to client read tcp 23.204.59.140:443: use of closed network connection
Notice that OnRequest().DoFunc() and OnResponse().DoFunc() are not executed.
Hope this would help.
from goproxy.
@archlichking Thanks. Sorry for not getting back to you earlier.
What you're describing is a different problem. In order to intercept https connections you must use MITM. See this example.
I still need to investigate the warning though, which is unrelated to the fact non-MITM https connections are not triggered.
from goproxy.
@ismail thanks for the bug report. Please let me know if it works better now.
from goproxy.
@elazarl Thanks for making this awesome library. MITM works perfectly for me.
from goproxy.
I still get this regularly - the error:
2015/06/23 00:15:44 [150] WARN: Error copying to client: use of closed network connection
from goproxy.
Related Issues (20)
- add method for ProxyHttpServer object
- How to prevent traffic from being swiped? HOT 1
- Facebook and Instagram apps fail to work through GoProxy HOT 1
- Deployment to AWS Lambda ?
- Release versions for go package HOT 2
- How to use code on win10 instead of manual to open the forward proxy Settings?
- An existing connection was forcibly closed by the remote host.
- How best to modify HTTP data and header order
- https blocking does not take effect HOT 3
- goproxy v1.1 was discovered to contain an issue which can lead to Denial of Service (DoS) via unspecified vectors HOT 2
- Cannot connect to HTTP websocket when performing TLS MitM
- 请求头参数大小写格式在哪转换的?
- Semicolon in URL query HOT 1
- Potential Typo in Request Handling - "r.Close" misset to False?
- Question about modifying requests
- Can we do URL A -> proxy A, URL B -> proxy B?
- Limit the number of goroutines HOT 1
- Contant HOT 1
- team.works, with community support
- updating expired certificate
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goproxy.