Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultSkipper ¶ added in v0.15.0
DefaultSkipper skip proxy middleware for requests, where path starts with /_/ or /api/.
Types ¶
type Options ¶
type Options struct {
// Enabled defines if proxy should be enabled.
Enabled bool
//Url to the target.
//
//Only http and https links are supported.
Url string
// Are proxy logs enabled?
ProxyLogsEnabled bool
}
Options defines optional struct to customize the default plugin behavior.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func MustRegister ¶
MustRegister is a helper function that registers plugin and panics if error occurred.
func (*Plugin) SetSkipper ¶ added in v0.15.0
func (p *Plugin) SetSkipper(skipper middleware.Skipper)
SetSkipper set skipper function that should return true if that route shouldn't be proxied.
If not set, the DefaultSkipper is used:
If set - you should also control the middleware behavior for /_/ and /api/ routes.
Example:
plugin := proxyPlugin.MustRegister(app, &proxyPlugin.Options{
Enabled: true,
Url: "http://localhost:3000",
})
plugin.SetSkipper(func(c echo.Context) bool {
return c.Request().URL.Path == "/my-super-secret-route"
})
Click to show internal directories.
Click to hide internal directories.