From 07e0743041d50aea5b5509840c6e4f41ee21bdd1 Mon Sep 17 00:00:00 2001 From: conventi Date: Sat, 17 Sep 2016 15:33:07 +0200 Subject: [PATCH] Project WebSocket endpoint --- server/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/main.go b/server/main.go index c5d2d4c..a0998c8 100644 --- a/server/main.go +++ b/server/main.go @@ -1,6 +1,8 @@ package server import ( + "encoding/json" + "fmt" "github.com/labstack/echo" "github.com/labstack/echo/engine/standard" "github.com/labstack/echo/middleware" @@ -43,7 +45,9 @@ func (s *Server) Start() { func projects() websocket.Handler { return websocket.Handler(func(ws *websocket.Conn) { for { - err := websocket.Message.Send(ws, "Hello") + message, _ := json.Marshal(Bp) + err := websocket.Message.Send(ws, string(message)) + fmt.Println(Bp) if err != nil { log.Fatal(err) }