🎨 Set the maximum message size of WebSocket broadcast to 128 MiB (#10221)

This commit is contained in:
Yingyi / 颖逸 2024-01-20 08:49:36 +08:00 committed by GitHub
parent 7b4ead5e8a
commit 5f95df4477
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -61,6 +61,7 @@ func broadcast(c *gin.Context) {
} else {
// channel not found, create a new one
broadcastChannel := melody.New()
broadcastChannel.Config.MaxMessageSize = 1024 * 1024 * 128 // 128 MiB
BroadcastChannels.Store(channel, broadcastChannel)
subscribe(c, broadcastChannel, channel)