1
0
mirror of https://github.com/labstack/echo.git synced 2025-03-03 14:52:47 +02:00
echo/website/docs/recipes/websocket.md
Vishal Rana 992f5ef005 Updated docs and recipes
Signed-off-by: Vishal Rana <vr@labstack.com>
2015-06-30 22:59:26 -07:00

393 B

WebSocket

server.go

package main

import (
	"io"

	"github.com/labstack/echo"
	mw "github.com/labstack/echo/middleware"
)

func main() {
	e := echo.New()
	e.Use(mw.Logger())
	e.WebSocket("/ws", func(c *echo.Context) error {
		io.Copy(c.Socket(), c.Socket())
		return nil
	})
	e.Run(":1323")
}

Source Code