Registry /
networking / gofiber-contrib-websocket
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
websocket
✓ github.com/gofiber/contrib/websocket
Create a WebSocket endpoint with Fiber
package main
import (
"github.com/gofiber/contrib/websocket"
"github.com/gofiber/fiber/v2"
)
func main() {
app := fiber.New()
app.Get("/ws", websocket.New(func(c *websocket.Conn) {
for {
msg := websocket.Message{}
if err := c.ReadJSON(&msg); err != nil {
break
}
c.WriteJSON(msg)
}
}))
app.Listen(":3000")
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.3.4latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.