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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user