proxy

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: Apache-2.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 implements the drop-in HTTP proxy mode:

squoze proxy --port 8787 --upstream https://api.anthropic.com

Contract: squoze never breaks a request. If the engine panics or the body is unreadable, the original bytes go upstream unchanged (fail-open).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(upstream *url.URL) http.Handler

New returns an http.Handler that optimizes request bodies and forwards everything else verbatim to upstream, using the default engine.

Types

type Server

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

Server is the squoze HTTP proxy bound to one engine instance.

func NewWithEngine

func NewWithEngine(upstream *url.URL, eng *engine.Engine) *Server

NewWithEngine binds the proxy to a specific engine (memo + originals shared across requests). A nil engine selects the package default.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the proxy pipeline.

Jump to

Keyboard shortcuts

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