proxy

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAuthHeaders

func AddAuthHeaders(r *http.Request, email, provider string)

AddAuthHeaders adds authentication headers to the request Deprecated: Use the Forwarder from pkg/forwarding for more flexible header management

Types

type Handler

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

Handler is a reverse proxy handler

func NewHandler

func NewHandler(upstreamURL string) (*Handler, error)

NewHandler creates a new proxy handler with a default upstream Deprecated: Use NewHandlerWithConfig instead

func NewHandlerWithConfig

func NewHandlerWithConfig(upstreamConfig UpstreamConfig) (*Handler, error)

NewHandlerWithConfig creates a new proxy handler with upstream configuration

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles the proxy request

type SecretConfig

type SecretConfig struct {
	Header string `yaml:"header" json:"header"` // HTTP header name (e.g., "X-Chatbotgate-Secret")
	Value  string `yaml:"value" json:"value"`   // Secret value to send
}

SecretConfig represents secret header configuration for upstream authentication

type UpstreamConfig

type UpstreamConfig struct {
	URL    string       `yaml:"url" json:"url"`       // Upstream URL (required)
	Secret SecretConfig `yaml:"secret" json:"secret"` // Secret header configuration (optional)
}

UpstreamConfig represents upstream server configuration with optional secret header

Jump to

Keyboard shortcuts

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