Realtime application framework (Node.JS server)
~6.2.0
~8.2.3
~6.2.0
~8.2.3
:warning: WARNING :warning:
The default value of the maxHttpBufferSize
option has been decreased from 100 MB to 1 MB, in order to prevent attacks by denial of service.
Security advisory: https://github.com/advisories/GHSA-j4f2-536g-r55m
~3.6.0
(diff)~7.4.2
~6.2.0
~8.2.3
This is similar to onAny()
, but for outgoing packets.
Syntax:
socket.onAnyOutgoing((event, ...args) => {
console.log(event);
});
Syntax:
io.timeout(1000).emit("some-event", (err, responses) => {
// ...
});
So that clients in HTTP long-polling can decide how many packets they have to send to stay under the maxHttpBufferSize value.
This is a backward compatible change which should not mandate a new major revision of the protocol (we stay in v4), as we only add a field in the JSON-encoded handshake data:
0{"sid":"lv_VI97HAXpY6yYWAAAC","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":5000,"maxPayload":1000000}
~6.2.0
(diff)~8.2.3
const { App } = require("uWebSockets.js");
const { Server } = require("socket.io");
const app = new App();
const io = new Server();
io.attachApp(app);
io.on("connection", (socket) => {
// ...
});
app.listen(3000, (token) => {
if (!token) {
console.warn("port already in use");
}
});
socket.timeout(5000).emit("my-event", (err) => {
if (err) {
// the client did not acknowledge the event in the given delay
}
});
interface SocketData {
name: string;
age: number;
}
const io = new Server<ClientToServerEvents, ServerToClientEvents, InterServerEvents, SocketData>();
io.on("connection", (socket) => {
socket.data.name = "john";
socket.data.age = 42;
});
~6.1.0
(diff)~8.2.3
~6.0.0
~8.2.3
~6.0.0
~8.2.3
For this release, most of the work was done on the client side, see here.
~6.0.0
(diff)~8.2.3
(diff)