package server import ( "fmt" "git.loafle.net/commons_go/logging" cwf "git.loafle.net/commons_go/websocket_fasthttp" "git.loafle.net/overflow/overflow_gateway_websocket/config" ) func New(sh ServerHandler) cwf.Server { if nil == config.Config.Server { logging.Logger().Panic(fmt.Sprintf("Gateway Websocket: Config of server is not initialized")) } sh.Name = config.Config.Server.Name sh.Concurrency = config.Config.Server.Concurrency sh.MaxStopWaitTime = config.Config.Server.MaxStopWaitTime sh.HandshakeTimeout = config.Config.Websocket.HandshakeTimeout sh.ReadBufferSize = config.Config.Websocket.ReadBufferSize sh.WriteBufferSize = config.Config.Websocket.WriteBufferSize sh.EnableCompression = config.Config.Websocket.EnableCompression s := cwf.New(sh) return s }