From 94f67f7fbb605137d94ee2f8e28b62104e2abb1e Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Wed, 17 Jul 2019 01:56:41 +0300 Subject: [PATCH] all examples and tests ran successfully based on iris v11.2.0 and go+gomodules 1.12.7 Former-commit-id: a3a9056b321c059b52bd0d46d727a3eb8204174a --- .../bootstrap/bootstrap/bootstrapper.go | 10 +++------- .../vuejs-todo-mvc/src/web/public/index.html | 14 ++++++++------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/_examples/structuring/bootstrap/bootstrap/bootstrapper.go b/_examples/structuring/bootstrap/bootstrap/bootstrapper.go index f8b94942..3674adeb 100644 --- a/_examples/structuring/bootstrap/bootstrap/bootstrapper.go +++ b/_examples/structuring/bootstrap/bootstrap/bootstrapper.go @@ -54,14 +54,10 @@ func (b *Bootstrapper) SetupSessions(expires time.Duration, cookieHashKey, cooki } // SetupWebsockets prepares the websocket server. -func (b *Bootstrapper) SetupWebsockets(endpoint string, onConnection websocket.ConnectionFunc) { - ws := websocket.New(websocket.Config{}) - ws.OnConnection(onConnection) +func (b *Bootstrapper) SetupWebsockets(endpoint string, handler websocket.ConnHandler) { + ws := websocket.New(websocket.DefaultGorillaUpgrader, handler) - b.Get(endpoint, ws.Handler()) - b.Any("/iris-ws.js", func(ctx iris.Context) { - ctx.Write(websocket.ClientSource) - }) + b.Get(endpoint, websocket.Handler(ws)) } // SetupErrorHandlers prepares the http error handlers diff --git a/_examples/tutorial/vuejs-todo-mvc/src/web/public/index.html b/_examples/tutorial/vuejs-todo-mvc/src/web/public/index.html index 4f44b0d6..6b43069d 100644 --- a/_examples/tutorial/vuejs-todo-mvc/src/web/public/index.html +++ b/_examples/tutorial/vuejs-todo-mvc/src/web/public/index.html @@ -12,7 +12,7 @@ - +