1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-09 21:15:56 +00:00

Implement the websocket adaptor, a version of kataras/go-websocket, and refactor all of the previous websocket examples.

https://github.com/kataras/go-websocket/issues/27

Former-commit-id: 0b7e52e0a61150a8bba973ef653986d8b3ddd26b
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-02-15 08:40:43 +02:00
parent 26a5f9f3b0
commit 82afcc5aa6
30 changed files with 2692 additions and 330 deletions

20
iris.go
View File

@@ -70,10 +70,9 @@ type Framework struct {
ln net.Listener
closedManually bool
once sync.Once
Config *Configuration
sessions sessions.Sessions
Websocket *WebsocketServer
once sync.Once
Config *Configuration
sessions sessions.Sessions
}
var defaultGlobalLoggerOuput = log.New(os.Stdout, "[iris] ", log.LstdFlags)
@@ -253,19 +252,6 @@ func New(setters ...OptionSetter) *Framework {
}})
}
{
// +------------------------------------------------------------+
// | Module Name: Websocket |
// | On Init: Attach a new websocket server. |
// | It starts on first callback registration |
// +------------------------------------------------------------+
// in order to be able to call $instance.Websocket.OnConnection.
// The whole server's configuration will be
// initialized on the first OnConnection registration (no runtime)
s.Websocket = NewWebsocketServer(s)
}
{
// +------------------------------------------------------------+
// | Module Name: Router |