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