Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase websocket frame size #2739

Merged
merged 1 commit into from
Sep 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rpc/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const (
wsWriteBuffer = 1024
wsPingInterval = 60 * time.Second
wsPingWriteTimeout = 5 * time.Second
wsMessageSizeLimit = 15 * 1024 * 1024
wsMessageSizeLimit = 32 * 1024 * 1024
)

var wsBufferPool = new(sync.Pool)
Expand All @@ -47,7 +47,7 @@ var wsBufferPool = new(sync.Pool)
// allowedOrigins should be a comma-separated list of allowed origin URLs.
// To allow connections with any origin, pass "*".
func (s *Server) WebsocketHandler(allowedOrigins []string, compression bool) http.Handler {
var upgrader = websocket.Upgrader{
upgrader := websocket.Upgrader{
EnableCompression: compression,
ReadBufferSize: wsReadBuffer,
WriteBufferSize: wsWriteBuffer,
Expand Down Expand Up @@ -272,7 +272,7 @@ func (wc *websocketCodec) writeJSON(ctx context.Context, v interface{}) error {

// pingLoop sends periodic ping frames when the connection is idle.
func (wc *websocketCodec) pingLoop() {
var timer = time.NewTimer(wsPingInterval)
timer := time.NewTimer(wsPingInterval)
defer wc.wg.Done()
defer timer.Stop()

Expand Down