httpclient

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultHTTPClient = &http.Client{
	Transport: &http.Transport{
		DisableKeepAlives: true,
		Proxy: func(req *http.Request) (*url.URL, error) {
			req.Header.Set("User-Agent", version.UserAgent())
			return httpproxy.FromEnvironment().ProxyFunc()(req.URL)
		},
	},
}

DefaultHTTPClient is the default HTTP client used by the Unikraft CLI. It sets a custom User-Agent header and uses the environment's proxy settings, which allows for easy debugging.

View Source
var InsecureHTTPClient = &http.Client{
	Transport: &http.Transport{
		TLSClientConfig:   &tls.Config{InsecureSkipVerify: true},
		DisableKeepAlives: true,
		Proxy: func(req *http.Request) (*url.URL, error) {
			req.Header.Set("User-Agent", version.UserAgent())
			return httpproxy.FromEnvironment().ProxyFunc()(req.URL)
		},
	},
}

InsecureHTTPClient is an HTTP client that skips TLS verification. It is intended for use in development or testing environments where self-signed certificates may be used.

Functions

func GetClient added in v0.1.1

func GetClient(insecure bool) *http.Client

GetClient returns an HTTP client based on the provided insecure flag.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL