Closed lpinca closed 7 years ago
This is quite interesting, and in fact, huge 👍 to ship this through as it reduces memory consumption.
However it is a breaking change for everyone using this and relying on stream.socket.upgradeReq
. I think we will need to bubble up that upgrade request to the end user in a similar way that ws
do in here: https://github.com/maxogden/websocket-stream/blob/master/server.js#L14-L16.
Plus, we need to flip the default in the docs for https://github.com/maxogden/websocket-stream#optionspermessagedeflate.
cc @binarykitchen
Yes, I checked few modules that use this as dependency and no one is using stream.socket.upgradeReq
but ofc there might be some.
Here is a list of the breaking changes in
ws@3
: https://github.com/websockets/ws/releases/tag/3.0.0.The most important is that the
http.IncomingMessage
object is no longer attached to theWebSocket
object and is instead passed as the second argument to the'connection'
event. It seems that websocket-stream does not rely on the removedupgradeReq
property so this should be a safe and easy update.One thing to keep in mind is that
stream.socket.upgradeReq
is gone so this might be a breaking change.