proxyhandler

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProxyHandler

func ProxyHandler(rules ...ItfProxyMode) gin.HandlerFunc

Types

type ItfProxyMode

type ItfProxyMode interface {
	Match(req *http.Request) bool
	ServeHTTP(rw http.ResponseWriter, req *http.Request)
}

func NewProxy

func NewProxy(rule configstc.ProxyRule) ItfProxyMode

func NewProxyGroup

func NewProxyGroup(rules ...configstc.ProxyRule) []ItfProxyMode

type ProxyByFixed

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

ProxyByFixed 固定匹配转发

func NewProxyByFixed

func NewProxyByFixed(rule configstc.ProxyRule) *ProxyByFixed

func (*ProxyByFixed) Match

func (p *ProxyByFixed) Match(req *http.Request) bool

func (*ProxyByFixed) ServeHTTP

func (p *ProxyByFixed) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type ProxyByPrefix

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

ProxyByPrefix 根据前缀转发的代理

func NewProxyByPrefix

func NewProxyByPrefix(rule configstc.ProxyRule) *ProxyByPrefix

func (*ProxyByPrefix) Match

func (p *ProxyByPrefix) Match(req *http.Request) bool

func (*ProxyByPrefix) ServeHTTP

func (p *ProxyByPrefix) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type ProxyNone

type ProxyNone struct {
}

ProxyNone 空代理

func (*ProxyNone) Match

func (p *ProxyNone) Match(req *http.Request) bool

func (*ProxyNone) ServeHTTP

func (p *ProxyNone) ServeHTTP(rw http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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