You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 24, 2023. It is now read-only.
app.Get("/ws/:id", websocket.New(func(c *websocket.Conn) { // c.Locals is added to the *websocket.Conn log.Println(c.Locals("allowed")) // true log.Println(c.Params("id")) // 123 log.Println(c.Query("v")) // 1.0 log.Println(c.Cookies("session")) // "" }))
add this code in function like func Ws(c *fiber.Ctx) error { //add websocket.New(func(c *websocket.Conn) herre return nil }
so in routes i can use app.Get("/", Ws)
The text was updated successfully, but these errors were encountered:
ahmadsukabul
changed the title
How change websocket connection to function. so i can use function in controller
How change websocket connection to function. so i can use function in route
Apr 4, 2022
app.Get("/ws/:id", websocket.New(func(c *websocket.Conn) { // c.Locals is added to the *websocket.Conn log.Println(c.Locals("allowed")) // true log.Println(c.Params("id")) // 123 log.Println(c.Query("v")) // 1.0 log.Println(c.Cookies("session")) // "" }))
add this code in function like
func Ws(c *fiber.Ctx) error { //add websocket.New(func(c *websocket.Conn) herre return nil }
so in routes i can use
app.Get("/", Ws)
The text was updated successfully, but these errors were encountered: