Client Options
WithClientProfile configures a TLS client to use the specified client profile.WithForceHttp1 configures a client to force HTTP/1.1 as the used protocol.WithDisableHttp3 configures a client to disable HTTP 3 as the used protocol. Will most likely fall back to HTTP 2WithInsecureSkipVerify configures a client to skip SSL certificate verification.WithTransportOptions configures a client to use the specified transport options.WithProxyUrl configures a HTTP client to use the specified proxy URL. proxyUrl should be formatted as: "http://user:pass@host:port"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 usedWithCookieJar configures a HTTP client to use the specified cookie jar.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 additionWithTimeoutMilliseconds configures an HTTP client to use the specified request timeout. timeout is the request timeout in milliseconds.WithTimeoutSeconds configures an HTTP client to use the specified request timeout. timeout is the request timeout in seconds.WithTimeout configures an HTTP client to use the specified request timeout. timeout is the request timeout in seconds. Deprecated: use either WithTimeoutSeconds or WithTimeoutMillisecondsWithNotFollowRedirects configures an HTTP client to not follow HTTP redirects.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 CheckRedirectWithRandomTLSExtensionOrder 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.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.WithDebug configures a client to log debugging information.WithLocalAddr configures an HTTP client to use the specified local address.WithDisableIPV4 configures a dialer to use tcp6 network argumentWithDisableIPV6 configures a dialer to use tcp4 network argumentWithCatchPanics configures a client to catch all go panics happening during a request and not print the stacktrace.WithDefaultHeaders configures a client to use a set of default headers if none are specified on the request.WithConnectHeaders configures a client to use the specified headers for the CONNECT requestWithProtocolRacing 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.WithBandwidthTracker configures a client to track the bandwidth used by the client. You can retrieve the tracker via GetBandwidthTracker() and call GetTotalBandwidth(), GetWriteBytes(), GetReadBytes() or Reset() on it.WithDialer configures an HTTP client to use the specified dialer. This allows the use of a custom DNS resolver.WithProxyDialerFactory configures an HTTP client to use a custom proxyDialerFactory instead of the default newConnectDialer(). This allows to implement custom proxy dialer use cases.WithEnableEuckrResponse configures the client to decode the response body using EUC-KR encoding.
Shared Library & Standalone API
Last updated