client

package module
v0.0.0-...-8bf568d Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 37 Imported by: 0

README

client godoc test Coverage Status Release License

Preface

This TLS Client is built upon https://github.com/Carcraftz/fhttp and https://github.com/Carcraftz/utls (https://github.com/refraction-networking/utls). Big thanks to all contributors so far. Sadly it seems that the original repositories from Carcraftz are not maintained anymore.

The module is published as github.com/malivvan/client.

What is TLS Fingerprinting?

Some people think it is enough to change the user-agent header of a request to let the server think that the client requesting a resource is a specific browser. Nowadays this is not enough, because the server might use a technique to detect the client browser which is called TLS Fingerprinting.

Even though this article is about TLS Fingerprinting in NodeJS it well describes the technique in general. https://httptoolkit.tech/blog/tls-fingerprinting-node-js/#how-does-tls-fingerprinting-work

Why is this library needed?

With this library you are able to create a http client implementing an interface which is similar to golangs net/http client interface. This TLS Client allows you to specify the Client (Browser and Version) you want to use, when requesting a server.

Features
  • HTTP/1.1, HTTP/2, HTTP/3 - Full protocol support with automatic negotiation
  • Protocol Racing - Chrome-like "Happy Eyeballs" for HTTP/2 vs HTTP/3
  • TLS Fingerprinting - Mimic Chrome, Firefox, Safari, and other browsers
  • HTTP/3 Fingerprinting - Accurate QUIC/HTTP/3 fingerprints matching real browsers
  • WebSocket Support - Browser-mimicking WebSocket connection establishment (uTLS fingerprint, header order, permessage-deflate), fully integrated into the HttpClient interface
  • WebTransport Support - HTTP/3 WebTransport sessions (streams + datagrams) whose QUIC connection establishment mimics the profile's browser
  • Custom Header Ordering - Control the order of HTTP headers
  • Proxy Support - HTTP and SOCKS5 proxies
  • Cookie Jar Management - Built-in cookie handling
  • Certificate Pinning - Enhanced security with custom certificate validation
  • Bandwidth Tracking - Monitor upload/download bandwidth
  • Language Bindings - Use from JavaScript (Node.js), Python, and C# via FFI

The HTTP, TLS and QUIC layers live in sibling modules under the same org (github.com/malivvan/http, github.com/malivvan/tls, github.com/malivvan/quic) so that the whole stack shares the same TLS fingerprinting machinery.

Interface

The HTTP Client interface extends the base net/http Client with additional functionality:

type HttpClient interface {
    GetCookies(u *url.URL) []*http.Cookie
    SetCookies(u *url.URL, cookies []*http.Cookie)
    SetCookieJar(jar http.CookieJar)
    GetCookieJar() http.CookieJar
    SetProxy(proxyUrl string) error
    GetProxy() string
    SetFollowRedirect(followRedirect bool)
    GetFollowRedirect() bool
    CloseIdleConnections()
    Do(req *http.Request) (*http.Response, error)
    Get(url string) (resp *http.Response, err error)
    Head(url string) (resp *http.Response, err error)
    Post(url, contentType string, body io.Reader) (resp *http.Response, err error)

    GetBandwidthTracker() BandwidthTracker
    GetDialer() proxy.ContextDialer
    GetTLSDialer() TLSDialerFunc

    AddPreRequestHook(hook PreRequestHookFunc)
    AddPostResponseHook(hook PostResponseHookFunc)
    ResetPreHooks()
    ResetPostHooks()

    DialWebSocket(ctx context.Context, url string, opts *websocket.DialOptions) (*websocket.Conn, *http.Response, error)
    DialWebTransport(ctx context.Context, url string, reqHdr http.Header) (*http.Response, *webtransport.Session, error)
}
Detailed Documentation

https://pkg.go.dev/github.com/malivvan/client

Quick Usage Example
package main

import (
	"fmt"
	"io"
	"log"

	"github.com/malivvan/http"
	client "github.com/malivvan/client"
	"github.com/malivvan/client/profiles"
)

