proxy

package
v0.0.0-...-cb59768 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProxyItem

type ProxyItem struct {
	ServerName []string `json:"servername" yaml:"servername"`
	//Locations  []locationConfig "json:locations"
	Locations []struct {
		Path     string `json:"path" yaml:"path"`
		Endpoint string `json:"endpoint" yaml:"endpoint"`
	} `json:"locations" yaml:"locations"`
	TLS  bool   `json:"tls" yaml:"tls"`
	Cert string `json:"cert" yaml:"cert"`
	Key  string `json:"certkey" yaml:"certkey"`
}

ProxyItem grupo de dominios com mesmo certificado TLS e paths

type ReverseProxy

type ReverseProxy struct {
	Log       *monologger.Log
	Config    ServerConfig
	DebugMode bool
	Addr      string
	Srv       *http.Server
	TLS       bool
}

ReverseProxy distribui requisicoes de acordo com os paths

func (*ReverseProxy) Listen

func (r *ReverseProxy) Listen()

Listen aguarda clientes, precisa ser configurado com Setup

func (*ReverseProxy) LoadConfig

func (r *ReverseProxy) LoadConfig(configYaml io.ReadCloser) error

LoadConfig carrega config

func (*ReverseProxy) ServeHTTP

func (r *ReverseProxy) ServeHTTP(res http.ResponseWriter, req *http.Request)

func (*ReverseProxy) Setup

func (r *ReverseProxy) Setup()

Setup serve http e https

func (*ReverseProxy) StartHTTPSServer

func (r *ReverseProxy) StartHTTPSServer() error

StartHTTPSServer https server

type ServerConfig

type ServerConfig struct {
	List []ProxyItem `json:"proxy" yaml:"proxy"`
}

ServerConfig representa arquivo de configuracao

Jump to

Keyboard shortcuts

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