Documentation ¶
Index ¶
- func GoReverseProxy(targetHost string) func(http.ResponseWriter, *http.Request)
- func NewReverseProxy7(targetHost string) (*httputil.ReverseProxy, error)
- type ProxyController
- func (p *ProxyController) ConnectHandler(w http.ResponseWriter, r *http.Request, targetHttps string)
- func (p *ProxyController) GoHandle(w http.ResponseWriter, r *http.Request)
- func (p *ProxyController) SendFinalResponse(c *dudu.Context) error
- func (p *ProxyController) ServeHandle(w http.ResponseWriter, r *http.Request)
- func (p *ProxyController) Use(plugins ...dudu.HandlerFunc)
- func (p *ProxyController) UserRequestHandler(c *dudu.Context)
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.
Click to show internal directories.
Click to hide internal directories.