proxy

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package proxy implements the LLM gateway localhost reverse proxy.

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 is a localhost reverse proxy that strips incoming Authorization headers and injects fresh OIDC tokens before forwarding to the LLM gateway.

func New

func New(cfg *llm.Config, ts TokenSource) (*Proxy, error)

New creates a Proxy and binds the TCP listener immediately so that Addr() returns the correct address before Start is called. Returns an error if GatewayURL is unparsable, the listen address is not loopback, or the port is already in use.

func (*Proxy) Addr

func (p *Proxy) Addr() string

Addr returns the actual bound listen address (e.g. "127.0.0.1:14000").

func (*Proxy) Start

func (p *Proxy) Start(ctx context.Context) error

Start begins serving using the listener bound in New. It blocks until ctx is cancelled, then performs a graceful shutdown with a 5-second timeout.

type TokenSource

type TokenSource interface {
	Token(ctx context.Context) (string, error)
}

TokenSource obtains fresh OIDC access tokens for the LLM gateway. *llm.TokenSource satisfies this interface.

Jump to

Keyboard shortcuts

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