1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-22 20:37:05 +00:00

all examples and tests ran successfully based on iris v11.2.0 and go+gomodules 1.12.7

Former-commit-id: a3a9056b321c059b52bd0d46d727a3eb8204174a
This commit is contained in:
Gerasimos (Makis) Maropoulos
2019-07-17 01:56:41 +03:00
parent 9364dde3ca
commit 94f67f7fbb
2 changed files with 11 additions and 13 deletions

View File

@@ -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