Giter Site home page Giter Site logo

Comments (10)

galileox7 avatar galileox7 commented on September 27, 2024 1

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.

elazarl avatar elazarl commented on September 27, 2024

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.

ismail avatar ismail commented on September 27, 2024

No effect whatsoever, everything seems to work fine. Thanks for this great library btw!

from goproxy.

archlichking avatar archlichking commented on September 27, 2024

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.

elazarl avatar elazarl commented on September 27, 2024

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.

archlichking avatar archlichking commented on September 27, 2024

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

  1. 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.
  2. 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.

elazarl avatar elazarl commented on September 27, 2024

@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.

elazarl avatar elazarl commented on September 27, 2024

@ismail thanks for the bug report. Please let me know if it works better now.

from goproxy.

archlichking avatar archlichking commented on September 27, 2024

@elazarl Thanks for making this awesome library. MITM works perfectly for me.

from goproxy.

amlwwalker avatar amlwwalker commented on September 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.