proxy

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoReverseProxy

func GoReverseProxy(targetHost string) func(http.ResponseWriter, *http.Request)

GoReverseProxy handles the http request using proxy.

func NewReverseProxy7

func NewReverseProxy7(targetHost string) (*httputil.ReverseProxy, error)

NewReverseProxy7 returns reverse proxy object for OSI 7 level: application level.

Types

type ProxyController

type ProxyController struct {
	Lb lb.LB

	InsecureServingBindPort int
	SecureServingBindPort   int

	// LocalNetIFAddr is the network interface address the current local machine
	LocalNetIFAddr string

	Plugins dudu.HandlersChain
	// contains filtered or unexported fields
}

ProxyController ...

func NewUserController

func NewUserController(engine *dudu.ProxyHttpMux,
	transport transport.Factory,
	lb lb.LB,
) *ProxyController

NewUserController creates a user handler.

func (*ProxyController) ConnectHandler

func (p *ProxyController) ConnectHandler(w http.ResponseWriter, r *http.Request, targetHttps string)

ConnectHandler deal with http-request that method is 'connect'.

func (*ProxyController) GoHandle

func (p *ProxyController) GoHandle(w http.ResponseWriter, r *http.Request)

GoHandle start handle request and go fetch remote.

func (*ProxyController) SendFinalResponse

func (p *ProxyController) SendFinalResponse(c *dudu.Context) error

SendFinalResponse send final response to client.

func (*ProxyController) ServeHandle

func (p *ProxyController) ServeHandle(w http.ResponseWriter, r *http.Request)

ServeHandle select handler by http method.

func (*ProxyController) Use

func (p *ProxyController) Use(plugins ...dudu.HandlerFunc)

Use append middleware into porxy controller.

func (*ProxyController) UserRequestHandler

func (p *ProxyController) UserRequestHandler(c *dudu.Context)

UserRequestHandler deal with any http requests.

Jump to

Keyboard shortcuts

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