ing
This commit is contained in:
@@ -3,9 +3,11 @@ package file
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
"git.loafle.net/commons_go/config"
|
||||
"git.loafle.net/commons_go/logging"
|
||||
"git.loafle.net/overflow/overflow_gateway_web/handler"
|
||||
gws "git.loafle.net/overflow/overflow_gateway_websocket"
|
||||
@@ -38,7 +40,14 @@ func New(ctx context.Context) FileHandler {
|
||||
h.handler = jsonrpc.NewHandler(ctx, h.ho)
|
||||
|
||||
h.co = &gws.SocketOptions{
|
||||
Handler: h.handler,
|
||||
Handler: h.handler,
|
||||
MaxMessageSize: config.GetInt64("handlers.file.socket.MaxMessageSize"),
|
||||
WriteTimeout: time.Duration(config.GetInt("handlers.file.socket.WriteTimeout")) * time.Second,
|
||||
ReadTimeout: time.Duration(config.GetInt("handlers.file.socket.ReadTimeout")) * time.Second,
|
||||
PongTimeout: time.Duration(config.GetInt("handlers.file.socket.PongTimeout")) * time.Second,
|
||||
PingTimeout: time.Duration(config.GetInt("handlers.file.socket.PingTimeout")) * time.Second,
|
||||
PingPeriod: time.Duration(config.GetInt("handlers.file.socket.PingPeriod")) * time.Second,
|
||||
BinaryMessage: config.GetBool("handlers.file.socket.BinaryMessage"),
|
||||
}
|
||||
|
||||
return h
|
||||
|
||||
@@ -3,11 +3,13 @@ package web
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
"google.golang.org/grpc/metadata"
|
||||
|
||||
"git.loafle.net/commons_go/config"
|
||||
"git.loafle.net/commons_go/logging"
|
||||
backGRpc "git.loafle.net/overflow/overflow_api_server/golang"
|
||||
"git.loafle.net/overflow/overflow_gateway_web/handler"
|
||||
@@ -44,7 +46,14 @@ func New(ctx context.Context, pool grpcPool.Pool) WebHandler {
|
||||
h.handler = jsonrpc.NewHandler(ctx, h.ro)
|
||||
|
||||
h.so = &gws.SocketOptions{
|
||||
Handler: h.handler,
|
||||
Handler: h.handler,
|
||||
MaxMessageSize: config.GetInt64("handlers.web.socket.MaxMessageSize"),
|
||||
WriteTimeout: time.Duration(config.GetInt("handlers.web.socket.WriteTimeout")) * time.Second,
|
||||
ReadTimeout: time.Duration(config.GetInt("handlers.web.socket.ReadTimeout")) * time.Second,
|
||||
PongTimeout: time.Duration(config.GetInt("handlers.web.socket.PongTimeout")) * time.Second,
|
||||
PingTimeout: time.Duration(config.GetInt("handlers.web.socket.PingTimeout")) * time.Second,
|
||||
PingPeriod: time.Duration(config.GetInt("handlers.web.socket.PingPeriod")) * time.Second,
|
||||
BinaryMessage: config.GetBool("handlers.web.socket.BinaryMessage"),
|
||||
}
|
||||
|
||||
return h
|
||||
|
||||
Reference in New Issue
Block a user