socket.io-adapter
Advanced tools
Comparing version 2.3.0 to 2.3.1
@@ -0,1 +1,9 @@ | ||
## [2.3.1](https://github.com/socketio/socket.io-adapter/compare/2.3.0...2.3.1) (2021-05-19) | ||
### Bug Fixes | ||
* restore compatibility with binary parsers ([a33e42b](https://github.com/socketio/socket.io-adapter/commit/a33e42bb7b935ccdd3688b4c305714b791ade0db)) | ||
# [2.3.0](https://github.com/socketio/socket.io-adapter/compare/2.2.0...2.3.0) (2021-05-10) | ||
@@ -2,0 +10,0 @@ |
@@ -101,3 +101,3 @@ "use strict"; | ||
const flags = opts.flags || {}; | ||
const packetOpts = { | ||
const basePacketOpts = { | ||
preEncoded: true, | ||
@@ -109,7 +109,14 @@ volatile: flags.volatile, | ||
const encodedPackets = this.encoder.encode(packet); | ||
const firstPacketOpts = Object.assign({ wsPreEncoded: "4" + encodedPackets[0] }, packetOpts); | ||
const packetOpts = encodedPackets.map(encodedPacket => { | ||
if (typeof encodedPacket === "string") { | ||
return Object.assign(Object.assign({}, basePacketOpts), { wsPreEncoded: "4" + encodedPacket // "4" being the "message" packet type in Engine.IO | ||
}); | ||
} | ||
else { | ||
return basePacketOpts; | ||
} | ||
}); | ||
this.apply(opts, socket => { | ||
socket.client.writeToEngine(encodedPackets[0], firstPacketOpts); | ||
for (let i = 1; i < encodedPackets.length; i++) { | ||
socket.client.writeToEngine(encodedPackets[i], packetOpts); | ||
for (let i = 0; i < encodedPackets.length; i++) { | ||
socket.client.writeToEngine(encodedPackets[i], packetOpts[i]); | ||
} | ||
@@ -116,0 +123,0 @@ }); |
{ | ||
"name": "socket.io-adapter", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15895
353