proxy

package
v0.0.0-...-2bc8f10 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: GPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SrcHTTPExplicit     string = "HTTP/EXPLI"
	SrcHTTPTransparent  string = "HTTP/TRANS"
	SrcHTTPSExplicit    string = "TLS/EXPLI "
	SrcHTTPSTransparent string = "TLS/TRANS "
)
View Source
const PREFIX = "---HTTP-RESPONSE---\n"

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(b []byte) (*http.Response, error)

func Serialize

func Serialize(resp *http.Response) ([]byte, error)

Serialize writes the http.Response to the given writer using gob encoding.

Types

type ConfigRule

type ConfigRule struct {
	config.CacheRule
}

ConfigRule implements Rule interface for config-based rules

func (*ConfigRule) Match

func (r *ConfigRule) Match(requ *http.Request, resp *http.Response) bool

Match checks if a request matches this rule

type ProxyResponse

type ProxyResponse struct {
	StatusCode int
	Headers    http.Header
	Body       []byte
}

ProxyResponse holds the response data from upstream

type Rule

type Rule interface {
	Match(requ *http.Request, resp *http.Response) bool
}

Rule interface for matching requests against caching rules

type Server

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

Server represents the caching proxy server

func New

func New(cfg *config.Config) (*Server, error)

New creates a new proxy server

func (*Server) GetProxy

func (s *Server) GetProxy() *goproxy.ProxyHttpServer

GetProxy returns the underlying goproxy instance for testing

func (*Server) Start

func (s *Server) Start() error

Start starts the proxy server

func (*Server) StartTransparentHTTPS

func (s *Server) StartTransparentHTTPS(httpsAddr string)

StartTransparentHTTPS enables transparent HTTPS proxying

Jump to

Keyboard shortcuts

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