1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-04 10:47:20 +00:00

Add ReadBufferSize and WriteBufferSize to the iris-ws, disable header copy also

This commit is contained in:
Makis Maropoulos
2016-06-16 20:08:59 +03:00
parent 647f0d704c
commit 0d482508fc
4 changed files with 30 additions and 18 deletions

View File

@@ -40,17 +40,23 @@ type Websocket struct {
// Headers the response headers before upgrader
// Default is empty
Headers map[string]string
// ReadBufferSize is the buffer size for the underline reader
ReadBufferSize int
// WriteBufferSize is the buffer size for the underline writer
WriteBufferSize int
}
// DefaultWebsocket returns the default config for iris-ws websocket package
func DefaultWebsocket() *Websocket {
return &Websocket{
WriteTimeout: DefaultWriteTimeout,
PongTimeout: DefaultPongTimeout,
PingPeriod: DefaultPingPeriod,
MaxMessageSize: DefaultMaxMessageSize,
Headers: make(map[string]string, 0),
Endpoint: "",
WriteTimeout: DefaultWriteTimeout,
PongTimeout: DefaultPongTimeout,
PingPeriod: DefaultPingPeriod,
MaxMessageSize: DefaultMaxMessageSize,
ReadBufferSize: 4096,
WriteBufferSize: 4096,
Headers: make(map[string]string, 0),
Endpoint: "",
}
}