Documentation ¶
Overview ¶
Package access provides an access logging handler for the ozzo routing package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPProxyHandler ¶
func HTTPProxyHandler(proxys []*Proxy) routing.Handler
func ProxyHandler ¶
func ProxyHandler(proxys []*Proxy) routing.Handler
ProxyHandler returns a handler that proxy config for every request. all request will pass through is match rule, if matched it will proxy request to upstream address.
import ( "log" "github.com/ltick/tick-routing" "github.com/ltick/tick-routing/proxy" "net/http" ) proxys = []*Proxy{ &Proxy{Rule:"http://www.example.com/\w+.html/", Upstream:"http://127.0.0.1:9000/index.html"} } r := routing.New() r.Use(access.Proxy(proxys))
Types ¶
Click to show internal directories.
Click to hide internal directories.