mirror of
https://github.com/kataras/iris.git
synced 2025-12-19 02:47:04 +00:00
use the same connection structure for both client and server-side connections interfaces, the 'Connection' interface could be changed to 'ServerConn' but this would produce breaking naming change to the iris users, so keep it as it's.
Former-commit-id: 3440871b368709e33d2d2a5080c66f7ad9338970
This commit is contained in:
@@ -11,8 +11,6 @@ import (
|
||||
func main() {
|
||||
app := iris.New()
|
||||
ws := websocket.New(websocket.Config{})
|
||||
app.Get("/socket", ws.Handler())
|
||||
|
||||
ws.OnConnection(func(c websocket.Connection) {
|
||||
go func() {
|
||||
<-time.After(20 * time.Second)
|
||||
@@ -28,5 +26,7 @@ func main() {
|
||||
})
|
||||
})
|
||||
|
||||
app.Get("/socket", ws.Handler())
|
||||
|
||||
app.Run(iris.Addr(":8080"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user