aboutsummaryrefslogblamecommitdiffstats
path: root/plumbing/transport/client/example_test.go
blob: 3e7a4f06c65f0addf8f29562f96b15ea9b18a12b (plain) (tree)
1
2
3
4
5
6
7
8





                    

                                                                  












                                                                               
package client_test

import (
	"crypto/tls"
	"net/http"

	"gopkg.in/src-d/go-git.v4/plumbing/transport/client"
	githttp "gopkg.in/src-d/go-git.v4/plumbing/transport/http"
)

func ExampleInstallProtocol() {
	// Create custom net/http client that.
	httpClient := &http.Client{
		Transport: &http.Transport{
			TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
		},
	}

	// Install it as default client for https URLs.
	client.InstallProtocol("https", githttp.NewClient(httpClient))
}