diff options
Diffstat (limited to 'plugins/broadcast/ws/ws_middleware.go')
-rw-r--r-- | plugins/broadcast/ws/ws_middleware.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/broadcast/ws/ws_middleware.go b/plugins/broadcast/ws/ws_middleware.go new file mode 100644 index 00000000..068ef9fb --- /dev/null +++ b/plugins/broadcast/ws/ws_middleware.go @@ -0,0 +1,13 @@ +package ws + +import ( + "github.com/gofiber/fiber/v2" + "github.com/gofiber/websocket/v2" +) + +func wsMiddleware(c *fiber.Ctx) error { + if websocket.IsWebSocketUpgrade(c) { + return c.Next() + } + return fiber.ErrUpgradeRequired +} |