server

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package server contains the HTTP authorization server.

Index

Constants

View Source
const (
	HeaderXForwardedMethod = "X-Forwarded-Method"
	HeaderXForwardedProto  = "X-Forwarded-Proto"
	HeaderXForwardedHost   = "X-Forwarded-Host"
	HeaderXForwardedURI    = "X-Forwarded-Uri"
	HeaderXForwardedFor    = "X-Forwarded-For"
)

HTTP headers used by reverse proxies to identify the original request.

View Source
const (
	FieldRequestDomain = "request_domain"
	FieldRequestMethod = "request_method"
	FieldSourceIP      = "source_ip"
	FieldSourceCountry = "source_country"
	FieldSourceASN     = "source_asn"
	FieldSourceOrg     = "source_org"
)

Fields used in the log messages.

Variables

This section is empty.

Functions

func NewServer

func NewServer(
	address string,
	engine *rules.Engine,
	resolver *ipres.Resolver,
) *http.Server

NewServer creates a new HTTP server that listens on the given address.

Types

type Metrics

type Metrics struct {
	Denied  atomic.Uint64
	Allowed atomic.Uint64
	Invalid atomic.Uint64
}

Metrics contains the metric values of the server.

func (*Metrics) Total

func (m *Metrics) Total() uint64

Total returns the total number of requests.

Jump to

Keyboard shortcuts

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