Skip to content

Commit 71bd413

Browse files
committed
perf: disable perMessageDeflate
From the ws docs: "ws supports the permessage-deflate extension extension which enables the client and server to negotiate a compression algorithm and its parameters, and then selectively apply it to the data payloads of each WebSocket message. The extension is enabled by default but adds a significant overhead in terms of performance and memory comsumption. We suggest to use WebSocket compression only if it is really needed. To disable the extension you can set the perMessageDeflate option to false"
1 parent fb751d7 commit 71bd413

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function Server (opts) {
118118
})
119119
})
120120
}
121-
self.ws = new WebSocketServer({ server: self.http })
121+
self.ws = new WebSocketServer({ server: self.http, perMessageDeflate: false })
122122
self.ws.address = function () {
123123
return self.http.address()
124124
}

0 commit comments

Comments
 (0)