Versions in this module Expand all Collapse all v0 v0.1.0 Mar 6, 2026 Changes in this version + var BufferPool = newBufferPool() + var RequestPluginRegistry = map[string]RequestPlugin + var ResponsePluginRegistry = map[string]ResponsePlugin + func GetBuffer() *bytes.Buffer + func NormalizeURL(u string) string + func PutBuffer(buf *bytes.Buffer) + func RegisterPlugin(plugin RequestPlugin) + func RegisterResponsePlugin(plugin ResponsePlugin) + type CertCache struct + func NewCertCache(ttl time.Duration, maxSize int) *CertCache + func (c *CertCache) Get(host string) (*tls.Certificate, bool) + func (c *CertCache) Set(host string, cert *tls.Certificate) + type ChatCompletionChunk struct + Choices []struct{ ... } + Created int64 + ID string + Model string + Object string + Usage map[string]interface{} + type ChatCompletionRequest struct + MaxCompletionTokens int + MaxTokens int + Messages []interface{} + Model string + N *int + ResponseFormat *ChatResponseFormat + Stream bool + Temperature *float64 + ToolChoice interface{} + Tools []interface{} + TopP *float64 + type ChatCompletionResponse struct + Choices []struct{ ... } + Created int64 + ID string + Model string + Object string + Usage map[string]interface{} + type ChatResponseFormat struct + JSONSchema map[string]interface{} + Type string + type ChunkTool struct + Function struct{ ... } + ID string + Index int + Type string + type CodexFixPlugin struct + TargetModel string + func (c *CodexFixPlugin) Name() string + func (c *CodexFixPlugin) ProcessRequest(req *http.Request) error + type Content struct + Text string + Type string + type ContentPart struct + Index int + Text string + Type string + type HeaderRewriter struct + HeaderName string + HeaderValue string + func NewHeaderRewriter(name, value string) *HeaderRewriter + func (r *HeaderRewriter) Rewrite(req *http.Request) + type Item struct + Arguments string + CallID string + Content []Content + ID string + Name string + Role string + Status string + Type string + type OpenAIResponsesPlugin struct + func (p *OpenAIResponsesPlugin) Name() string + func (p *OpenAIResponsesPlugin) ProcessRequest(req *http.Request) error + func (p *OpenAIResponsesPlugin) ProcessResponse(resp *http.Response, ctx *goproxy.ProxyCtx, verbose bool) error + type ProxyRule struct + Matchers []URLMatcher + Name string + Plugins []RequestPlugin + ResponsePlugins []ResponsePlugin + Rewriters []*HeaderRewriter + type ProxyServer struct + DumpTraffic bool + Logger *log.Logger + Port int + Rules []*ProxyRule + UpstreamProxy string + Verbose bool + func NewProxyServer(port int, upstream string, verbose bool, logger *log.Logger) *ProxyServer + func (s *ProxyServer) AddMatcher(matcher URLMatcher) + func (s *ProxyServer) AddPlugin(plugin RequestPlugin) + func (s *ProxyServer) AddResponsePlugin(plugin ResponsePlugin) + func (s *ProxyServer) AddRewriter(rewriter *HeaderRewriter) + func (s *ProxyServer) AddRule(rule *ProxyRule) + func (s *ProxyServer) ShouldMITM(host string) bool + func (s *ProxyServer) Start() error + func (s *ProxyServer) Stop() error + type RegexMatcher struct + Pattern *regexp.Regexp + func NewRegexMatcher(pattern string) (*RegexMatcher, error) + func (m *RegexMatcher) Match(url string) bool + type RequestPlugin interface + Name func() string + ProcessRequest func(req *http.Request) error + func GetPlugin(fullName string) (RequestPlugin, error) + type ResponseFmt struct + JSONSchema map[string]interface{} + Type string + type ResponsePlugin interface + Name func() string + ProcessResponse func(resp *http.Response, ctx *goproxy.ProxyCtx, verbose bool) error + func GetResponsePlugin(fullName string) (ResponsePlugin, error) + type ResponsesAPIEvent struct + ContentPart *ContentPart + ContentPartIndex int + Delta string + Item *Item + ItemID string + OutputIndex int + Response *ResponsesAPIResponse + ResponseID string + SequenceNumber int + Type string + Usage interface{} + type ResponsesAPIPlugin struct + func (p *ResponsesAPIPlugin) Name() string + func (p *ResponsesAPIPlugin) ProcessRequest(req *http.Request) error + func (p *ResponsesAPIPlugin) ProcessResponse(resp *http.Response, ctx *goproxy.ProxyCtx, verbose bool) error + type ResponsesAPIRequest struct + Input []interface{} + Instructions string + MaxOutputTokens int + Model string + N *int + ResponseFormat *ResponseFmt + Stream bool + Temperature *float64 + ToolChoice interface{} + Tools []interface{} + TopP *float64 + type ResponsesAPIResponse struct + CreatedAt int64 + ID string + Model string + Object string + Output []Item + Usage interface{} + type StringMatcher struct + Pattern string + func NewStringMatcher(pattern string) *StringMatcher + func (m *StringMatcher) Match(url string) bool + type URLMatcher interface + Match func(url string) bool