Socket
Socket
Sign inDemoInstall

socket.io-adapter

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

socket.io-adapter - npm Package Compare versions

Comparing version 2.3.0 to 2.3.1

8

CHANGELOG.md

@@ -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 @@

17

dist/index.js

@@ -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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc