server

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v0.5.1

type Option func(*options)

Option customizes server creation.

func WithCopilotHeaderConfig added in v0.5.1

func WithCopilotHeaderConfig(cfg proxy.CopilotHeaderConfig) Option

WithCopilotHeaderConfig overrides the synthetic Copilot-identifying headers sent on upstream requests.

func WithProxyOptions added in v0.5.1

func WithProxyOptions(opts ...proxy.Option) Option

WithProxyOptions forwards proxy-level options to the underlying handler.

func WithResponsesWebSocketConfig added in v0.6.0

func WithResponsesWebSocketConfig(cfg proxy.ResponsesWebSocketConfig) Option

WithResponsesWebSocketConfig overrides websocket-session handling for GET /v1/responses Codex clients.

type Server

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

Server encapsulates the HTTP server lifecycle.

func New

func New(authenticator *auth.Authenticator, log *logger.Logger, host, port string, opts ...Option) *Server

New creates a Server with routes and timeouts configured.

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the listen address.

func (*Server) IsRunning

func (s *Server) IsRunning() bool

IsRunning returns whether the server is currently running.

func (*Server) Start

func (s *Server) Start() error

Start begins listening in a goroutine. It returns an error if the listener cannot be established.

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Stop performs a graceful shutdown of the server.

Jump to

Keyboard shortcuts

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