proxy

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIP

func GetIP(r *http.Request) string

GetIP returns the real visitor IP for the request.

Types

type Client

type Client struct {
	ID       string `toml:"id"`
	Secret   string `toml:"secret"`
	Hostname string `toml:"hostname"`
}

type Config

type Config struct {
	Server   Server   `toml:"server"`
	Clients  []Client `toml:"clients"`
	Network  Network  `toml:"network"`
	BaseURL  string   `toml:"base_url"`
	BasePath string   `toml:"base_path"`
}

func LoadConfig

func LoadConfig() *Config

LoadConfig loads the configuration.

type Network

type Network struct {
	Header  []string `toml:"header"`
	Subnets []string `toml:"subnets"`
}

type Server

type Server struct {
	Host         string `toml:"host"`
	WriteTimeout int    `toml:"write_timeout"`
	ReadTimeout  int    `toml:"read_timeout"`
	TLS          bool   `toml:"tls"`
	TLSCert      string `toml:"tls_cert"`
	TLSKey       string `toml:"tls_key"`
}

Jump to

Keyboard shortcuts

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