mirror of
https://github.com/kataras/iris.git
synced 2025-02-09 02:34:55 +01:00
added subprotocols to server config (#652)
Former-commit-id: c4793e7355d393bb479c69fc8f4f7ae65bc3668d
This commit is contained in:
parent
323beaa70e
commit
da6f515078
|
@ -77,6 +77,10 @@ type Config struct {
|
||||||
// The request is an argument which you can use to generate the ID (from headers for example).
|
// The request is an argument which you can use to generate the ID (from headers for example).
|
||||||
// If empty then the ID is generated by DefaultIDGenerator: randomString(64)
|
// If empty then the ID is generated by DefaultIDGenerator: randomString(64)
|
||||||
IDGenerator func(ctx *iris.Context) string
|
IDGenerator func(ctx *iris.Context) string
|
||||||
|
/**
|
||||||
|
List od subprotocols accepted by server
|
||||||
|
*/
|
||||||
|
Subprotocols []string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates the configuration
|
// Validate validates the configuration
|
||||||
|
|
|
@ -184,7 +184,7 @@ func (s *server) Handler() iris.HandlerFunc {
|
||||||
// build the upgrader once
|
// build the upgrader once
|
||||||
c := s.config
|
c := s.config
|
||||||
|
|
||||||
upgrader := websocket.Upgrader{ReadBufferSize: c.ReadBufferSize, WriteBufferSize: c.WriteBufferSize, Error: c.Error, CheckOrigin: c.CheckOrigin}
|
upgrader := websocket.Upgrader{ReadBufferSize: c.ReadBufferSize, WriteBufferSize: c.WriteBufferSize, Error: c.Error, CheckOrigin: c.CheckOrigin , Subprotocols:c.Subprotocols}
|
||||||
return func(ctx *iris.Context) {
|
return func(ctx *iris.Context) {
|
||||||
// Upgrade upgrades the HTTP server connection to the WebSocket protocol.
|
// Upgrade upgrades the HTTP server connection to the WebSocket protocol.
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue
Block a user