gateproxy

package
v0.0.0-...-70b9ccc Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuth

type BasicAuth struct {
	User string
	Pass string
}

BasicAuth for Proxy

type Controller

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

Controller of Gateway-Proxy

func InitHTTP

func InitHTTP(c *HTTPConfig) *Controller

InitHTTP Gateway

func (*Controller) Alive

func (c *Controller) Alive() bool

Alive State

func (*Controller) Start

func (c *Controller) Start()

Start Gateway-Proxy

func (*Controller) Stop

func (c *Controller) Stop()

Stop Gateway-Proxy

func (*Controller) Sub

func (c *Controller) Sub(label string, fn func(bool))

Sub Alive

func (*Controller) Unsub

func (c *Controller) Unsub(label string)

Unsub Alive

type HTTPConfig

type HTTPConfig struct {
	Addr string // 监听地址

	HTTPS     *TLS       // 启用 HTTPS
	BasicAuth *BasicAuth // 启用 Basic 认证

	// 连接配置
	Proxy       func(*http.Request) (*url.URL, error) // can use http.ProxyFromEnvironment
	DialContext func(ctx context.Context, network, addr string) (net.Conn, error)
}

HTTPConfig for Gateway

type TLS

type TLS struct {
	Crt string
	Key string
}

TLS for Proxy

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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