httpx

package
v0.0.1-beta.8 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: AGPL-3.0 Imports: 4 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 httpx 构造共享的上游 HTTP 客户端(规格 §10.2 连接层参数)。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(cfg TransportConfig) *http.Client

func NewTransport

func NewTransport(cfg TransportConfig) *http.Transport

Types

type TransportConfig

type TransportConfig struct {
	MaxIdleConns        int
	MaxIdleConnsPerHost int
	// MaxConnsPerHost 单 host 连接总数上限(含在用+空闲;0 = 不限)。
	// 网关既有 client 保持 0 不限(压测验证形态);SDK 适配层装配显式上界。
	MaxConnsPerHost int
	IdleConnTimeout time.Duration
	DialTimeout     time.Duration
	ForceHTTP2      bool
	// Proxy 上游请求代理函数(nil = 直连,默认)。不再隐式装配
	// http.ProxyFromEnvironment——HTTP_PROXY 设了会静默改道全部上游请求
	//(含 x-api-key/Authorization 凭据,WS 升级大概率失败),压测行为随
	// 环境漂移。装配方(main NewClient / codexAdapter 构造期 transport 两处)显式决定。
	Proxy func(*http.Request) (*url.URL, error)
}

Jump to

Keyboard shortcuts

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