mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 10:27:06 +00:00
Update to version 11.0.1. Feature request implemented: https://github.com/kataras/iris/issues/1113
Former-commit-id: 0ce38dbacc2458fe327fa4401fdde1e69c8aacb0
This commit is contained in:
@@ -26,8 +26,13 @@ func main() {
|
||||
func setupWebsocket(app *iris.Application) {
|
||||
// create our echo websocket server
|
||||
ws := websocket.New(websocket.Config{
|
||||
// These are low-level optionally fields,
|
||||
// user/client can't see those values.
|
||||
ReadBufferSize: 1024,
|
||||
WriteBufferSize: 1024,
|
||||
// only javascript client-side code has the same rule,
|
||||
// which you serve using the ws.ClientSource (see below).
|
||||
EvtMessagePrefix: []byte("my-custom-prefix:"),
|
||||
})
|
||||
ws.OnConnection(handleConnection)
|
||||
|
||||
@@ -38,7 +43,7 @@ func setupWebsocket(app *iris.Application) {
|
||||
// serve the javascript built'n client-side library,
|
||||
// see websockets.html script tags, this path is used.
|
||||
app.Any("/iris-ws.js", func(ctx iris.Context) {
|
||||
ctx.Write(websocket.ClientSource)
|
||||
ctx.Write(ws.ClientSource)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user