From 3b6caba1dd99a7441dea79cdca142074d7be85f2 Mon Sep 17 00:00:00 2001 From: 5elenay <5elenay@protonmail.com> Date: Fri, 28 Jan 2022 21:56:10 +0300 Subject: [PATCH] fixes #7? --- websocket.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/websocket.go b/websocket.go index 6cc03c0..aef7515 100644 --- a/websocket.go +++ b/websocket.go @@ -25,6 +25,8 @@ func (c *Client) Start() { } c.Socket.OnTextMessage = func(message string, _ gowebsocket.Socket) { + fmt.Println(message) + // Parse data rawData := &struct { Type string `json:"type"` @@ -67,7 +69,7 @@ func (c *Client) Destroy() { func (c *Client) ping() { for { time.Sleep(30 * time.Second) - c.Socket.SendText(fmt.Sprintf("{\"type\":\"Ping\",\"time\":%d}", time.Now().Unix())) + c.Socket.SendText("{\"type\":\"Ping\",\"data\":0}") } }