This package provides a Waffle middleware for Echo.
If you are using Echo web framework, you can apply WAF protection using the WafMiddleware provided by this package.
go get github.com/sitebatch/waffle-go/contrib/labstack/echopackage main
import (
"net/http"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/sitebatch/waffle-go"
waffleEcho "github.com/sitebatch/waffle-go/contrib/labstack/echo"
)
func main() {
e := echo.New()
// Apply Waffle WAF middleware
e.Use(waffleEcho.WafMiddleware())
// Start Waffle
if err := waffle.Start(); err != nil {
e.Logger.Fatal(err)
}
e.Logger.Fatal(e.Start(":1323"))
}