config has been changed.
This commit is contained in:
@@ -3,7 +3,7 @@ package server
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.loafle.net/commons_go/config"
|
||||
"git.loafle.net/overflow/overflow_gateway_web/conf"
|
||||
ogw "git.loafle.net/overflow/overflow_gateway_websocket"
|
||||
)
|
||||
|
||||
@@ -13,7 +13,7 @@ func NewServer(ctx context.Context) ogw.Server {
|
||||
h := newServerHandler(ctx)
|
||||
_s := ogw.NewServer(ctx, h)
|
||||
|
||||
ofSigningKey = []byte(config.GetString("auth.signingKey"))
|
||||
ofSigningKey = []byte(conf.Config.Auth.SigningKey)
|
||||
|
||||
return _s
|
||||
}
|
||||
|
||||
@@ -5,11 +5,10 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"git.loafle.net/commons_go/config"
|
||||
"git.loafle.net/overflow/overflow_gateway_web/conf"
|
||||
ogw "git.loafle.net/overflow/overflow_gateway_websocket"
|
||||
jwt "github.com/dgrijalva/jwt-go"
|
||||
"github.com/valyala/fasthttp"
|
||||
|
||||
ogw "git.loafle.net/overflow/overflow_gateway_websocket"
|
||||
)
|
||||
|
||||
var ofSigningKey []byte
|
||||
@@ -18,11 +17,11 @@ func newServerHandler(ctx context.Context) ogw.ServerHandler {
|
||||
h := &serverHandlers{
|
||||
ctx: ctx,
|
||||
}
|
||||
h.cfg = config.Sub("websocket")
|
||||
h.HandshakeTimeout = h.cfg.GetDuration("HandshakeTimeout") * time.Second
|
||||
h.ReadBufferSize = h.cfg.GetInt("ReadBufferSize")
|
||||
h.WriteBufferSize = h.cfg.GetInt("WriteBufferSize")
|
||||
h.EnableCompression = h.cfg.GetBool("EnableCompression")
|
||||
|
||||
h.HandshakeTimeout = conf.Config.Websocket.HandshakeTimeout * time.Second
|
||||
h.ReadBufferSize = conf.Config.Websocket.ReadBufferSize
|
||||
h.WriteBufferSize = conf.Config.Websocket.WriteBufferSize
|
||||
h.EnableCompression = conf.Config.Websocket.EnableCompression
|
||||
|
||||
return h
|
||||
}
|
||||
@@ -30,7 +29,6 @@ func newServerHandler(ctx context.Context) ogw.ServerHandler {
|
||||
type serverHandlers struct {
|
||||
ogw.ServerHandlers
|
||||
ctx context.Context
|
||||
cfg config.Configurator
|
||||
}
|
||||
|
||||
func (h *serverHandlers) OnConnection(soc ogw.Socket) {
|
||||
|
||||
Reference in New Issue
Block a user