httpclient

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package httpclient builds outbound HTTP clients that own their transport.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLoopbackHost

func IsLoopbackHost(host string) bool

IsLoopbackHost reports whether host is a loopback IP literal; the only targets where TLS verification may be skipped (emulator-run backends; policy 2026-10-31).

func LoopbackDialer

func LoopbackDialer(allow func() bool, denied error) *net.Dialer

LoopbackDialer returns a dialer that refuses non-loopback peers unless allow reports true. The check runs on the resolved peer address, so a hostname that resolves elsewhere (or later rebinds) is refused.

func New

func New(timeout time.Duration) *http.Client

New returns a client with its own transport and the given timeout. Create it once per backend and reuse it so connections are pooled.

func NewTransport

func NewTransport() *http.Transport

NewTransport returns a clone of http.DefaultTransport that no other client shares, so CloseIdleConnections on the default transport (httptest.Server.Close) cannot reach it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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