httputil

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(proxyURL string, timeout time.Duration) *http.Client

NewClient creates an *http.Client with proxy and timeout configured.

func NewTransport

func NewTransport(proxyURL string) *http.Transport

NewTransport creates an http.Transport cloned from http.DefaultTransport with proxy configured. If proxyURL is empty, no proxy is set and Go's default behavior (HTTP_PROXY env var) applies. Invalid proxy URLs are silently ignored (proxy validation happens at the system settings layer).

func ResolveProxyURL

func ResolveProxyURL(urls ...string) string

ResolveProxyURL returns the first non-empty URL from the given list. Callers pass URLs in priority order (e.g., channel-level, DB setting, config file). Returns "" if all are empty, which tells Go's HTTP stack to fall back to the HTTP_PROXY / HTTPS_PROXY environment variables.

Types

This section is empty.

Jump to

Keyboard shortcuts

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