How to get proxy info from client.Transport?

Viewed 22

I need to make logs with a proxy, from which I send requests. So, I have the following code:

proxy := fmt.Sprintf("%v", client.Transport)
log.Println("[GetRequest]Response status code &body response size.", proxy[19:69], response.StatusCode, len(body))

I know, that`s not correct, but how can I get only proxy. If I will make code like this:

fmt.Println(reflect.ValueOf(client.Transport))

Then you will get a full answer.

&{{0 0} false map[{http://login:paroleM@ip:port https www.example.com:443 false}:[0xc000480120 0xc00034e5a0]
0 Answers
Related