httptransport

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package httptransport provides reusable HTTP client transport helpers for proxy-aware scraping runtimes.

Index

Constants

View Source
const DefaultTimeout = 15 * time.Second

DefaultTimeout is used when a client timeout is not explicitly provided.

Variables

This section is empty.

Functions

func IsSOCKSProxy

func IsSOCKSProxy(rawProxyURL string) bool

IsSOCKSProxy reports whether a proxy URL uses a supported SOCKS scheme.

func NewClient

func NewClient(httpProfile Profile, timeout time.Duration) (*http.Client, error)

NewClient builds an HTTP client bound to one transport profile.

func TimeoutOrDefault

func TimeoutOrDefault(timeout time.Duration) time.Duration

TimeoutOrDefault returns DefaultTimeout when timeout is not positive.

Types

type Profile

type Profile struct {
	ID               string
	Provider         string
	URL              string
	IgnoreCertErrors bool
}

Profile describes how to build an HTTP client transport.

func InferProfile

func InferProfile(rawProxyURL string, ignoreCertErrors bool) (Profile, error)

InferProfile derives an HTTP transport profile from a raw proxy URL.

func NormalizeProfile

func NormalizeProfile(httpProfile Profile) (Profile, error)

NormalizeProfile trims and validates a profile before it is used to build a client.

Jump to

Keyboard shortcuts

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