Code Monkey home page Code Monkey logo

Comments (8)

tcnksm avatar tcnksm commented on May 25, 2024

Thank you for submitting issue. Let me run your code and investigate.

from go-httpstat.

tcnksm avatar tcnksm commented on May 25, 2024

Basically, there are 2 problems.

One is it shows non-zero time.Duration(9223372036854). The other is Proxy time problem.

Let's solve one by one. The first problem is because you old Dial. httptrace is enabled when you use DialContext. Could you update your code to use newer function?

And now I fix not to show non-zero time.Duration(9223372036854) on #5

from go-httpstat.

dewey avatar dewey commented on May 25, 2024

I updated the http.Transport to use the new DialContext and updated go-httpstat to the latest version but the result still doesn't look right. Can you replicate this problem?

    t := &http.Transport{
        DialContext: (&net.Dialer{
            Timeout: 5 * time.Second,
        }).DialContext,
        TLSHandshakeTimeout: 5 * time.Second,
        Proxy:               http.ProxyURL(u),
    }
    c := &http.Client{
        Timeout:   time.Second * 10,
        Transport: t,
    }

Result:

2016/10/21 11:08:51 DNS lookup: 0 ms
2016/10/21 11:08:51 TCP connection: 582 ms
2016/10/21 11:08:51 TLS handshake: 0 ms
2016/10/21 11:08:51 Server processing: 98 ms
2016/10/21 11:08:51 Content transfer: 0 ms
2016/10/21 11:08:51 Name Lookup: 0 ms
2016/10/21 11:08:51 Connect: 9223372036854 ms
2016/10/21 11:08:51 Pre Transfer: 9223372036854 ms
2016/10/21 11:08:51 Start Transfer: 9223372036854 ms
2016/10/21 11:08:51 Total: 9223372036854 ms

from go-httpstat.

tcnksm avatar tcnksm commented on May 25, 2024

I reproduced it and found it's because of DNSLookup part.
Fix is on feature/when-connecting-ip-proxy branch. Can you try it ?

from go-httpstat.

tcnksm avatar tcnksm commented on May 25, 2024

I will merge. Report again if still broken.

from go-httpstat.

dewey avatar dewey commented on May 25, 2024

Sorry for the late reply, this fixed the issue. Thanks!

from go-httpstat.

tcnksm avatar tcnksm commented on May 25, 2024

Great! Thank you for reporting !

from go-httpstat.

ysb avatar ysb commented on May 25, 2024

Hi, i'm getting same error on aws lambda, it works fine on my local env, but having issue on lambda. Do you have any idea about that?

Thanks.

from go-httpstat.

Related Issues (10)

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.