proxy

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: AGPL-3.0 Imports: 7 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 proxy is an HTTP forward-proxy that answers requests for its archive's suite from memory and streams everything else to the real upstream archive. chisel reaches it via the http_proxy environment variable; this is the only lever, since chisel hardcodes archive.ubuntu.com and has no per-archive URL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

Proxy serves one archive and passes everything else through.

func New

func New(a *apt.Archive, logger *log.Logger) *Proxy

New builds a proxy for a. logger may be nil.

func (*Proxy) Counts

func (p *Proxy) Counts() (local, upstream int64)

Counts returns how many requests were served locally versus passed upstream.

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Proxy) Start

func (p *Proxy) Start(port int) (addr string, stop func() error, err error)

Start binds 127.0.0.1:port (0 = auto-pick) and serves in the background, returning the chosen host:port and a stop function.

Jump to

Keyboard shortcuts

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