From 456dae6409d8c40b2074091fd8036eac9b7a7453 Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Wed, 16 Aug 2023 14:04:08 +0800 Subject: [PATCH] fix --- go.mod | 2 +- go.sum | 4 ++-- websocket_test.go | 11 +++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 9236000..564fc10 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/474420502/execute v0.2.2 - github.com/474420502/passer v0.0.3 + github.com/474420502/passer v0.0.4 github.com/gorilla/websocket v1.5.0 github.com/lni/dragonboat/v4 v4.0.0-20230709075559-54497b9553be ) diff --git a/go.sum b/go.sum index 64a75ba..8647e3a 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/474420502/execute v0.2.2 h1:Hzzb/HFa/urRvi3xWe+p/DnJgRyxXFVyEBEXbbITy/E= github.com/474420502/execute v0.2.2/go.mod h1:wkKeKBIXYp7T844eU1YS2nPvFj8lra4VRcQYnWyXej4= -github.com/474420502/passer v0.0.3 h1:ACsKTcAdzjC+LA88me37WYNYr8QzlNLI2dRpLhhyiJQ= -github.com/474420502/passer v0.0.3/go.mod h1:MmnnrF9d51sPkFzdRq2pQtxQKqyjburVM1LjMbOCezE= +github.com/474420502/passer v0.0.4 h1:i3g7p6jQG9/Gmxvd+WlnPX67Qv3VWBGdohqCullsfAk= +github.com/474420502/passer v0.0.4/go.mod h1:MmnnrF9d51sPkFzdRq2pQtxQKqyjburVM1LjMbOCezE= github.com/474420502/random v0.4.1 h1:HUUyLXRWMijVb7CJoEC16f0aFQOW25Lkr80Mut6PoKU= github.com/474420502/requests v1.41.0 h1:c5OfhVHCvETlwEhODO2OAdPOH7v//kXJkGGUTKOkLOU= github.com/474420502/requests v1.41.0/go.mod h1:2SCVzim0ONFYG09g/GrM7RTeJIC6qTyZfnohsjnG5C8= diff --git a/websocket_test.go b/websocket_test.go index c5d7917..6e8f754 100644 --- a/websocket_test.go +++ b/websocket_test.go @@ -1,6 +1,7 @@ package fusenrender_test import ( + "encoding/json" "fmt" "fusenrender" "io" @@ -37,13 +38,19 @@ func TestWebsocketC(t *testing.T) { fusenrender.StartNode(svc) } -var addr = "api.fusen.3718.cn:4050" +// var addr = "api.fusen.3718.cn:4050" +var addr = "localhost:4050" func TestWebsocketCient(t *testing.T) { // u := url.URL{Scheme: "ws", Host: addr, Path: "/ws/pop/queue"} // conn, _, err := websocket.DefaultDialer.Dial(u.String(), nil) // log.Println(err) // defer conn.Close() + var m any + err := json.Unmarshal([]byte(sendjson), &m) + if err != nil { + panic(err) + } go func() { C := time.NewTicker(time.Second * 5) @@ -52,7 +59,7 @@ func TestWebsocketCient(t *testing.T) { Group: "unity3d", CreateAt: time.Now(), - Data: sendjson, + Data: m, } r, err := requests.Post(fmt.Sprintf("http://%s/api/render/queue/push", addr)).SetBodyJson(item).Execute() log.Println(r, err)