Skip to content

Websocket - v1.2.0

Compare
Choose a tag to compare
@github-actions github-actions released this 07 Aug 07:30
· 783 commits to refs/heads/main since this release
22cff18

🚀 New

app := fiber.New()

app.Use(cache.New(cache.Config{
    Next: func(c *fiber.Ctx) bool {
        return strings.Contains(c.Route().Path, "/ws")
    },
}))

cfg := Config{
    RecoverHandler: func(conn *Conn) {
        if err := recover(); err != nil {
            conn.WriteJSON(fiber.Map{"customError": "error occurred"})
        }
    },
}

app.Get("/ws/:id", websocket.New(func(c *websocket.Conn) {}, cfg))

📚 Documentation

  • Update websocket readme about recover middleware (#697)

Full Changelog: websocket/v1.1.0...websocket/v1.1.1

Thank you @gaby and @mstrYoda for making this update possible.