socket.io-adapter
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -0,1 +1,10 @@ | ||
# [2.3.0](https://github.com/socketio/socket.io-adapter/compare/2.2.0...2.3.0) (2021-05-10) | ||
### Features | ||
* add a serverSideEmit empty function ([c4cbd4b](https://github.com/socketio/socket.io-adapter/commit/c4cbd4ba2d8997f9ab8e06cfb631c8f9a43d16f1)) | ||
* add support for the "wsPreEncoded" writing option ([5579d40](https://github.com/socketio/socket.io-adapter/commit/5579d40c24d15f69e44246f788fb93beb367f994)) | ||
# [2.2.0](https://github.com/socketio/socket.io-adapter/compare/2.1.0...2.2.0) (2021-02-27) | ||
@@ -2,0 +11,0 @@ |
@@ -112,2 +112,7 @@ /// <reference types="node" /> | ||
private computeExceptSids; | ||
/** | ||
* Send a packet to the other Socket.IO servers in the cluster | ||
* @param packet - an array of arguments, which may include an acknowledgement callback at the end | ||
*/ | ||
serverSideEmit(packet: any[]): void; | ||
} |
@@ -108,4 +108,8 @@ "use strict"; | ||
const encodedPackets = this.encoder.encode(packet); | ||
const firstPacketOpts = Object.assign({ wsPreEncoded: "4" + encodedPackets[0] }, packetOpts); | ||
this.apply(opts, socket => { | ||
socket.packet(encodedPackets, packetOpts); | ||
socket.client.writeToEngine(encodedPackets[0], firstPacketOpts); | ||
for (let i = 1; i < encodedPackets.length; i++) { | ||
socket.client.writeToEngine(encodedPackets[i], packetOpts); | ||
} | ||
}); | ||
@@ -218,3 +222,10 @@ } | ||
} | ||
/** | ||
* Send a packet to the other Socket.IO servers in the cluster | ||
* @param packet - an array of arguments, which may include an acknowledgement callback at the end | ||
*/ | ||
serverSideEmit(packet) { | ||
throw new Error("this adapter does not support the serverSideEmit() functionality"); | ||
} | ||
} | ||
exports.Adapter = Adapter; |
{ | ||
"name": "socket.io-adapter", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"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
15407
346