proxyx

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0 modules, 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 proxyx sends komando's HTTPS clients through the company proxy that the environment names (HTTPS_PROXY, HTTP_PROXY, NO_PROXY), as curl, kubectl and docker do. It also opens raw TCP tunnels through that proxy for the connections http.Transport does not make itself (stream upgrades, SSL VPN tunnels).

A connection that goes through a --via path never uses these proxies: the path is its way out.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(ctx context.Context, pick Func, dial Dialer, target *url.URL, addr string) (net.Conn, error)

Dial opens a TCP connection to addr (the host:port of target) through the proxy that pick chooses for target, or straight with dial when pick is nil or chooses none. dial also reaches the proxy.

func Parse

func Parse(raw string) (*url.URL, error)

Parse checks a proxy URL written in a config file, such as a kubeconfig's proxy-url.

Types

type Dialer

type Dialer = func(ctx context.Context, network, addr string) (net.Conn, error)

Dialer opens TCP connections.

type Func

type Func = func(*http.Request) (*url.URL, error)

Func picks the proxy for a request; a nil URL means none.

func FromEnv

func FromEnv() Func

FromEnv reads HTTPS_PROXY, HTTP_PROXY and NO_PROXY (or their lower-case names) now. Requests to this computer (localhost, 127.0.0.1, a tunnel's port) never use a proxy.

Directories

Path Synopsis
Package proxytest is a small HTTP CONNECT proxy for tests.
Package proxytest is a small HTTP CONNECT proxy for tests.

Jump to

Keyboard shortcuts

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