()
| 20 | } |
| 21 | |
| 22 | func registerManagedHTTP() error { |
| 23 | globalRegisteredSmartTransports.Lock() |
| 24 | defer globalRegisteredSmartTransports.Unlock() |
| 25 | |
| 26 | for _, protocol := range []string{"http", "https"} { |
| 27 | if _, ok := globalRegisteredSmartTransports.transports[protocol]; ok { |
| 28 | continue |
| 29 | } |
| 30 | managed, err := newRegisteredSmartTransport(protocol, true, httpSmartSubtransportFactory, true) |
| 31 | if err != nil { |
| 32 | return fmt.Errorf("failed to register transport for %q: %v", protocol, err) |
| 33 | } |
| 34 | globalRegisteredSmartTransports.transports[protocol] = managed |
| 35 | } |
| 36 | return nil |
| 37 | } |
| 38 | |
| 39 | func httpSmartSubtransportFactory(remote *Remote, transport *Transport) (SmartSubtransport, error) { |
| 40 | var proxyFn func(*http.Request) (*url.URL, error) |
searching dependent graphs…