mirror of
https://github.com/labstack/echo.git
synced 2025-07-05 00:58:47 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
18
examples/websocket/server.go
Normal file
18
examples/websocket/server.go
Normal file
@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo"
|
||||
"io"
|
||||
mw "github.com/labstack/echo/middleware"
|
||||
)
|
||||
|
||||
func main() {
|
||||
e := echo.New()
|
||||
e.Use(mw.Logger())
|
||||
e.Use(mw.Gzip())
|
||||
e.WebSocket("/ws", func(c *echo.Context) error {
|
||||
io.Copy(c.Socket(), c.Socket())
|
||||
return nil
|
||||
})
|
||||
e.Run(":1323")
|
||||
}
|
Reference in New Issue
Block a user