Szegedi Ádám
2f96438952
chore: bump engine.io version to fix CVE-2022-21676 ( #4262 )
...
Related: https://github.com/socketio/engine.io/security/advisories/GHSA-273r-mgr4-v34f
2022-01-25 22:18:18 +01:00
Damien Arrachequesne
c82a4bdf1f
chore(release): 4.4.1
...
Diff: https://github.com/socketio/socket.io/compare/4.4.0...4.4.1
2022-01-06 07:32:03 +01:00
Gray Zhang
51784d0305
chore: add types to exports field to be compatible with nodenext module resolution ( #4228 )
...
See [1] for detail, in `nodenext` module resolution it requires a
`types` field in `exports` with full filename including extension.
[1]: https://github.com/microsoft/TypeScript/issues/46770#issuecomment-966612103
2021-12-28 10:27:08 +01:00
Damien Arrachequesne
0f11c4745f
chore(release): 4.4.0
...
Diff: https://github.com/socketio/socket.io/compare/4.3.2...4.4.0
2021-11-18 14:10:19 +01:00
Damien Arrachequesne
2da82103d2
test: add test for volatile packet with binary
...
See also: 88eee5948a
2021-11-16 15:57:32 +01:00
Damien Arrachequesne
c0d8c5ab23
feat: add an implementation based on uWebSockets.js
...
Usage:
```js
const { App } = require("uWebSockets.js");
const { Server } = require("socket.io");
const app = new App();
const server = new Server();
server.attachApp(app);
app.listen(3000);
```
The Adapter prototype is updated so we can benefit from the publish
functionality of uWebSockets.js, so this will apply to all adapters
extending the default adapter.
Reference: https://github.com/uNetworking/uWebSockets.js
Related:
- https://github.com/socketio/socket.io/issues/3601
- https://github.com/socketio/engine.io/issues/578
2021-11-12 07:01:55 +01:00
Damien Arrachequesne
ed8483da4d
chore(release): 4.3.2
...
Diff: https://github.com/socketio/socket.io/compare/4.3.1...4.3.2
2021-11-08 06:39:20 +01:00
Damien Arrachequesne
ccc5ec39a8
chore(release): 4.3.1
...
Diff: https://github.com/socketio/socket.io/compare/4.3.0...4.3.1
2021-10-17 00:02:16 +02:00
Damien Arrachequesne
95810aa62d
chore(release): 4.3.0
...
Diff: https://github.com/socketio/socket.io/compare/4.2.0...4.3.0
2021-10-14 14:59:13 +02:00
Damien Arrachequesne
eb5fdbd03e
chore: bump engine.io to version 6.0.0
...
Release notes: https://github.com/socketio/engine.io/releases/tag/6.0.0
Diff: https://github.com/socketio/engine.io/compare/5.2.0...6.0.0
2021-10-12 00:05:10 +02:00
Damien Arrachequesne
c100b7b61c
chore(release): 4.2.0
...
Diff: https://github.com/socketio/socket.io/compare/4.1.3...4.2.0
2021-08-30 09:21:00 +02:00
Damien Arrachequesne
f03eeca39a
chore: bump dependencies
2021-08-30 08:27:46 +02:00
Damien Arrachequesne
dbd2a07cda
chore(release): 4.1.3
...
Diff: https://github.com/socketio/socket.io/compare/4.1.2...4.1.3
2021-07-10 12:13:15 +02:00
Damien Arrachequesne
7c44893d78
chore: bump dependencies
2021-07-04 00:37:35 +02:00
Damien Arrachequesne
1633150b2b
chore(release): 4.1.2
...
Diff: https://github.com/socketio/socket.io/compare/4.1.1...4.1.2
2021-05-17 23:17:31 +02:00
Damien Arrachequesne
995f38f4cc
chore(release): 4.1.1
...
Diff: https://github.com/socketio/socket.io/compare/4.1.0...4.1.1
2021-05-12 00:04:52 +02:00
Damien Arrachequesne
fb6b0efec9
chore(release): 4.1.0
...
Diff: https://github.com/socketio/socket.io/compare/4.0.2...4.1.0
2021-05-11 09:27:52 +02:00
Damien Arrachequesne
dc381b72c6
perf: add support for the "wsPreEncoded" writing option
...
Packets that are sent to multiple clients will now be pre-encoded for
the WebSocket transport (which means simply prepending "4" - which is
the "message" packet type in Engine.IO).
Note: buffers are not pre-encoded, since they are sent without
modification over the WebSocket connection
See also: 7706b123df
engine.io diff: https://github.com/socketio/engine.io/compare/5.0.0...5.1.0
2021-05-11 00:06:03 +02:00
Damien Arrachequesne
9fff03487c
chore(release): 4.0.2
...
Diff: https://github.com/socketio/socket.io/compare/4.0.1...4.0.2
2021-05-06 14:38:26 +02:00
Damien Arrachequesne
1faa7e3aea
chore(release): 4.0.1
...
Diff: https://github.com/socketio/socket.io/compare/4.0.0...4.0.1
2021-04-01 01:25:56 +02:00
Damien Arrachequesne
5eaeffc8e2
chore(release): 4.0.0
...
Diff: https://github.com/socketio/socket.io/compare/3.1.2...4.0.0
2021-03-10 12:43:53 +01:00
Damien Arrachequesne
1b6d6de4ed
chore: include Engine.IO v5
...
Release notes: https://github.com/socketio/engine.io/releases/tag/5.0.0
2021-03-10 11:14:33 +01:00
Maxime Kjaer
0107510ba8
feat: add support for typed events ( #3822 )
...
Syntax:
```ts
interface ClientToServerEvents {
"my-event": (a: number, b: string, c: number[]) => void;
}
interface ServerToClientEvents {
hello: (message: string) => void;
}
const io = new Server<ClientToServerEvents, ServerToClientEvents>(httpServer);
io.emit("hello", "world");
io.on("connection", (socket) => {
socket.on("my-event", (a, b, c) => {
// ...
});
socket.emit("hello", "again");
});
```
The events are not typed by default (inferred as any), so this change
is backward compatible.
Note: we could also have reused the method here ([1]) to add types to
the EventEmitter, instead of creating a StrictEventEmitter class.
Related: https://github.com/socketio/socket.io/issues/3742
[1]: https://github.com/binier/tiny-typed-emitter
2021-03-10 00:18:13 +01:00
Sebastiaan Marynissen
7de2e87e88
feat: allow to exclude specific rooms when broadcasting ( #3789 )
...
New syntax:
```
io.except("room1").emit(...);
io.to("room1").except("room2").emit(...);
socket.broadcast.except("room1").emit(...);
socket.to("room1").except("room2").emit(...);
```
Related:
- https://github.com/socketio/socket.io/issues/3629
- https://github.com/socketio/socket.io/issues/3657
2021-03-01 09:30:58 +01:00
Damien Arrachequesne
225ade062a
chore(release): 3.1.2
...
Diff: https://github.com/socketio/socket.io/compare/3.1.1...3.1.2
2021-02-26 01:18:42 +01:00
Damien Arrachequesne
67a61e39e6
chore: loosen the version requirement of @types/node
...
Related: https://github.com/socketio/socket.io/issues/3793
2021-02-26 00:58:01 +01:00
Damien Arrachequesne
12221f296d
chore(release): 3.1.1
...
Diff: https://github.com/socketio/socket.io/compare/3.1.0...3.1.1
2021-02-03 22:57:21 +01:00
Damien Arrachequesne
f05a4a6f82
chore(release): 3.1.0
...
Diff: https://github.com/socketio/socket.io/compare/3.0.5...3.1.0
2021-01-15 02:21:54 +01:00
Damien Arrachequesne
2c883f5d4e
chore: bump socket.io-adapter version
...
Diff: https://github.com/socketio/socket.io-adapter/compare/2.0.3...2.1.0
Includes:
- add room events ([155fa63 ](155fa6333a ))
- make rooms and sids public ([313c5a9 ](313c5a9fb6 ))
2021-01-15 01:41:37 +01:00
Damien Arrachequesne
9925746c8e
feat: add support for Socket.IO v2 clients
...
In order to ease the migration to Socket.IO v3, the Socket.IO server
can now communicate with v2 clients.
```js
const io = require("socket.io")({
allowEIO3: true
});
```
This feature is disabled by default.
2021-01-14 23:38:24 +01:00
Damien Arrachequesne
f8a66fd11a
chore(release): 3.0.5
...
Diff: https://github.com/socketio/socket.io/compare/3.0.4...3.0.5
2021-01-05 12:08:15 +01:00
Damien Arrachequesne
752dfe3b1e
chore: bump debug version
2021-01-05 11:53:27 +01:00
Stijn de Witt
230cd19164
chore: bump dependencies
2021-01-04 10:28:17 +01:00
David Fong
d1bfe40dbb
refactor: add more typing info and upgrade prettier ( #3725 )
...
This upgrades prettier to 2.2.0 to gain support for TypeScript's new
type-only-imports feature.
2020-12-11 12:19:20 +01:00
Damien Arrachequesne
81c1f4e819
chore(release): 3.0.4
...
Diff: https://github.com/socketio/socket.io/compare/3.0.3...3.0.4
2020-12-07 12:01:24 +01:00
Stijn de Witt
4e6d40493d
chore: make tests work on Windows ( #3708 )
2020-11-28 01:55:19 +01:00
Damien Arrachequesne
06a2bd313a
chore(release): 3.0.3
...
Diff: https://github.com/socketio/socket.io/compare/3.0.2...3.0.3
2020-11-19 01:31:31 +01:00
Damien Arrachequesne
85ebd356e9
chore: cleanup dist folder before compilation
2020-11-19 01:28:27 +01:00
Damien Arrachequesne
9b6f9711da
chore(release): 3.0.2
...
Diff: https://github.com/socketio/socket.io/compare/3.0.1...3.0.2
2020-11-18 00:53:51 +01:00
Damien Arrachequesne
118cc686a1
chore: add 3rd party types in the list of dependencies
...
Those types are mandatory for TypeScript users.
Related:
- https://github.com/socketio/socket.io/issues/3690
- https://github.com/microsoft/types-publisher/issues/81#issuecomment-234051345
2020-11-17 11:55:41 +01:00
Damien Arrachequesne
e69d0ad602
chore: bump socket.io-client version
2020-11-09 10:32:10 +01:00
Damien Arrachequesne
0317a077be
chore(release): 3.0.1
...
Diff: https://github.com/socketio/socket.io/compare/3.0.0...3.0.1
2020-11-09 10:27:58 +01:00
Damien Arrachequesne
1af3267e3f
chore(release): 3.0.0
...
Diff: https://github.com/socketio/socket.io/compare/2.3.0...3.0.0
2020-11-05 22:07:47 +01:00
Damien Arrachequesne
02951c4391
chore(release): 3.0.0-rc4
...
Diff: https://github.com/socketio/socket.io/compare/3.0.0-rc3...3.0.0-rc4
2020-10-30 23:02:43 +01:00
Damien Arrachequesne
aa7574f884
feat: serve msgpack bundle
...
See 71d60480af
2020-10-27 23:17:12 +01:00
Damien Arrachequesne
cacad7029a
chore(release): 3.0.0-rc3
...
Diff: https://github.com/socketio/socket.io/compare/3.0.0-rc2...3.0.0-rc3
2020-10-27 00:44:30 +01:00
Damien Arrachequesne
d16c035d25
refactor: rename ERROR to CONNECT_ERROR
...
The meaning is not modified: this packet type is still used by the
server when the connection to a namespace is refused.
2020-10-26 00:29:11 +01:00
Damien Arrachequesne
129c6417bd
feat: make Socket#join() and Socket#leave() synchronous
...
Depending on the adapter, Socket#join() may return:
- nothing (in-memory and Redis adapters)
- a promise (custom adapters)
Breaking change: Socket#join() and Socket#leave() do not accept a
callback argument anymore.
Before:
```js
socket.join("room1", () => {
io.to("room1").emit("hello");
});
```
After:
```
socket.join("room1");
io.to("room1").emit("hello");
// or await socket.join("room1"); for custom adapters
```
Note: the need for an asynchronous method came from the Redis adapter,
which did override the Adapter#add() method in earlier versions, but
this is not the case anymore.
Reference:
- https://github.com/socketio/socket.io/blob/2.3.0/lib/socket.js#L236-L258
- https://github.com/socketio/socket.io-adapter/blob/1.1.2/index.js#L56-L65
- 05f926e13e
Related: https://github.com/socketio/socket.io/issues/3662
2020-10-22 01:50:13 +02:00
Damien Arrachequesne
7603da71a5
feat: remove prod dependency to socket.io-client
...
The client bundles are included in the repository in order to remove
socket.io-client from the list of production dependencies and thus to
reduce the total number of dependencies when installing the server.
This means the release of the client and the server must now be in sync
(which is almost always the case actually).
The minified build is now served:
- /<path>/socket.io.js
- /<path>/socket.io.js.map
- /<path>/socket.io.min.js
- /<path>/socket.io.min.js.map
The content will now be compressed as well.
2020-10-17 02:11:15 +02:00
Damien Arrachequesne
0ce5b4ca68
chore(release): 3.0.0-rc2
...
Diff: https://github.com/socketio/socket.io/compare/3.0.0-rc1...3.0.0-rc2
2020-10-15 13:02:59 +02:00