Is the perMessageDeflate incorrectly documented ? #4520
Answered
by
darrachequesne
royalpinto
asked this question in
Q&A
-
In the v2 docs it says the const socketio = require('socket.io') // v2
const io = socketio({})
io.listen(3000)
console.log(io.engine.ws.options.perMessageDeflate) // => { threshold: 1024 } In the v4 docs also it says the default value of it is false. const socketio = require('socket.io') // v4
const io = socketio({})
io.listen(3000)
console.log(io.engine.ws.options.perMessageDeflate) // undefined But when it is set to true in v4, it becomes same as v2 const socketio = require('socket.io') // v4
const io = socketio({perMessageDeflate: true})
io.listen(3000)
console.log(io.engine.ws.options.perMessageDeflate) // { threshold: 1024 } Mostly in the v2 it is incorrectly documented as false where as in reality is it true ? 🤔 |
Beta Was this translation helpful? Give feedback.
Answered by
darrachequesne
Nov 15, 2022
Replies: 1 comment
-
Hi! I've updated the v2 documentation to make it clearer: https://socket.io/docs/v2/server-api/ |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
royalpinto
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
perMessageDeflate
defaults tofalse
starting fromsocket.io@2.4.0
: https://github.com/socketio/socket.io/releases/tag/2.4.0I've updated the v2 documentation to make it clearer: https://socket.io/docs/v2/server-api/