aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/http/transport.go
diff options
context:
space:
mode:
authorSanskar Jaiswal <jaiswalsanskar078@gmail.com>2023-04-28 17:17:00 +0530
committerSanskar Jaiswal <jaiswalsanskar078@gmail.com>2023-05-04 11:53:09 +0530
commita830187d90a6bc36f9466c075ed49076f591efa9 (patch)
tree52c3450287073b3d8f65b2c001f9c7150cc66b9d /plumbing/transport/http/transport.go
parent399b1ec2d598b7950816727b8d92e8580553372c (diff)
downloadgo-git-a830187d90a6bc36f9466c075ed49076f591efa9.tar.gz
plumbing: transport/http, add support for custom proxy URLs
Add support for custom HTTP and HTTPS proxies for each session. The tests require server certificate and a matching private key to be able to run a TLS server and test HTTPS proxy functionality. The cert and the key are stored in `plumbing/transport/http/testdata/certs` and were generated using the following command: `openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt` Note: All details were left empty, except for the FQDN for which example.com was used. Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
Diffstat (limited to 'plumbing/transport/http/transport.go')
-rw-r--r--plumbing/transport/http/transport.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/plumbing/transport/http/transport.go b/plumbing/transport/http/transport.go
index cd6787a..052f3c8 100644
--- a/plumbing/transport/http/transport.go
+++ b/plumbing/transport/http/transport.go
@@ -2,6 +2,7 @@ package http
import (
"net/http"
+ "net/url"
)
// transportOptions contains transport specific configuration.
@@ -9,6 +10,7 @@ type transportOptions struct {
insecureSkipTLS bool
// []byte is not comparable.
caBundle string
+ proxyURL url.URL
}
func (c *client) addTransport(opts transportOptions, transport *http.Transport) {