Creating an http.RoundTripper which was in charge of delegating to an http.Transport as well as swapping out to a new http.Transport when you want to swap underlying connections is probably what I'd try first.
Cleaning up the old transport might be a little tricky if your application ever leaks http.Response.Body by not closing it appropriately, at which point you could also swap out the http.Transport.Dial functions with something which keep track of the underlying network connections. That would allow you to force-close them after some time out. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.