code: func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) {
  	// Add reverse proxy headers.
  	forwardedURI := path.Join(t.PathPrepend, req.URL.Path)
  	if strings.HasSuffix(req.URL.Path, "/") {
  		forwardedURI = forwardedURI + "/"
  	}
  	req.Header.Set("X-Forwarded-Uri", forwardedURI)
  	if len(t.Host) > 0 {
  		req.Header.Set("X-Forwarded-Host", t.Host)
  	}
  	if len(t.Scheme) > 0 {
  		req.Header.Set("X-Forwarded-Proto", t.Scheme)
  	}
  
  	rt := t.RoundTripper
  	if rt == nil {
  		rt = http.DefaultTransport
  	}
  	resp, err := rt.RoundTrip(req)
  
  	if err != nil {
  		message := fmt.Sprintf("Error: '%s'\nTrying to reach: '%v'", err.Error(), req.URL.String())
  		resp = &http.Response{
  			StatusCode: http.StatusServiceUnavailable,
  			Body:       ioutil.NopCloser(strings.NewReader(message)),
  		}
  		return resp, nil
  	}
  
  	if redirect := resp.Header.Get("Location"); redirect != "" {
  		resp.Header.Set("Location", t.rewriteURL(redirect, req.URL, req.Host))
  		return resp, nil
  	}
  
  	cType := resp.Header.Get("Content-Type")
  	cType = strings.TrimSpace(strings.SplitN(cType, ";", 2)[0])
  	if cType != "text/html" {
  		// Do nothing, simply pass through
  		return resp, nil
  	}
  
  	return t.rewriteResponse(req, resp)
  }
docs: // RoundTrip implements the http.RoundTripper interface