func main() {
	jar := client.NewCookieJar()
	options := []client.HttpClientOption{
		client.WithTimeoutSeconds(30),
		client.WithClientProfile(profiles.Chrome_144),
		client.WithNotFollowRedirects(),
		client.WithCookieJar(jar), // create cookieJar instance and pass it as argument
	}

	client, err := client.NewHttpClient(client.NewNoopLogger(), options...)
	if err != nil {
		log.Println(err)
		return
	}

	req, err := http.NewRequest(http.MethodGet, "https://tls.peet.ws/api/all", nil)
	if err != nil {
		log.Println(err)
		return
	}

	req.Header = http.Header{
		"accept":                    {"*/*"},
		"accept-language":           {"de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7"},
		"user-agent":                {"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"},
		http.HeaderOrderKey: {
			"accept",
			"accept-language",
			"user-agent",
		},
	}

	resp, err := client.Do(req)
	if err != nil {
		log.Println(err)
		return
	}

	defer resp.Body.Close()

	log.Println(fmt.Sprintf("status code: %d", resp.StatusCode))

	readBytes, err := io.ReadAll(resp.Body)
	if err != nil {
		log.Println(err)
		return
	}

	log.Println(string(readBytes))
}
WebSocket Usage

WebSocket connections are established directly through the HttpClient and inherit its full browser-mimicry configuration: the uTLS ClientHello fingerprint for the TLS handshake, the browser's handshake header order, the Sec-WebSocket-Extensions value and the permessage-deflate compression mode come from the client profile (Chrome writes lowercase host first, Firefox/Safari write Host first, etc.).

package main

import (
	"context"
	"log"

	"github.com/malivvan/http"
	"github.com/malivvan/http/websocket"
	client "github.com/malivvan/client"
	"github.com/malivvan/client/profiles"
)

