Re: [go-nuts] Tracking which connection is used to make an HTTP request

2022-10-30 Thread Christian Worm Mortensen
Hi Konstantin Thanks for the reply - this is exactly what I needed! It even seems like tls.Conn has a function NetConn that allows me to get my net.Conn back again. So for anyone stumbling on this in the future, I think this is the way to solve it: * Make the customer TLS dialer dial a TCP connec

Re: [go-nuts] Tracking which connection is used to make an HTTP request

2022-10-25 Thread Konstantin Khomoutov
On Tue, Oct 25, 2022 at 03:43:21PM +0400, Konstantin Khomoutov wrote: >> However, that does not work well for TLS. The reason is that the Go HTTP >> client has special logic in case a custom dialer returns a *tls.Conn. That >> logic will be disabled. > > The Conn funtion of the crypto/tls packa

Re: [go-nuts] Tracking which connection is used to make an HTTP request

2022-10-25 Thread Konstantin Khomoutov
On Wed, Oct 12, 2022 at 09:01:46AM -0700, Christian Worm Mortensen wrote: (I have rehashed the options you've presented, to help commenting on them.) [...] > 2) I can make a my own struct and return from my custom dialer: > > type myConn struct { > net.Conn > dialInfo string > } > > Howeve

[go-nuts] Tracking which connection is used to make an HTTP request

2022-10-12 Thread Christian Worm Mortensen
I have created an http.Client with a custom TLS dialer. The custom TLS dialer creates a *tls.Conn and while doing this, it logs out a lot of information such as which server is used. Now, when I make an HTTP request, I want to log out which dial produced the *tls.Conn the HTTP request ended up