func main() {
	client, err := client.NewHttpClient(nil,
		client.WithClientProfile(profiles.Chrome_133),
	)
	if err != nil {
		log.Fatal(err)
	}

	// opts may be nil: unset fields are filled from the client configuration.
	conn, resp, err := client.DialWebSocket(context.Background(), "wss://example.com/ws", &websocket.DialOptions{
		HTTPHeader: http.Header{
			"User-Agent": {"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"},
			"Origin":     {"https://example.com"},
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	defer conn.Close(websocket.StatusNormalClosure, "")

	_ = resp // WebSocket handshake response; its body must not be used.

	if err := conn.Write(context.Background(), websocket.MessageText, []byte("hello")); err != nil {
		log.Fatal(err)
	}

	typ, msg, err := conn.Read(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("received %s: %s", typ, msg)
}
WebTransport Usage

WebTransport sessions (HTTP/3 CONNECT) are also established through the HttpClient. The QUIC connection establishment mimics the profile's browser: the uTLS ClientHello is applied inside the QUIC handshake, so servers see the same TLS-level fingerprint as the real browser. Datagrams and stream-reset partial delivery are enabled as WebTransport requires.

package main

import (
	"context"
	"io"
	"log"

	"github.com/malivvan/http"
	client "github.com/malivvan/client"
	"github.com/malivvan/client/profiles"
)

func main() {
	client, err := client.NewHttpClient(nil,
		client.WithClientProfile(profiles.Chrome_133),
		client.WithInsecureSkipVerify(), // for local/self-signed WebTransport servers
	)
	if err != nil {
		log.Fatal(err)
	}

	resp, session, err := client.DialWebTransport(context.Background(),
		"https://example.com/webtransport",
		http.Header{"Origin": {"https://example.com"}},
	)
	if err != nil {
		log.Fatal(err)
	}
	defer session.CloseWithError(0, "")

	_ = resp // CONNECT response; its body must not be used.

	// Bidirectional stream (echo pattern).
	str, err := session.OpenStreamSync(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	if _, err := str.Write([]byte("hello webtransport")); err != nil {
		log.Fatal(err)
	}
	str.Close()
	echoed, err := io.ReadAll(str)
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("echoed: %s", echoed)

	// Datagrams.
	if err := session.SendDatagram([]byte("ping")); err != nil {
		log.Fatal(err)
	}
	pong, err := session.ReceiveDatagram(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("pong: %s", pong)
}
Questions?

Open an issue at https://github.com/malivvan/client/issues

Documentation

Index

Constants

View Source
const CHROME_MAX_FIELD_SECTION_SIZE = 262144

Variables

View Source
var DefaultBadPinHandler = func(req *http.Request) {
	fmt.Println("this is the default bad pin handler")
}
View Source
var DefaultTimeoutSeconds = 30
View Source
var ErrBadPinDetected = errors.New("bad ssl pin detected")
View Source
var ErrContinueHooks = errors.New("continue hooks")

ErrContinueHooks can be returned (or wrapped) by a PreRequestHookFunc to signal that the error should be logged but hook execution should continue to the next hook. By default any error returned from a hook aborts subsequent hooks and the request.

View Source
var H2SettingsMap = map[string]http2.SettingID{
	"HEADER_TABLE_SIZE":      http2.SettingHeaderTableSize,
	"ENABLE_PUSH":            http2.SettingEnablePush,
	"MAX_CONCURRENT_STREAMS": http2.SettingMaxConcurrentStreams,
	"INITIAL_WINDOW_SIZE":    http2.SettingInitialWindowSize,
	"MAX_FRAME_SIZE":         http2.SettingMaxFrameSize,
	"MAX_HEADER_LIST_SIZE":   http2.SettingMaxHeaderListSize,
	"UNKNOWN_SETTING_7":      0x7,
	"UNKNOWN_SETTING_8":      0x8,
	"UNKNOWN_SETTING_9":      0x9,
}
View Source
var H3SettingsMap = map[string]uint64{
	"QPACK_MAX_TABLE_CAPACITY": 0x1,
	"MAX_FIELD_SECTION_SIZE":   0x6,
	"QPACK_BLOCKED_STREAMS":    0x7,
	"H3_DATAGRAM":              0x33,
}

Functions

func GetSpecFactoryFromJa3String

func GetSpecFactoryFromJa3String(ja3String string, supportedSignatureAlgorithms, supportedDelegatedCredentialsAlgorithms, supportedVersions, keyShareCurves, supportedProtocolsALPN, supportedProtocolsALPS []string, echCandidateCipherSuites []CandidateCipherSuites, candidatePayloads []uint16, certCompressionAlgorithms []string, recordSizeLimit uint16) (func() (tls.ClientHelloSpec, error), error)

func Int64ToInt

func Int64ToInt(x int64) (int, error)

Types

type BadPinHandlerFunc

type BadPinHandlerFunc func(req *http.Request)

type BandwidthTracker

type BandwidthTracker interface {
	Reset()
	GetTotalBandwidth() int64
	GetWriteBytes() int64
	GetReadBytes() int64
	TrackConnection(ctx context.Context, conn net.Conn) net.Conn
}

type CandidateCipherSuites

type CandidateCipherSuites struct {
	KdfId  string
	AeadId string
}

type CertificatePinner

type CertificatePinner interface {
	Pin(conn *tls.UConn, host string) error
}

func NewCertificatePinner

func NewCertificatePinner(certificatePins map[string][]string) (CertificatePinner, error)

type ContextKeyHeader

type ContextKeyHeader struct{}

Users of context.WithValue should define their own types for keys

type CookieJar

type CookieJar interface {
	http.CookieJar
	GetAllCookies() map[string][]*http.Cookie
}

func NewCookieJar

func NewCookieJar(options ...CookieJarOption) CookieJar

type CookieJarOption

type CookieJarOption func(config *cookieJarConfig)

func WithAllowEmptyCookies

func WithAllowEmptyCookies() CookieJarOption

func WithDebugLogger

func WithDebugLogger() CookieJarOption

func WithLogger

func WithLogger(logger Logger) CookieJarOption

func WithSkipExisting

func WithSkipExisting() CookieJarOption

type HttpClient

type HttpClient interface {
	GetCookies(u *url.URL) []*http.Cookie
	SetCookies(u *url.URL, cookies []*http.Cookie)
	SetCookieJar(jar http.CookieJar)
	GetCookieJar() http.CookieJar
	SetProxy(proxyUrl string) error
	GetProxy() string
	SetFollowRedirect(followRedirect bool)
	GetFollowRedirect() bool
	CloseIdleConnections()
	Do(req *http.Request) (*http.Response, error)
	Get(url string) (resp *http.Response, err error)
	Head(url string) (resp *http.Response, err error)
	Post(url, contentType string, body io.Reader) (resp *http.Response, err error)

	GetBandwidthTracker() BandwidthTracker
	GetDialer() proxy.ContextDialer
	GetTLSDialer() TLSDialerFunc

	AddPreRequestHook(hook PreRequestHookFunc)
	AddPostResponseHook(hook PostResponseHookFunc)
	ResetPreHooks()
	ResetPostHooks()

	// DialWebSocket establishes a WebSocket connection whose connection
	// establishment mimics the client profile's browser (uTLS ClientHello
	// fingerprint, handshake header order, Sec-WebSocket-Extensions and
	// permessage-deflate compression). opts may be nil; unset fields are
	// filled from the client's configuration.
	DialWebSocket(ctx context.Context, url string, opts *websocket.DialOptions) (*websocket.Conn, *http.Response, error)

	// DialWebTransport establishes a WebTransport session (HTTP/3 CONNECT)
	// whose connection establishment mimics the client profile's browser
	// (uTLS ClientHello fingerprint inside the QUIC handshake, HTTP/3
	// settings and WebTransport application protocols).
	DialWebTransport(ctx context.Context, url string, reqHdr http.Header) (*http.Response, *webtransport.Session, error)
}

func NewHttpClient

func NewHttpClient(logger Logger, options ...HttpClientOption) (HttpClient, error)

NewHttpClient constructs a new HTTP client with the given logger and client options.

func ProvideDefaultClient

func ProvideDefaultClient(logger Logger) (HttpClient, error)

type HttpClientOption

type HttpClientOption func(config *httpClientConfig)

func WithBandwidthTracker

func WithBandwidthTracker() HttpClientOption

WithBandwidthTracker configures a client to track the bandwidth used by the client.

func WithCatchPanics

func WithCatchPanics() HttpClientOption

WithCatchPanics configures a client to catch all go panics happening during a request and not print the stacktrace.

func WithCertificatePinning

func WithCertificatePinning(certificatePins map[string][]string, handlerFunc BadPinHandlerFunc) HttpClientOption

WithCertificatePinning enables SSL Pinning for the client and will throw an error if the SSL Pin is not matched. Please refer to https://github.com/tam7t/hpkp/#examples in order to see how to generate pins. The certificatePins are a map with the host as key. You can provide a BadPinHandlerFunc or nil as second argument. This function will be executed once a bad ssl pin is detected. BadPinHandlerFunc has to be defined like this: func(req *http.Request){}

func WithCharlesProxy

func WithCharlesProxy(host string, port string) HttpClientOption

WithCharlesProxy configures the HTTP client to use a local running charles as proxy.

host and port can be empty, then default 127.0.0.1 and port 8888 will be used

func WithClientProfile

func WithClientProfile(clientProfile profiles.ClientProfile) HttpClientOption

WithClientProfile configures a TLS client to use the specified client profile.

func WithConnectHeaders

func WithConnectHeaders(headers http.Header) HttpClientOption

WithConnectHeaders configures a client to use the specified headers for the CONNECT request.

func WithCookieJar

func WithCookieJar(jar http.CookieJar) HttpClientOption

WithCookieJar configures a HTTP client to use the specified cookie jar.

func WithCustomRedirectFunc

func WithCustomRedirectFunc(redirectFunc func(req *http.Request, via []*http.Request) error) HttpClientOption

WithCustomRedirectFunc configures an HTTP client to use a custom redirect func. The redirect func have to look like that: func(req *http.Request, via []*http.Request) error Please only provide a custom redirect function if you know what you are doing. Check docs on net/http.Client CheckRedirect

func WithDebug

func WithDebug() HttpClientOption

WithDebug configures a client to log debugging information.

func WithDefaultHeaders

func WithDefaultHeaders(defaultHeaders http.Header) HttpClientOption

WithDefaultHeaders configures a TLS client to use a set of default headers if none are specified on the request.

func WithDialContext

func WithDialContext(dialContext func(ctx context.Context, network, addr string) (net.Conn, error)) HttpClientOption

WithDialContext sets a custom dialer for TCP connections, allowing advanced networking (Zero-DNS, socket tagging, DPI bypass).

WARNING: This overrides built-in proxy settings. If you need a proxy, you must handle the CONNECT handshake manually. CHECK: https://github.com/bogdanfinn/tls-client/pull/218#issuecomment-3858171801

func WithDialer

func WithDialer(dialer net.Dialer) HttpClientOption

WithDialer configures an HTTP client to use the specified dialer. This allows the use of a custom DNS resolver

func WithDisableHttp3

func WithDisableHttp3() HttpClientOption

WithDisableHttp3 configures a client to disable HTTP 3 as the used protocol. Will most likely fall back to HTTP 2

func WithDisableIPV4

func WithDisableIPV4() HttpClientOption

WithDisableIPV4 configures a dialer to use tcp6 network argument

func WithDisableIPV6

func WithDisableIPV6() HttpClientOption

WithDisableIPV6 configures a dialer to use tcp4 network argument

func WithForceHttp1

func WithForceHttp1() HttpClientOption

WithForceHttp1 configures a client to force HTTP/1.1 as the used protocol.

func WithInsecureSkipVerify

func WithInsecureSkipVerify() HttpClientOption

WithInsecureSkipVerify configures a client to skip SSL certificate verification.

func WithLocalAddr

func WithLocalAddr(localAddr net.TCPAddr) HttpClientOption

WithLocalAddr configures an HTTP client to use the specified local address.

func WithNotFollowRedirects

func WithNotFollowRedirects() HttpClientOption

WithNotFollowRedirects configures an HTTP client to not follow HTTP redirects.

func WithPostHook

func WithPostHook(hook PostResponseHookFunc) HttpClientOption

WithPostHook adds a post-response hook that is called after each request completes. Multiple hooks can be added and they will be executed in the order they were added. All hooks are always executed, even if the request failed or a previous hook panicked.

func WithPreHook

func WithPreHook(hook PreRequestHookFunc) HttpClientOption

WithPreHook adds a pre-request hook that is called before each request is sent. Multiple hooks can be added and they will be executed in the order they were added. If any hook returns an error, the request is aborted and subsequent hooks are not called.

func WithProtocolRacing

func WithProtocolRacing() HttpClientOption

WithProtocolRacing configures a client to race HTTP/3 (QUIC) and HTTP/2 (TCP) connections in parallel. Similar to Chrome's "Happy Eyeballs" approach, this starts both connection types simultaneously and uses whichever connects first. The client will remember which protocol worked for each host and use it directly on subsequent requests. This option is ignored if WithForceHttp1 or WithDisableHttp3 is set.

func WithProxyDialerFactory

func WithProxyDialerFactory(proxyDialerFactory ProxyDialerFactory) HttpClientOption

WithProxyDialerFactory configures an HTTP client to use a custom proxyDialerFactory instead of newConnectDialer(). This allows to implement custom proxy dialer use cases

func WithProxyUrl

func WithProxyUrl(proxyUrl string) HttpClientOption

WithProxyUrl configures an HTTP client to use the specified proxy URL.

proxyUrl should be formatted as:

"http://user:pass@host:port"

func WithRandomTLSExtensionOrder

func WithRandomTLSExtensionOrder() HttpClientOption

WithRandomTLSExtensionOrder configures a TLS client to randomize the order of TLS extensions being sent in the ClientHello.

Placement of GREASE and padding is fixed and will not be affected by this.

func WithServerNameOverwrite

func WithServerNameOverwrite(serverName string) HttpClientOption

WithServerNameOverwrite configures a TLS client to overwrite the server name being used for certificate verification and in the client hello. This option does only work properly if WithInsecureSkipVerify is set to true in addition

func WithTimeout

func WithTimeout(timeout int) HttpClientOption

WithTimeout configures an HTTP client to use the specified request timeout.

timeout is the request timeout in seconds. Deprecated: use either WithTimeoutSeconds or WithTimeoutMilliseconds

func WithTimeoutMilliseconds

func WithTimeoutMilliseconds(timeout int) HttpClientOption

WithTimeoutMilliseconds configures a hard deadline for the entire request lifecycle.

This includes connection time, redirects, and reading the response body. WARNING: If the timer expires, the connection is forcibly closed, even if you are actively downloading data.

- Use 0 to disable the deadline (Unlimited) for large downloads or long-polling. - Default is 30000 milliseconds (30 seconds).

func WithTimeoutSeconds

func WithTimeoutSeconds(timeout int) HttpClientOption

WithTimeoutSeconds configures a hard deadline for the entire request lifecycle.

This includes connection time, redirects, and reading the response body. WARNING: If the timer expires, the connection is forcibly closed, even if you are actively downloading data.

- Use 0 to disable the deadline (Unlimited) for large downloads or long-polling. - Default is 30 seconds.

func WithTransportOptions

func WithTransportOptions(transportOptions *TransportOptions) HttpClientOption

WithTransportOptions configures a client to use the specified transport options.

type Logger

type Logger interface {
	Debug(format string, args ...any)
	Info(format string, args ...any)
	Warn(format string, args ...any)
	Error(format string, args ...any)
}

func NewDebugLogger

func NewDebugLogger(logger Logger) Logger

func NewLogger

func NewLogger() Logger

func NewNoopLogger

func NewNoopLogger() Logger

type NopeTracker

type NopeTracker struct {
}

func NewNopeTracker

func NewNopeTracker() *NopeTracker

func (*NopeTracker) GetReadBytes

func (bt *NopeTracker) GetReadBytes() int64

func (*NopeTracker) GetTotalBandwidth

func (bt *NopeTracker) GetTotalBandwidth() int64

func (*NopeTracker) GetWriteBytes

func (bt *NopeTracker) GetWriteBytes() int64

func (*NopeTracker) Reset

func (bt *NopeTracker) Reset()

func (*NopeTracker) TrackConnection

func (bt *NopeTracker) TrackConnection(ctx context.Context, conn net.Conn) net.Conn

type PostResponseContext

type PostResponseContext struct {
	Request  *http.Request
	Response *http.Response
	Error    error // Non-nil if request failed
}

PostResponseContext contains response metadata for PostHook handlers.

type PostResponseHookFunc

type PostResponseHookFunc func(ctx *PostResponseContext) error

PostResponseHookFunc is called after each request completes. Return an error to abort subsequent hooks, or wrap ErrContinueHooks to log and continue.

type PreRequestHookFunc

type PreRequestHookFunc func(req *http.Request) error

PreRequestHookFunc is called before each request is sent. Return an error to abort the request, or wrap ErrContinueHooks to log and continue.

type ProxyDialerFactory

type ProxyDialerFactory func(proxyUrlStr string, timeout time.Duration, localAddr *net.TCPAddr, connectHeaders http.Header, logger Logger) (proxy.ContextDialer, error)

type TLSDialerFunc

type TLSDialerFunc func(ctx context.Context, network, addr string) (net.Conn, error)

TLSDialerFunc is a function that dials a TLS connection to the given address. It's used for WebSocket connections to ensure they use the same TLS fingerprinting as regular HTTP requests.

type TrackedConn

type TrackedConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*TrackedConn) Read

func (bt *TrackedConn) Read(p []byte) (n int, err error)

func (*TrackedConn) Write

func (bt *TrackedConn) Write(p []byte) (n int, err error)

type Tracker

type Tracker struct {
	// contains filtered or unexported fields
}

func NewTracker

func NewTracker() *Tracker

func (*Tracker) GetReadBytes

func (bt *Tracker) GetReadBytes() int64

func (*Tracker) GetTotalBandwidth

func (bt *Tracker) GetTotalBandwidth() int64

func (*Tracker) GetWriteBytes

func (bt *Tracker) GetWriteBytes() int64

func (*Tracker) Reset

func (bt *Tracker) Reset()

func (*Tracker) TrackConnection

func (bt *Tracker) TrackConnection(ctx context.Context, conn net.Conn) net.Conn

type TransportOptions

type TransportOptions struct {
	// KeyLogWriter is an io.Writer that the TLS client will use to write the
	// TLS master secrets to. This can be used to decrypt TLS connections in
	// Wireshark and other applications.
	KeyLogWriter io.Writer
	// IdleConnTimeout is the maximum amount of time an idle (keep-alive)
	// connection will remain idle before closing itself. Zero means no limit.
	IdleConnTimeout *time.Duration
	// RootCAs is the set of root certificate authorities used to verify
	// the remote server's certificate.
	RootCAs                *x509.CertPool
	Certificates           []tls.Certificate
	MaxIdleConns           int
	MaxIdleConnsPerHost    int
	MaxConnsPerHost        int
	MaxResponseHeaderBytes int64 // Zero means to use a default limit.
	WriteBufferSize        int   // If zero, a default (currently 4KB) is used.
	ReadBufferSize         int   // If zero, a default (currently 4KB) is used.
	DisableKeepAlives      bool
	DisableCompression     bool
}

Directories

Path Synopsis
examples
complex command
simple command

Jump to

Keyboard shortcuts

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