Compare commits

...

6008 Commits

Author SHA1 Message Date
Damien Arrachequesne
9199156758 test(eio): fix flaky test 2025-12-22 15:27:48 +01:00
Damien Arrachequesne
594841617d test(redis-streams-emitter): migrate to Node.js test runner
We should eventually be able to replace:

- mocha and nyc with Node.js built-in test runner (`node:test`)
- expect.js with Node.js built-in assertion library (`node:assert`)
2025-12-22 14:48:29 +01:00
Denis Barbaron
84e7253e57 refactor(sio): add package.json entrypoint (#5239) 2025-12-22 14:33:12 +01:00
Damien Arrachequesne
30ec4a136a test(sio-client): reactivate all tests 2025-12-22 13:46:15 +01:00
Damien Arrachequesne
e08293bc37 refactor(eio): use URL constructor instead of url.parse() 2025-12-22 13:45:52 +01:00
Damien Arrachequesne
b837949479 ci: use Node.js 24
Reference: https://github.com/nodejs/Release
2025-12-22 13:45:36 +01:00
Damien Arrachequesne
118ef41b94 test: use tsx instead of ts-node 2025-12-22 10:39:57 +01:00
Suraj Rana
d19928e8d8 fix(sio-client): drain queue before emitting "connect" (#5259)
When the `retries` option was enabled, an event emitted in the "connect" handler would be sent twice.

Related: https://github.com/socketio/socket.io/issues/5258
2025-12-22 10:39:39 +01:00
Damien Arrachequesne
cdae01983a fix(sio-client): do not mangle the "_placeholder" attribute (bis)
The "_placeholder" attribute is used when sending binary data, and was
incorrectly mangled (converted to a random short property, like "it",
to reduce the bundle size).

Related:

- ca9e994815
- https://github.com/socketio/socket.io/issues/5215

[skip ci]
2025-12-19 15:48:28 +01:00
Damien Arrachequesne
39bb72039d docs: add release steps
[skip ci]
2025-12-19 15:43:14 +01:00
Valentin Rault
98741e15e9 refactor(sio-client): export DisconnectDescription type (#5392)
Related: https://github.com/socketio/socket.io/issues/4556
2025-12-19 14:51:39 +01:00
Damien Arrachequesne
8af70195bb refactor(sio): use URL constructor instead of url.parse()
Related: https://github.com/socketio/socket.io/issues/5377
2025-12-19 14:44:30 +01:00
Damien Arrachequesne
d88f3f4578 ci: use actions/checkout@v6 and actions/setup-node@v6
Release notes:

- https://github.com/actions/checkout/blob/main/CHANGELOG.md
- https://github.com/actions/setup-node/releases/tag/v6.0.0
2025-12-15 09:38:45 +01:00
Damien Arrachequesne
f5ee981ee8 ci(publish): use trusted publishing
Reference: https://docs.npmjs.com/trusted-publishers

[skip ci]
2025-12-15 08:57:17 +01:00
Damien Arrachequesne
76e3a72bba docs: add missing changelog links
[skip ci]
2025-12-15 08:55:26 +01:00
Damien Arrachequesne
a7b1938d06 test: regenerate SSL certs 2025-12-15 08:45:47 +01:00
Damien Arrachequesne
54743633ff chore(release): @socket.io/redis-streams-emitter@0.1.1
Diff: https://github.com/socketio/socket.io/compare/@socket.io/redis-streams-emitter@0.1.0...@socket.io/redis-streams-emitter@0.1.1
2025-11-07 10:33:07 +01:00
Damien Arrachequesne
7617707ed8 fix(redis-streams-emitter): remove dependency on socket.io-adapter
Related: https://github.com/socketio/socket.io/issues/5414
2025-11-07 10:28:27 +01:00
Damien Arrachequesne
599001d213 chore(release): @socket.io/redis-streams-emitter@0.1.0 2025-11-06 18:23:00 +01:00
Damien Arrachequesne
1c3e4711c1 feat: add emitter based on Redis streams
Related: https://github.com/socketio/socket.io-redis-streams-adapter/issues/8
2025-11-06 18:03:37 +01:00
Damien Arrachequesne
693080cac7 refactor(sio-adapter): add more debug logs 2025-10-20 15:11:21 +02:00
Damien Arrachequesne
5080c73e1e refactor: fix npm command 2025-10-17 09:41:39 +02:00
Damien Arrachequesne
47ff1cd04c chore(release): @socket.io/cluster-adapter@0.3.0
Diff: https://github.com/socketio/socket.io-cluster-adapter/compare/0.2.2...0.3.0
2025-10-16 19:55:56 +02:00
Damien Arrachequesne
0ae76360f9 Merge remote-tracking branch 'socket.io-cluster-adapter/monorepo' 2025-10-16 19:35:51 +02:00
Damien Arrachequesne
27fd420e75 refactor: prepare migration to monorepo 2025-10-16 19:31:30 +02:00
Damien Arrachequesne
0c431243e2 refactor: use the ClusterAdapter class from socket.io-adapter package
The ClusterAdapter class has been moved to [1], so that this adapter
only needs to implement to pub/sub mechanism.

Also, [2] should reduce the number of "timeout reached: only x
responses received out of y" errors, since the fetchSockets() requests
will now succeed even if a server leaves the cluster.

[1]: https://github.com/socketio/socket.io/tree/main/packages/socket.io-adapter
[2]: 0e23ff0cc6
2025-10-16 19:16:20 +02:00
Damien Arrachequesne
4fc25d80ec ci: add Node.js 24
Reference: https://github.com/nodejs/Release
2025-10-16 12:03:32 +02:00
Damien Arrachequesne
1dd729b1a1 refactor: upgrade to prettier 3 2025-10-16 11:51:11 +02:00
Damien Arrachequesne
6877512f57 refactor: upgrade to TypeScript 5 2025-10-16 11:49:12 +02:00
Damien Arrachequesne
cf6816afcf chore: npm audit fix 2025-10-10 09:29:29 +02:00
Damien Arrachequesne
625fd66d73 chore: dedupe debug dependency 2025-10-10 09:11:54 +02:00
Damien Arrachequesne
f3e1f5ebdf fix(sio): call adapter.init() when creating each namespace
The init() method of the adapter will now be called when creating a namespace with `io.of(<the-namespace>)`.

Note: any promise rejection is silently caught, as I don't see how we could properly expose the promise.

```js
const io = new Server({
  adapter: myAdapter
});
// under the hood, this:
// - implicitly creates the main namespace (/)
// - creates an instance of `myAdapter` for the main namespace
// - calls `myAdapter.init()` (with this change)
```

Related:

- https://github.com/socketio/socket.io/issues/3662
- https://github.com/socketio/socket.io-postgres-adapter/issues/16
2025-10-09 09:48:07 +02:00
Damien Arrachequesne
e97549259e ci(browser): use Windows 8 for IE tests 2025-09-30 11:44:50 +02:00
MiaoWoo
1da9cddeab fix(eio-client): properly handle port option (#5241)
Passing { port: "443" } would include the port in the URL (":443").
2025-09-30 10:57:43 +02:00
Avi Vahl
6f9b198bc8 chore(deps): ws@8.18.3, debug@4.4.1 (#5335)
Release notes:

- https://github.com/websockets/ws/releases/tag/8.18.3
- https://github.com/debug-js/debug/releases/tag/4.4.1
2025-09-11 07:51:07 +02:00
Damien Arrachequesne
ac3df9a747 chore(release): @socket.io/postgres-emitter@0.1.1 2025-09-05 07:27:48 +02:00
Damien Arrachequesne
21fd54ece6 refactor(postgres-emitter): update compose file 2025-09-05 07:20:29 +02:00
Damien Arrachequesne
96d907b9b5 docs(postgres-emitter): add dark version of the explanation diagram 2025-09-05 07:19:07 +02:00
Damien Arrachequesne
32257b6cb8 fix(postgres-emitter): use parameterized query to send the NOTIFY command
Related:

- https://github.com/socketio/socket.io-postgres-emitter/issues/1
- https://github.com/socketio/socket.io-postgres-adapter/pull/1
2025-09-05 07:18:36 +02:00
Damien Arrachequesne
c7144920e3 Merge remote-tracking branch 'socket.io-postgres-emitter/main' into monorepo 2025-09-04 09:30:26 +02:00
Damien Arrachequesne
42480e9a7f chore: prepare migration to monorepo 2025-09-04 09:23:32 +02:00
Lou Klepner
0a8f91047c docs: fix adapter link (#2) 2025-09-04 09:22:40 +02:00
Damien Arrachequesne
a66ed68506 docs(protocol): add test with cancelled request
Related: 8f1ea3d58f
2025-09-03 09:02:44 +02:00
Damien Arrachequesne
3be6481d9d ci: pin Node.js 22 version
Related: https://github.com/nodejs/node/issues/59364
2025-08-09 09:31:12 +02:00
Wang Guan
be13cca94c refactor: improve type annotations and comments (#5364) 2025-08-09 08:43:34 +02:00
Damien Arrachequesne
e95f6abf93 docs: fix message handler latency in test suites
Related: https://github.com/socketio/socket.io-protocol/issues/32
2025-03-28 21:29:20 +01:00
Damien Arrachequesne
72d61dab82 chore(release): engine.io@6.6.4
Diff: https://github.com/socketio/socket.io/compare/engine.io@6.6.3...engine.io@6.6.4
2025-01-28 09:23:04 +01:00
Damien Arrachequesne
5a31aaf917 chore(eio): revert cookie to version ~0.7.2
This reverts commit 7427109658.

The new version of the `cookie` package contains code with optional chaining (`?.`), which is not supported by older Node.js versions (< 14).

The types for cookie are now bundled, so that there is no conflict with the types coming from `cookie@1`:

> error TS2724: '"cookie"' has no exported member named 'CookieSerializeOptions'. Did you mean 'SerializeOptions'?
>
> import type { CookieSerializeOptions } from "cookie";
>               ~~~~~~~~~~~~~~~~~~~~~~

Related: https://github.com/socketio/socket.io/issues/5283
2025-01-28 09:13:39 +01:00
Damien Arrachequesne
62e4da125e chore(release): engine.io@6.6.3
Diff: https://github.com/socketio/socket.io/compare/engine.io@6.6.2...engine.io@6.6.3
2025-01-23 07:55:43 +01:00
Damien Arrachequesne
bfa6eab195 chore(release): engine.io-client@6.6.3
Diff: https://github.com/socketio/socket.io/compare/engine.io-client@6.6.2...engine.io-client@6.6.3
2025-01-23 07:38:37 +01:00
Ben McCann
7fcddcb3bb fix(engine.io-client): correctly consume the ws package (#5220)
This should fix the following issue:

```
SyntaxError: Named export 'WebSocket' not found. The requested module 'ws' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'ws';
const { WebSocket } = pkg;
```
2025-01-07 10:53:32 +01:00
Damien Arrachequesne
7427109658 refactor(eio): bump cookie to version 1.0.2
Release notes: https://github.com/jshttp/cookie/releases/tag/v1.0.0

The types are now included in the npm package. The `CookieSerializeOptions` type, which is used in our `ServerOptions` type, has been renamed to `SerializeOptions`, but there are no breaking change.

Related: https://github.com/socketio/socket.io/issues/5231
2024-11-21 08:57:37 +01:00
Damien Arrachequesne
91e1c8b358 chore(release): socket.io@4.8.1
Diff: https://github.com/socketio/socket.io/compare/socket.io@4.8.0...socket.io@4.8.1
2024-10-25 08:13:15 +02:00
Damien Arrachequesne
8d5528aa2a chore(release): socket.io-client@4.8.1
Diff: https://github.com/socketio/socket.io/compare/socket.io-client@4.8.0...socket.io-client@4.8.1
2024-10-25 08:00:26 +02:00
Damien Arrachequesne
71387e5294 refactor(sio-client): reexport transports from the engine 2024-10-25 07:54:35 +02:00
Samuel Vogelsanger
aead83560d refactor(sio): make Namespace._fns private (#5196)
Related: https://github.com/socketio/socket.io/issues/5179
2024-10-23 10:59:23 +02:00
Damien Arrachequesne
029e010901 chore(release): engine.io-client@6.6.2
Diff: https://github.com/socketio/socket.io/compare/engine.io-client@6.6.1...engine.io-client@6.6.2
2024-10-23 10:48:16 +02:00
Damien Arrachequesne
4ca6ddb3a2 docs(nuxt): update example with latest version
Related: https://github.com/socketio/socket.io/issues/5208

[skip ci]
2024-10-23 08:19:48 +02:00
Damien Arrachequesne
ca9e994815 fix(sio-client): do not mangle the "_placeholder" attribute
The "_placeholder" attribute is used when sending binary data, and was
incorrectly mangled (converted to a random short property, like "it",
to reduce the bundle size).

This bug was introduced in [1], included in `socket.io-client@4.8.0`.

[1]: 7085f0e3e4

Related: https://github.com/socketio/socket.io/issues/5215
2024-10-22 11:41:08 +02:00
Damien Arrachequesne
4865f2e62e fix(eio-client): prevent infinite loop with Node.js built-in WebSocket
Related: https://github.com/socketio/socket.io/issues/5194
2024-10-22 00:49:25 +02:00
Damien Arrachequesne
d4b3ddedff ci: use Node.js 22
Reference: https://github.com/nodejs/Release
2024-10-21 23:30:11 +02:00
Damien Arrachequesne
3b68658201 chore: bump @fails-components/webtransport to version 1.1.4 (dev) 2024-10-21 23:29:29 +02:00
Damien Arrachequesne
175a2c58c1 fix(eio-client/types): remove ws type from .d.ts file
Before this change, the following error would be thrown when compiling
with TypeScript:

```
node_modules/engine.io-client/build/esm/transports/websocket.node.d.ts:12:101 - error TS1340: Module 'ws' does not refer to a type, but is used as a type here. Did you mean 'typeof import('ws')'?

12     createSocket(uri: string, protocols: string | string[] | undefined, opts: Record<string, any>): import("ws");
                                                                                                       ~~~~~~~~~~~~
```

This behavior was introduced in [1], included in version `6.6.0`.

The return type is forced as `any`, so that the `@types/ws` dependency
is optional.

[1]: f4d898ee96

Related: https://github.com/socketio/socket.io/issues/5202
2024-10-19 07:09:19 +02:00
Damien Arrachequesne
9b80ab42d6 chore(release): engine.io@6.6.2
Diff: https://github.com/socketio/socket.io/compare/engine.io@6.6.1...engine.io@6.6.2
2024-10-09 19:01:17 +02:00
Damien Arrachequesne
a5d2368512 ci: ignore tests when publishing to npm (bis)
`tags-ignore` seems to disable the workflow in all cases.
2024-10-09 18:56:59 +02:00
k725
88efd446f1 chore(deps): bump cookie to version 0.7.2 (#5205)
Related: https://github.com/advisories/GHSA-pxg6-pf52-xh8x
2024-10-09 17:47:42 +02:00
Damien Arrachequesne
d0fc720420 chore(release): socket.io@4.8.0
Diff: https://github.com/socketio/socket.io/compare/socket.io@4.7.5...socket.io@4.8.0
2024-09-21 10:02:24 +02:00
Damien Arrachequesne
4a0555c671 chore(release): socket.io-client@4.8.0
Diff: https://github.com/socketio/socket.io/compare/socket.io-client@4.7.5...socket.io-client@4.8.0
2024-09-21 09:45:51 +02:00
Damien Arrachequesne
2b60df18a8 chore(release): engine.io@6.6.1
Diff: https://github.com/socketio/socket.io/compare/engine.io@6.6.0...engine.io@6.6.1
2024-09-21 09:30:07 +02:00
Damien Arrachequesne
d4cb375856 ci: ignore tests when publishing to npm 2024-09-21 09:27:42 +02:00
Damien Arrachequesne
c251ae7ba7 chore(release): engine.io-client@6.6.1
Diff: https://github.com/socketio/socket.io/compare/engine.io-client@6.6.0...engine.io-client@6.6.1
2024-09-21 09:07:48 +02:00
Damien Arrachequesne
8a2f5a3da0 fix(eio-client): move 'offline' event listener at the top
Related: https://github.com/socketio/socket.io/issues/5125
2024-09-21 08:47:20 +02:00
Damien Arrachequesne
b04fa64365 fix(sio): allow to join a room in a middleware (uws)
Related:

- https://github.com/socketio/socket.io/issues/4810
- https://github.com/socketio/socket.io/issues/5139
2024-09-21 08:19:32 +02:00
Damien Arrachequesne
7085f0e3e4 refactor(sio-client): mangle private attributes
|          | before  | after   |
|----------|---------|---------|
| min+gzip | 14.6 KB | 14.3 KB |
| min+br   | 13.1 KB | 12.9 KB |

Reference: https://terser.org/docs/options/#mangle-properties-options
2024-09-21 07:48:50 +02:00
Damien Arrachequesne
4f66708210 chore(sio-client): use babel loose mode when transpiling classes
By default, Babel uses `Object.defineProperty()` when transpiling
classes. We'll now use the loose mode which creates a more terse
output.

|          | before  | after   |
|----------|---------|---------|
| min+gzip | 14.9 KB | 14.6 KB |
| min+br   | 13.4 KB | 13.1 KB |

Reference: https://babeljs.io/docs/babel-plugin-transform-classes
2024-09-21 07:44:15 +02:00
Damien Arrachequesne
1a95db2145 chore(sio-client): add a script to compute the bundle size 2024-09-21 07:34:49 +02:00
Damien Arrachequesne
282ae922a4 chore(sio-client): restore the debug package in the dev bundle
The debug package was not included anymore in the dev bundle since the
migration from webpack to rollup ([1]) in version 4.3.0.

[1]: 0661564dc2

Related: https://github.com/socketio/socket.io/issues/5108
2024-09-21 07:33:53 +02:00
Damien Arrachequesne
93010ca3c4 chore(eio-client): bump xmlhttprequest-ssl to version 2.1.1
Related:

- https://github.com/socketio/socket.io/issues/4402
- b01f69a689
2024-09-21 07:32:12 +02:00
Damien Arrachequesne
132d05fc0b fix(sio): expose type of default engine
Related: https://github.com/socketio/socket.io/issues/4693
2024-09-20 11:18:23 +02:00
Damien Arrachequesne
d5095fe98c fix(eio): prevent the client from upgrading twice (uws)
Related: https://github.com/socketio/socket.io/issues/5066
2024-09-19 12:13:42 +02:00
Damien Arrachequesne
da613810fd test(eio): bump uWebSockets.js to version 20.48.0 2024-09-19 12:12:58 +02:00
Damien Arrachequesne
19c48a44e6 refactor(sio): break circular dependency in source code
Related: https://github.com/socketio/socket.io/issues/4329
2024-09-19 09:27:12 +02:00
Damien Arrachequesne
9b3c9abeca fix(eio-client): only remove the event listener if it exists
Related: https://github.com/socketio/socket.io/issues/5088#issuecomment-2217202350
2024-09-19 09:26:26 +02:00
Damien Arrachequesne
043b55c418 refactor(sio): simplify middleware execution (bis) 2024-09-18 22:15:32 +02:00
Damien Arrachequesne
32c761f02f refactor(sio): export the ExtendedError type
Related: https://github.com/socketio/socket.io/issues/4798
2024-09-18 18:22:06 +02:00
Damien Arrachequesne
1f54ee08c6 refactor(sio): simplify middleware execution 2024-09-18 18:21:58 +02:00
Damien Arrachequesne
923a12e2de fix(eio): discard all pending packets when the server is closed
In some specific cases, the transport was not closed right away,
leaving the Node.js process alive even after closing the server.
The HTTP long-polling transport would be closed after the heartbeat
failure and the `closeTimeout` delay (20 + 25 + 30 seconds).

Example:

```js
io.on("connection", (socket) => {
  // the writeBuffer is not empty, so the transport is not closed right away
  io.close();
});
```

Related: https://github.com/socketio/socket.io/issues/5088
2024-09-18 18:17:14 +02:00
Damien Arrachequesne
13c6d2e89d fix(sio-client): allow to manually stop the reconnection loop
```js
socket.io.on("reconnect_attempt", () => {
  socket.io.reconnection(false); // will now work properly
});
```

Related: https://github.com/socketio/socket.io/issues/5126
2024-09-18 11:19:28 +02:00
Tom Jenkinson
8adcfbfde5 fix(sio-client): do not send a packet on an expired connection (#5134)
When a laptop is suspended or a phone is locked, the timer that is used
to check the liveness of the connection is paused and is not able to
detect that the heartbeat has failed.

Previously, emitting a message after resuming the page would lose the
message. The status of the timer will now be checked before sending the
message, so that it gets buffered and sent upon reconnection.

Note: we could also have used the Page Visibility API or a custom
setTimeout() method based on setInterval(), but this would not be as
reliable as the current solution.

Reference: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API

Related: https://github.com/socketio/socket.io/issues/5135
2024-09-18 11:11:22 +02:00
Damien Arrachequesne
7a23dde6ef perf: do not reset the hearbeat timer on each packet
This reverts ed34a45a07

See also: 5359bae683
2024-09-18 11:06:39 +02:00
Damien Arrachequesne
60c757f718 fix(sio-client): accept string | undefined as init argument (bis)
Following: 5a3eafed1c

Related: https://github.com/socketio/socket.io/issues/4873
2024-09-18 08:09:47 +02:00
Damien Arrachequesne
04c8dd979c fix(sio-client): close the engine upon decoding exception
Related: https://github.com/socketio/socket.io/issues/5128
2024-09-18 07:52:37 +02:00
Damien Arrachequesne
2194264820 test(eio-client): reduce test suite duration 2024-09-18 07:52:12 +02:00
Damien Arrachequesne
09f573cad8 test(sio-client): reduce test suite duration 2024-09-18 07:52:12 +02:00
Damien Arrachequesne
fcbecd4f46 ci: restore package-specific tests 2024-09-17 15:07:23 +02:00
Damien Arrachequesne
fd99f2e15f refactor(sio): export the DefaultEventsMap type
Related: https://github.com/socketio/socket.io/issues/4747
2024-09-16 15:49:15 +02:00
Damien Arrachequesne
02d59a0e99 chore: re-enable publish workflow
This reverts commit 7160eb7eb0.

[skip ci]
2024-09-16 09:11:35 +02:00
Damien Arrachequesne
7160eb7eb0 chore: temporarily disable publish workflow
In order to import tags from other repositories.

[skip ci]
2024-09-16 08:56:07 +02:00
Wang Guan
a1ccba3a77 chore: use prettier v3 everywhere (#5169) 2024-09-16 08:43:08 +02:00
Mark Nelissen
e347a3c24e fix(sio): correctly await async close on adapters (#4971)
Following: bf64870957
2024-09-14 08:51:08 +02:00
nayounsang
b5ccfd4838 refactor(eio-client): improve transports type (#5188)
Related: https://github.com/socketio/socket.io/issues/5187
2024-09-14 08:17:36 +02:00
Wang Guan
5d9a2d5544 chore(socket.io-client): bump engine.io-client to version 6.6.0 2024-08-23 23:19:45 +02:00
Wang Guan
d5b22f5a76 chore(socket.io): bump engine.io to version 6.6.0 2024-08-23 23:19:31 +02:00
Damien Arrachequesne
582655f679 test(cluster-engine): fix flaky test cleanup 2024-07-26 09:26:47 +02:00
KartikeSingh
b79d80aa59 docs: fix conjunction with fastify example (#5057)
[skip ci]
2024-07-22 11:32:58 +02:00
Damien Arrachequesne
7fd75e6aac docs(changelog): add changelog for socket.io-parser@3.3.4
Diff: https://github.com/Automattic/socket.io-parser/compare/3.3.3...3.3.4

[skip ci]
2024-07-22 11:28:47 +02:00
Damien Arrachequesne
b7577556e3 docs: add example with NestJS
Reference: https://docs.nestjs.com/websockets/gateways

[skip ci]
2024-07-22 10:07:45 +02:00
Damien Arrachequesne
6e9bff4fcf docs: add example with @socket.io/postgres-adapter
[skip ci]
2024-07-19 15:20:12 +02:00
Damien Arrachequesne
8b0a40fd4a docs: add examples with @socket.io/cluster-engine
[skip ci]
2024-07-19 08:42:38 +02:00
Damien Arrachequesne
1f09a3e979 ci(publish): compile all packages before publishing
As some packages depend on the types of others.

[skip ci]
2024-07-18 10:07:47 +02:00
Damien Arrachequesne
0af50758f6 chore(cluster-engine): update homepage URL 2024-07-18 10:03:57 +02:00
Damien Arrachequesne
b9b16132c2 chore(socket.io-adapter): remove dist before compilation 2024-07-17 10:34:57 +02:00
Damien Arrachequesne
be1e4cb24d ci(publish): update the tag regex
In order to also match "@socket.io/some-package@1.2.3".

Reference: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet

[skip ci]
2024-07-17 10:26:56 +02:00
Damien Arrachequesne
7521ac227b chore(release): @socket.io/cluster-engine@0.1.0 2024-07-17 09:53:34 +02:00
Damien Arrachequesne
b00124b65a feat: implement cluster-friendly engine 2024-07-17 09:27:12 +02:00
Damien Arrachequesne
b7da542890 chore: normalize repository URLs
In order to address the following warning when publishing:

> npm warn publish npm auto-corrected some errors in your package.json when publishing.  Please run "npm pkg fix" to address these errors.
> npm warn publish errors corrected:
> npm warn publish "repository.url" was normalized to "git+https://github.com/socketio/socket.io.git"
2024-07-11 14:59:00 +02:00
Damien Arrachequesne
0692bed462 chore: fix the publish workflow
It seems the "registry-url" variable is mandatory: https://github.com/npm/cli/issues/6184
2024-07-11 13:45:44 +02:00
Damien Arrachequesne
f00fc89b07 chore(release): engine.io-parser@5.2.3 2024-07-11 13:33:58 +02:00
Damien Arrachequesne
f9cb983ab7 fix(engine.io-parser): do not expose the TransformStream type
The previous commit [1] tried to work around the fact that the
TransformStream object is not exposed in the global scope in the
`@types/node` package, even though it is since Node.js `v18.0.0`.

Unfortunately, it created two new issues:

- using an older `@types/node` version (before v16) would fail with:

> error TS2307: Cannot find module 'node:stream/web' or its corresponding type declarations.

Related: https://github.com/socketio/socket.io/issues/5064#issuecomment-2217149344

- browser-only environments would somehow include the node types,
leading to conflicts like the return value of the setTimeout() method

Related:

- https://github.com/socketio/socket.io/issues/5064#issuecomment-2217149374
- https://github.com/socketio/socket.io/issues/5065

[1]: 0305b4a7a5
2024-07-11 13:08:18 +02:00
Damien Arrachequesne
04033b241b chore: add publish workflow (2)
We need to exclude the 'main' branch (it's an OR operator).

Reference: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
2024-07-11 12:38:47 +02:00
Damien Arrachequesne
fbc0313a10 chore: add publish workflow
Reference: https://docs.npmjs.com/generating-provenance-statements
2024-07-11 12:27:36 +02:00
Damien Arrachequesne
2a29c4c30e chore: move dev dependencies in the parent package.json file
Notes:

- TypeScript is updated from v4 to v5
- WebDriverIO is updated from v7 to v8
- prettier is kept in v2, in order to reduce style changes
2024-07-10 10:42:22 +02:00
Damien Arrachequesne
d3761e3e9e docs(security): add the list of CVE for the socket.io-client package 2024-07-09 12:32:14 +02:00
Damien Arrachequesne
afdc3b2916 ci: restore browser tests with Sauce Labs
The `pull_request` trigger is excluded, since the secrets are not
available for those builds.
2024-07-09 11:22:48 +02:00
Damien Arrachequesne
84d2aa74cd chore: update the repository URLs 2024-07-09 10:51:43 +02:00
Damien Arrachequesne
5fae41a0d5 chore: align all MIT licenses text
Note: the owner of the `socket.io` repository was updated to Automattic
in [1], though it was never applied to the other repositories nor
mentioned in the client bundles.

[1]: 340281152f
2024-07-09 10:44:20 +02:00
Damien Arrachequesne
ec79211701 docs: init README for the monorepo 2024-07-08 16:07:34 +02:00
Damien Arrachequesne
8c3debf15a docs: init the contributing guide
Related: https://github.com/socketio/socket.io/issues/4814
2024-07-08 15:33:41 +02:00
Damien Arrachequesne
cbf6df0812 Merge remote-tracking branch 'engine.io-protocol/v3'
Source: https://github.com/socketio/engine.io-protocol/tree/v3
2024-07-08 12:21:31 +02:00
Damien Arrachequesne
1d65f11e93 Merge remote-tracking branch 'engine.io-protocol/main'
Source: https://github.com/socketio/engine.io-protocol
2024-07-08 12:18:53 +02:00
Damien Arrachequesne
498e8e22d6 refactor: prepare the migration to a monorepo 2024-07-08 12:18:11 +02:00
Damien Arrachequesne
68efa28014 refactor: prepare the migration to a monorepo 2024-07-08 12:16:14 +02:00
Damien Arrachequesne
34137d39a9 chore: add new npm workspaces
The following repositories were merged:

- https://github.com/socketio/engine.io-parser
- https://github.com/socketio/engine.io-client
- https://github.com/socketio/engine.io-parser
- https://github.com/socketio/socket.io-adapter
- https://github.com/socketio/emitter
2024-07-08 12:10:24 +02:00
Damien Arrachequesne
8d0c4835dc Merge remote-tracking branch 'socket.io-component-emitter/main' into monorepo
Source: https://github.com/socketio/emitter
2024-07-08 11:10:24 +02:00
Damien Arrachequesne
dce7200378 Merge remote-tracking branch 'socket.io-adapter/main' into monorepo
Source: https://github.com/socketio/socket.io-adapter
2024-07-08 11:09:26 +02:00
Damien Arrachequesne
3546094cfc refactor: prepare the migration to a monorepo 2024-07-08 11:08:10 +02:00
Damien Arrachequesne
90bbd51440 Merge remote-tracking branch 'engine.io/main' into monorepo
Source: https://github.com/socketio/engine.io
2024-07-08 11:03:00 +02:00
Damien Arrachequesne
efe86ee20c refactor: prepare the migration to a monorepo 2024-07-08 11:02:37 +02:00
Damien Arrachequesne
5b2d238dce Merge remote-tracking branch 'engine.io-client/main' into monorepo
Source: https://github.com/socketio/engine.io-client
2024-07-08 11:00:37 +02:00
Damien Arrachequesne
32a1a6039f refactor: prepare the migration to a monorepo 2024-07-08 10:59:50 +02:00
Damien Arrachequesne
e514852a37 Merge remote-tracking branch 'engine.io-parser/main' into monorepo
Source: https://github.com/socketio/engine.io-parser
2024-07-08 10:54:44 +02:00
Damien Arrachequesne
7c4efaa915 refactor: prepare the migration to a monorepo 2024-07-08 10:53:54 +02:00
Damien Arrachequesne
f98fc2810e refactor: prepare the migration to a monorepo 2024-07-08 10:46:34 +02:00
Damien Arrachequesne
c0e448a023 docs: add links to each changelog 2024-07-04 19:02:47 +02:00
Damien Arrachequesne
59838b71a2 docs: move changelog of the socket.io package 2024-07-04 18:59:19 +02:00
Damien Arrachequesne
ae3c26fdd4 docs: restore readme 2024-07-04 18:58:18 +02:00
Damien Arrachequesne
c508501d86 Merge remote-tracking branch 'socket.io-protocol/v3'
Source: https://github.com/socketio/socket.io-protocol/tree/v3
2024-07-04 18:30:39 +02:00
Damien Arrachequesne
bbcad832fa Merge remote-tracking branch 'socket.io-protocol/v4'
Source: https://github.com/socketio/socket.io-protocol/tree/v4
2024-07-04 18:29:51 +02:00
Damien Arrachequesne
f1c8410c3e refactor: prepare the migration to a monorepo 2024-07-04 18:29:15 +02:00
Damien Arrachequesne
93b42f6b77 refactor: prepare the migration to a monorepo 2024-07-04 18:27:57 +02:00
Damien Arrachequesne
dfac908769 Merge remote-tracking branch 'socket.io-protocol/main'
Source: https://github.com/socketio/socket.io-protocol
2024-07-04 18:25:43 +02:00
Damien Arrachequesne
b4002c281f refactor: prepare the migration to a monorepo 2024-07-04 18:23:59 +02:00
Damien Arrachequesne
4cac3724ad chore: update the repository URLs
Reference: https://docs.npmjs.com/cli/v10/configuring-npm/package-json
2024-07-04 18:16:51 +02:00
Damien Arrachequesne
914716d71d ci: move building the examples to its own workflow 2024-07-04 18:08:06 +02:00
Damien Arrachequesne
d9b4c3cb03 ci: create npm workspaces and sort out dependencies
This requires at least npm v7.

Reference: https://docs.npmjs.com/cli/v10/using-npm/workspaces

Note: @types/node is pinned at `18.15.3` because it's the last version
which supports TypeScript v4.2.
2024-07-04 17:48:46 +02:00
Damien Arrachequesne
7aedc79436 Merge remote-tracking branch 'socket.io-parser/main' into monorepo
Source: https://github.com/socketio/socket.io-parser
2024-07-04 17:38:27 +02:00
Damien Arrachequesne
bd02c7234a refactor: prepare the migration to a monorepo 2024-07-04 17:37:35 +02:00
Damien Arrachequesne
b2cf3f72fd Merge remote-tracking branch 'socket.io-client/main' into monorepo
Source: https://github.com/socketio/socket.io-client
2024-07-04 17:36:18 +02:00
Damien Arrachequesne
273093ceae refactor: prepare the migration to a monorepo 2024-07-04 17:35:42 +02:00
Damien Arrachequesne
d9d19b4bb7 refactor: prepare the migration to a monorepo 2024-07-04 17:33:59 +02:00
Damien Arrachequesne
f21de7b00e docs: add note about UTF-8 encoding
Related: https://github.com/socketio/engine.io-protocol/issues/42
2024-07-01 21:54:51 +02:00
Damien Arrachequesne
c815579e1b docs: fix typo
Related: https://github.com/socketio/engine.io-protocol/issues/43
2024-07-01 17:23:19 +02:00
Damien Arrachequesne
88016b808a docs(security): update the list of CVE 2024-06-25 15:48:06 +02:00
Damien Arrachequesne
71eaec477c docs(changelog): improve the changelog for version 6.6.0 2024-06-22 10:20:15 +02:00
Damien Arrachequesne
791aa58f4c chore(release): 6.6.0
Diff: https://github.com/socketio/engine.io/compare/6.5.4...6.6.0
2024-06-21 14:32:55 +02:00
Damien Arrachequesne
6d8a0bea49 refactor: move the req attribute to the polling class 2024-06-21 14:03:22 +02:00
Damien Arrachequesne
c310b7b6b6 refactor: improve types 2024-06-21 14:03:01 +02:00
Damien Arrachequesne
362bc78191 fix: properly call the send callback during upgrade
The "drain" event (added in [1]) had two different meanings:

- the transport is ready to be written
- the packets are sent over the wire

For the WebSocket and the WebTransport transports, those two events
happen at the same time, but this is not the case for the HTTP
long-polling transport:

- the transport is ready to be written when the client sends a GET request
- the packets are sent over the wire when the server responds to the GET request

Which caused an issue with send callbacks during an upgrade, since the
packets were written but the client would not open a new GET request.

There are now two distinct events: "ready" and "drain"

Related: https://github.com/socketio/engine.io/issues/695

[1]: 2a93f06e27
2024-06-21 11:47:41 +02:00
dependabot[bot]
afd29341ee chore(dev-deps): bump ws and engine.io-client in /examples/memory-usage (#703)
Bumps [ws](https://github.com/websockets/ws) to 8.17.1 and updates ancestor dependency [engine.io-client](https://github.com/socketio/engine.io-client). These dependencies need to be updated together.


Updates `ws` from 8.11.0 to 8.17.1
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/8.11.0...8.17.1)

Updates `engine.io-client` from 6.5.3 to 6.5.4
- [Release notes](https://github.com/socketio/engine.io-client/releases)
- [Changelog](https://github.com/socketio/engine.io-client/blob/6.5.4/CHANGELOG.md)
- [Commits](https://github.com/socketio/engine.io-client/compare/6.5.3...6.5.4)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
- dependency-name: engine.io-client
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 20:18:57 +02:00
dependabot[bot]
56c4664bcf chore(deps-dev): bump braces from 3.0.2 to 3.0.3 (#701)
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 20:18:35 +02:00
Damien Arrachequesne
6b9e3e458e refactor: improve types 2024-06-18 17:37:12 +02:00
Damien Arrachequesne
f521cbab6d refactor: simplify the heartbeat code 2024-06-18 17:32:06 +02:00
Damien Arrachequesne
5359bae683 perf: do not reset the hearbeat timer on each packet
This behavior was added in [1]. However, there are two problems:

- a new timer is allocated every time a packet is received, which is
wasteful

- the next heartbeat is not actually delayed, since it's the timeout
timer which gets reset, and not the interval timer

Note: delaying the next heartbeat would be a breaking change.

[1]: be7b4e7478
2024-06-18 17:17:17 +02:00
Semih Han Ordu
fb5904ee5f chore(deps): bump ws to version 8.17.1 (#5052)
Includes the following security fix: e55e5106f1

Advisory: https://github.com/advisories/GHSA-3h5v-q93c-6h6q
Diff: https://github.com/websockets/ws/compare/8.11.0...8.17.1
2024-06-18 14:40:30 +02:00
Damien Arrachequesne
05a190a9db chore(release): 6.5.5
Diff: https://github.com/socketio/socket.io-adapter/compare/2.5.4...2.5.5
2024-06-18 12:23:45 +02:00
Andrew Bromwich
93fe19019e chore(deps): bump ws from 8.11.0 to 8.17.1 (#93)
Includes the following security fix: e55e5106f1

Advisory: https://github.com/advisories/GHSA-3h5v-q93c-6h6q
Diff: https://github.com/websockets/ws/compare/8.11.0...8.17.1
2024-06-18 12:21:29 +02:00
Damien Arrachequesne
d3f45dca38 docs(changelog): add release notes for versions 3.6.2 and 6.5.5 2024-06-18 10:47:10 +02:00
dependabot[bot]
3c4d314998 chore(deps): bump ws from 8.11.0 to 8.17.1 (#702)
Bumps [ws](https://github.com/websockets/ws) from 8.11.0 to 8.17.1.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/8.11.0...8.17.1)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 09:57:32 +02:00
Damien Arrachequesne
b0721e6407 ci: upgrade to actions/checkout@4 and actions/setup-node@4
Reference: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/
2024-06-17 17:50:39 +02:00
Damien Arrachequesne
9a68c8ce93 perf(websocket): use bound callbacks
Instead of allocating one temporary function for each WebSocket
`send()` call.

Regarding the test removal, the permessage-deflate threshold was
implemented in the "ws" package in [1], so it's not needed anymore.

[1]: 6b3904b42d
2024-06-17 17:47:46 +02:00
Damien Arrachequesne
62f59b6cf3 refactor: remove unnecessary array allocation
If the `packetsFn` array is empty, there is no need to allocate one new
array.
2024-06-14 01:07:48 +02:00
Damien Arrachequesne
407c3ad236 refactor: simplify the handling of the "drain" event
The two event handlers are merged into one.
2024-06-14 00:30:14 +02:00
Damien Arrachequesne
ef1c4c8bb7 refactor: remove the wsPreEncoded option
The wsPreEncoded option was added in the `socket.io-adapter` package
when broadcasting a message to multiple clients.

It was removed in [1] and is now superseded by the `wsPreEncodedFrame`
option, which directly computes the WebSocket frame once for all
clients (see [2]).

[1]: 88eee5948a
[2]: 5f7b47d40f
2024-06-13 23:55:16 +02:00
Damien Arrachequesne
8955eb7b75 docs(examples): add some examples to track the memory usage
Related: fc21c4a05f
2024-06-13 23:21:26 +02:00
Jonathan Perret
fc21c4a05f fix: fix websocket and webtransport send callbacks (#699)
With the `websocket` transport, the callbacks which indicate that the
packets are actually written were not properly called.

Example:

```js
socket.send("hello", () => {
  // the message has been written to the underlying transport
});
```

The bug was caused by the `websocket` transport (and `webtransport` as
well) having its `supportsFraming` property set to `true`, despite
having been changed in [1] to emit a single `drain` event for each
batch of messages written to the transport like the `polling` transport
always did. Note that although [1] is partially reverted in [2], the
new `drain` event behavior is preserved as called out in that commit's
message.

The `supportsFraming` attribute was introduced in [3] (amended by [4])
as a way to distinguish transports that emit one `drain` per message
from those that emit one `drain` per batch. Since the delivery of
`send` callbacks depends on matching `drain` events with
`transport.send` calls, that distinction is vital to correct behavior.

However, now that all transports have converged to "one `drain` per
batch" behavior, this `supportsFraming` property can be retired (and
the code for calling callbacks simplified).

[1]: https://github.com/socketio/engine.io/pull/618
[2]: a65a047526
[3]: https://github.com/socketio/engine.io/pull/130
[4]: https://github.com/socketio/engine.io/pull/132

Related: https://github.com/socketio/engine.io/issues/698
2024-06-13 23:02:22 +02:00
Jakub Szaredko
579d34412a chore: fix compilation on macOS (#1616) 2024-06-11 12:30:57 +02:00
tnfAngel
31f10f6808 fix(types): make io#httpServer public (#5035)
Related: https://github.com/socketio/socket.io/issues/5034
2024-05-27 18:09:14 +02:00
pouria azad
89c4c7eb47 refactor(examples): minor tweak (#5017) 2024-05-10 05:00:20 +02:00
Gah Tang
239a2a82d0 fix: fix broadcasting from a parent namespace (#5009)
Following [1], emitting from a dynamic namespace to a room would throw
this error:

> node_modules/socket.io/dist/parent-namespace.js:88
>         this.children.forEach((nsp) => {
>                       ^
> 
> TypeError: Cannot read properties of undefined (reading 'forEach')
>     at ParentBroadcastAdapter.broadcast (node_modules/socket.io/dist/parent-namespace.js:88:23)
>    at BroadcastOperator.emit (node_modules/socket.io/dist/broadcast-operator.js:169:26)
>    at Socket.<anonymous> (server.js:60:33)
>    at Socket.emit (node:events:520:28)
>    at Socket.emitReserved (node_modules/socket.io/dist/typed-events.js:56:22)
>    at Socket._onclose (node_modules/socket.io/dist/socket.js:547:14)
>    at Client.onclose (node_modules/socket.io/dist/client.js:247:20)
>    at Socket.emit (node:events:532:35)
>    at Socket.onClose (node_modules/engine.io/build/socket.js:304:18)
>    at Object.onceWrapper (node:events:639:28)

Previous output code:

```js
class ParentNamespace extends namespace_1.Namespace {
    constructor(server) {
        super(server, "/_" + ParentNamespace.count++);
        this.children = new Set();
    }
    _initAdapter() {
        this.adapter = new ParentBroadcastAdapter(this, this.children);
    }
}
```

Here, `super()` calls `Namespace._initAdapter()`, but `this.children`
is not defined yet, hence the problem.

[1]: b9ce6a25d1

Related: https://github.com/socketio/socket.io/issues/4985
2024-04-26 15:36:26 +02:00
Damien Arrachequesne
b25e728da0 docs: update TypeScript example 2024-04-26 07:45:48 +02:00
Damien Arrachequesne
8a2ece1f36 chore(release): 3.1.2
Diff: https://github.com/socketio/emitter/compare/3.1.1...3.1.2
2024-04-26 07:31:29 +02:00
Damien Arrachequesne
e6aa1a331c fix: point towards the CommonJS types
In order to fix the following issue:

> error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@socket.io/component-emitter")' call instead.
>
> 1 import { Emitter } from "@socket.io/component-emitter";

This problem was introduced in [1], when reworking the dual packaging.

Related: https://github.com/socketio/socket.io-parser/issues/132

[1]: ba6b56de2c
2024-04-26 07:26:11 +02:00
Damien Arrachequesne
14d4997dbc docs: add example with NW.js 2024-04-12 11:13:31 +02:00
Damien Arrachequesne
c68478dcf8 chore(release): 3.1.1
Diff: https://github.com/socketio/emitter/compare/4.0.0...3.1.1
2024-04-10 16:51:42 +02:00
Damien Arrachequesne
ba6b56de2c refactor: rework the dual CommonJS/ES packages
In order to remove the .mjs file, which causes some problems with React
Native.

Related: https://github.com/socketio/socket.io-client/issues/1598
2024-04-10 16:27:02 +02:00
Damien Arrachequesne
4476b52981 revert: refactor: rename emitReserved to _emitReserved to improve mangling
This reverts commit 0852bda0b4.

The impact on the final bundle size is negligible.
2024-04-10 16:20:21 +02:00
Damien Arrachequesne
28c9ed4331 ci: init GitHub Actions 2024-04-10 16:17:24 +02:00
Damien Arrachequesne
907f102517 docs: update React Native example 2024-04-05 19:19:39 +02:00
dependabot[bot]
79ea52dc09 chore(deps): bump express from 4.18.2 to 4.19.2 in /examples/latency (#700)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-29 10:29:47 +01:00
Damien Arrachequesne
be2da4e4dc docs: add example with Nuxt 2024-03-29 10:00:23 +01:00
Damien Arrachequesne
61f444956b docs: add example with Next.js (with app router) 2024-03-27 11:02:03 +01:00
Damien Arrachequesne
b0568b20c1 docs: add example with Next.js (with pages router) 2024-03-25 18:05:22 +01:00
Damien Arrachequesne
50176812a1 chore(release): 4.7.5
Diff: https://github.com/socketio/socket.io/compare/4.7.4...4.7.5
2024-03-14 17:55:23 +01:00
Damien Arrachequesne
4f6030f2c4 chore(release): 4.7.5
Diff: https://github.com/socketio/socket.io-client/compare/4.7.4...4.7.5
2024-03-14 17:43:43 +01:00
Damien Arrachequesne
34cbfbb532 fix: discard acknowledgements upon disconnection
Previously, getting disconnected while waiting for an acknowledgement
would create a memory leak, as the acknowledgement was never received
and the handler would stay in memory forever.

This commit fixes the issue:

- handlers that do accept an error as first argument, such as:

* `socket.emit("test", (err, value) => { ... })` with `ackTimeout` option
* `socket.timeout(5000).emit("test", (err, value) => { ... })`
* `const value = await socket.emitWithAck("test")`

will now properly resolve with an error and get discarded.

- handlers that don't like `socket.emit("test", (value) => { ... });`
will simply be discarded upon disconnection

Note: the structure of the 'acks' attribute has been left untouched, in
order to prevent any breaking change.

Related:

- https://github.com/socketio/socket.io-client/issues/1546
- https://github.com/socketio/socket.io/issues/4964
2024-03-14 17:34:29 +01:00
Damien Arrachequesne
bf64870957 fix: close the adapters when the server is closed
Related:

- https://github.com/socketio/socket.io-mongo-adapter/issues/9
- https://github.com/socketio/socket.io-postgres-adapter/issues/13
- 0e23ff0cc6
2024-02-23 12:10:29 +01:00
Jonathan Perret
0efa04b584 fix(types): make socket.request writable (#697)
Related: https://github.com/socketio/engine.io/issues/696
2024-02-23 10:21:43 +01:00
Damien Arrachequesne
748e18c22e ci: test with older TypeScript version
Related: https://github.com/socketio/socket.io/issues/3891
2024-02-22 10:12:18 +01:00
Damien Arrachequesne
5eae5a0b54 chore(release): 2.5.4
Diff: https://github.com/socketio/socket.io-adapter/compare/2.5.3...2.5.4
2024-02-22 09:33:01 +01:00
Damien Arrachequesne
005d546767 ci: test with older TypeScript version 2024-02-22 09:31:39 +01:00
Damien Arrachequesne
a13f35f0e6 fix: ensure the order of the commands
Before this change, the broadcast() method would send the BROADCAST
command and then apply it locally (which is required to retrieve the
offset of the message, when connection state recovery is enabled),
while the other commands like disconnectSockets() would first apply it
locally and then send the command to the other nodes.

So, for example:

```js
io.emit("bye");
io.disconnectSockets();
```

In that case, the clients connected to the io instance would not receive
the "bye" event, while the clients connected to the other server
instances would receive it before being disconnected.

Related:

- https://github.com/socketio/socket.io-redis-streams-adapter/issues/13
- https://github.com/socketio/socket.io-postgres-adapter/issues/12
2024-02-22 09:15:45 +01:00
Damien Arrachequesne
207c0dba1a refactor: break circular dependency (2) 2024-02-22 08:34:29 +01:00
Damien Arrachequesne
abc93a9ac7 refactor: break circular dependency (1)
This will be done in two steps, in order to preserve the history of the
index.ts file.
2024-02-22 08:32:40 +01:00
Damien Arrachequesne
9d4c4a75a4 refactor(cluster): export ClusterAdapterOptions and MessageType types
Related:

- 89d00a49e4/lib/adapter.ts (L17)
- 89d00a49e4/lib/adapter.ts (L191)
2024-02-22 08:01:30 +01:00
Damien Arrachequesne
ca397f3afe fix(types): ensure compatibility with TypeScript < 4.5
"import { type ... }" was added in TypeScript 4.5.

Reference: https://devblogs.microsoft.com/typescript/announcing-typescript-4-5/

Related:

- https://github.com/socketio/socket.io-adapter/issues/86
- https://github.com/socketio/socket.io/issues/3891
2024-02-22 07:54:48 +01:00
Damien Arrachequesne
549156c064 chore(release): 2.5.3
Diff: https://github.com/socketio/socket.io-adapter/compare/2.5.2...2.5.3
2024-02-21 12:33:48 +01:00
Damien Arrachequesne
5dcd182736 refactor(cluster): make onMessage() method synchronous
The fetchSockets() method of the parent class is synchronous, so the
onMessage() method does not need to be asynchronous.
2024-02-21 12:09:29 +01:00
Damien Arrachequesne
1d8da64514 ci: upgrade to actions/checkout@4 and actions/setup-node@4
Reference: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/
2024-02-21 11:46:21 +01:00
Damien Arrachequesne
48eddc19ea ci: use Node.js 20
Reference: https://github.com/nodejs/Release
2024-02-21 11:46:21 +01:00
Damien Arrachequesne
2df5e94c81 test(cluster): init the test suite for the clustered adapter
The test suite is imported from [1].

[1]: 193883b9ca/test/index.ts
2024-02-21 11:38:16 +01:00
Damien Arrachequesne
2a6a215600 refactor(cluster): add explicit types 2024-02-20 16:49:23 +01:00
Damien Arrachequesne
d99a71b558 perf(cluster): use timer.refresh()
Reference: https://nodejs.org/api/timers.html#timeoutrefresh
2024-02-20 16:49:23 +01:00
Damien Arrachequesne
39d4220814 refactor(cluster): catch publish errors
Note: the current API does not currently allow the user to handle those
errors (and retry, for example). This might be worth investigating for
the next major version, maybe something like:

```js
try {
  await io.emit("hello");
} catch (e) {
  // something went wrong
}
```

Related: https://github.com/socketio/socket.io-mongo-adapter/issues/15
2024-02-20 16:49:12 +01:00
Damien Arrachequesne
1011ab3bfb refactor(cluster): allow to call onMessage() with a cluster response
The Redis adapter is currently the only adapter which makes a
distinction between publishing messages (one channel for all) and
responses (one channel for each node).
2024-02-20 16:21:50 +01:00
Damien Arrachequesne
0e23ff0cc6 fix(cluster): notify the other nodes when closing
The clustered adapter will now:

- periodically check if a node has left the cluster
- send an event when it leaves the cluster

This should reduce the number of "timeout reached: only x responses
received out of y" errors.
2024-02-20 16:12:47 +01:00
Damien Arrachequesne
80af4e939c fix(cluster): fix count in fetchSockets() method
Related: bd32763043
2024-02-20 15:53:08 +01:00
Damien Arrachequesne
b2d36951ef refactor(cluster): add explicit message types 2024-02-20 15:53:04 +01:00
Damien Arrachequesne
b157e9e1ac refactor: import the ClusterAdapter abstract class
Imported from ef5f0da0b4/lib/cluster-adapter.ts

This abstract class is currently used by the sharded Redis adapter. We
import it here because the logic can be reused by the other adapters,
which will then only need to handle the pub/sub mechanism.
2024-02-20 15:46:13 +01:00
Wang Guan
b9ce6a25d1 refactor: create specific adapter for parent namespaces (#4950) 2024-02-19 22:01:29 +01:00
Damien Arrachequesne
54dabe5bff ci: upgrade to actions/checkout@4 and actions/setup-node@4
Reference: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/
2024-02-12 18:16:10 +01:00
Damien Arrachequesne
e426f3e8e1 fix: remove duplicate pipeline when serving bundle
Related: https://github.com/socketio/socket.io/issues/4946
2024-02-12 18:11:38 +01:00
Damien Arrachequesne
69d02dd754 chore(release): 5.2.2
Diff: https://github.com/socketio/engine.io-parser/compare/5.2.1...5.2.2
2024-02-05 18:35:35 +01:00
Damien Arrachequesne
0305b4a7a5 fix(typescript): properly import the TransformStream type
When compiling with TypeScript with module set to "node16" and
moduleResolution to "node16", the following error would be thrown:

> node_modules/engine.io-parser/build/cjs/index.d.ts:6:54 - error TS2304: Cannot find name 'TransformStream'.
> 6 export declare function createPacketEncoderStream(): TransformStream<Packet, any>;
>                                                        ~~~~~~~~~~~~~~~
> node_modules/engine.io-parser/build/cjs/index.d.ts:7:96 - error TS2304: Cannot find name 'TransformStream'.
> 7 export declare function createPacketDecoderStream(maxPayload: number, binaryType: BinaryType): TransformStream<Uint8Array, any>;
>                                                                                                  ~~~~~~~~~~~~~~~
> Found 2 errors in the same file, starting at: node_modules/engine.io-parser/build/cjs/index.d.ts:6

This is because the TransformStream object is not exposed in the global
scope in the `@types/node` package, even though it is since Node.js
`v18.0.0`.

Reference: https://nodejs.org/api/webstreams.html#class-transformstream

Note: we only import the TransformStream type (not value) because it
isn't defined on older Node.js versions.

Related:

- https://github.com/socketio/engine.io-parser/issues/136
- https://github.com/socketio/socket.io-client/issues/1606
2024-02-05 18:20:49 +01:00
Damien Arrachequesne
08cff77a48 chore: bump prettier to version 3
This change is necessary to be able to write "import type { ... }".
2024-02-05 18:20:30 +01:00
Damien Arrachequesne
e36062ca2d docs: update the webtransport example
Reference: https://github.com/fails-components/webtransport#changes-for-version-1xx
2024-01-17 13:01:57 +01:00
Damien Arrachequesne
0bbe8aec77 docs: only execute the passport middleware once
Before this change, the session and user context were retrieved once
per HTTP request and not once per session.
2024-01-13 17:56:17 +01:00
Damien Arrachequesne
914a8bd2b9 docs: add example with JWT
Related: https://github.com/socketio/socket.io/issues/4910
2024-01-13 17:14:01 +01:00
Damien Arrachequesne
d943c3e0b0 docs: update the Passport.js example 2024-01-12 17:08:19 +01:00
Damien Arrachequesne
6ab2509d52 chore(release): 4.7.4
Diff: https://github.com/socketio/socket.io/compare/4.7.3...4.7.4
2024-01-12 11:09:14 +01:00
Damien Arrachequesne
8cfea8c30b chore(release): 4.7.4
Diff: https://github.com/socketio/socket.io-client/compare/4.7.3...4.7.4
2024-01-12 11:03:23 +01:00
Zachary Soare
d9fb2f64b6 chore(tests): add a test for noArgs in a namespace 2024-01-08 06:38:57 +01:00
Zachary Soare
2c0a81cd87 chore(tests): fix issues due to client#id type change 2024-01-08 06:38:57 +01:00
Zachary Soare
f8d2644921 chore(tests): add type defs for expectjs and fix invalid expectations 2024-01-08 06:38:57 +01:00
Zachary Soare
04640d68cf chore(tests): indicate a future ts error with version 2024-01-08 06:38:57 +01:00
Zachary Soare
cb6d2e02aa fix(typings): calling io.emit with no arguments incorrectly errored
Refs: #4914
2024-01-08 06:38:57 +01:00
Damien Arrachequesne
80b2c34478 chore: bump socket.io-client version 2024-01-03 21:37:25 +01:00
Damien Arrachequesne
0d893196f8 chore(release): 4.7.3
Diff: https://github.com/socketio/socket.io/compare/4.7.2...4.7.3
2024-01-03 21:33:29 +01:00
Damien Arrachequesne
ca5d50ebac chore(release): 4.7.3
Diff: https://github.com/socketio/socket.io-client/compare/4.7.2...4.7.3
2024-01-03 21:25:21 +01:00
BCCSTeam
df8e70f798 fix: return the first response when broadcasting to a single socket (#4878) 2024-01-02 17:43:10 +01:00
Damien Arrachequesne
f9c16f2265 fix(typings): fix the type of the socket#id attribute
Related: https://github.com/socketio/socket.io/issues/4884
2024-01-02 15:55:56 +01:00
Damien Arrachequesne
b3f0cab1a0 ci: add Node.js 20 in the test matrix
Reference: https://github.com/nodejs/Release
2023-11-24 08:48:19 +01:00
Damien Arrachequesne
5a3eafed1c fix(typings): accept string | undefined as init argument
Related: https://github.com/socketio/socket.io/issues/4873
2023-11-24 08:48:08 +01:00
Xì Gà
8c9ebc30e5 fix(typings): allow to bind to a non-secure Http2Server (#4853) 2023-11-22 17:48:59 +01:00
Damien Arrachequesne
efb5c21e85 docs(examples): add Vue client with CRUD example 2023-11-22 10:12:17 +01:00
Damien Arrachequesne
3848280125 docs(examples): upgrade basic-crud-application to Angular v17
Related: https://github.com/socketio/socket.io/issues/4875
2023-11-21 14:15:50 +01:00
dependabot[bot]
23213858c6 chore: bump browserify-sign from 4.2.1 to 4.2.2 (#138)
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.2.
- [Changelog](https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md)
- [Commits](https://github.com/crypto-browserify/browserify-sign/compare/v4.2.1...v4.2.2)

---
updated-dependencies:
- dependency-name: browserify-sign
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-10 18:12:46 +01:00
Damien Arrachequesne
ff0fbfb61f chore(release): 6.5.4
Diff: https://github.com/socketio/engine.io/compare/6.5.3...6.5.4
2023-11-09 18:07:45 +01:00
Damien Arrachequesne
09acb177a6 ci: add Node.js 20 in the test matrix
Reference: https://github.com/nodejs/Release
2023-11-09 18:04:07 +01:00
Damien Arrachequesne
39937f8f4d refactor: minor cleanups 2023-11-09 12:18:55 +01:00
Damien Arrachequesne
43c1c1c1e2 refactor: simplify code 2023-11-09 12:13:15 +01:00
Damien Arrachequesne
3b5e79ef79 refactor: remove useless references
Those timers are only used during the upgrade, so there is no need to
keep those references in memory.
2023-11-09 12:05:38 +01:00
Damien Arrachequesne
f27a6c3501 refactor: remove useless reference
A reference to the initial IncomingMessage object (the first HTTP
request of the session) is kept in memory by default (`socket.request`),
so its attached ServerResponse object (`req.res`) would not be
garbage-collected. This will now be the case.

Note: the IncomingMessage object is needed in two cases:

- when working with the `express-session` middleware (`request.session`)
- when fetching the certificate of the client with `request.socket.getPeerCertificate()`

That's why removing it would be a breaking change.
2023-11-09 11:45:43 +01:00
Tyler Butler
605de78d2c fix: improve compatibility with node16 module resolution (#1595)
Related:

- https://github.com/microsoft/TypeScript/issues/46770#issuecomment-966612103
- https://github.com/socketio/socket.io-client/issues/1589
2023-11-06 23:34:58 +01:00
dependabot[bot]
b96f0cb45a chore: bump @babel/traverse from 7.9.5 to 7.23.2 (#137)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.9.5 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-23 22:19:35 +02:00
Damien Arrachequesne
9f76ea22b4 ci: bump appiumVersion for Android tests in SauceLabs
> Error: Appium 1.22.1 does not support Android latest.
2023-10-23 22:18:28 +02:00
dependabot[bot]
9228596240 chore: bump @babel/traverse from 7.9.6 to 7.23.2 (#126)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.9.6 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-23 22:17:11 +02:00
Damien Arrachequesne
d00ccd253d ci: bump appiumVersion for Android tests in SauceLabs
> Error: Appium 1.22.1 does not support Android latest.
2023-10-23 11:54:38 +02:00
Damien Arrachequesne
9a2a83fdd4 refactor: cleanup after merge 2023-10-11 10:45:59 +02:00
Zachary Haber
f6ef267b03 refactor(typings): improve emit types (#4817)
This commit fixes several issues with emit types:

- calling `emit()` without calling `timeout()` first is now only available for events without acknowledgement
- calling `emit()` after calling `timeout()` is now only available for events with an acknowledgement
- calling `emitWithAck()` is now only available for events with an acknowledgement
- `timeout()` must be called before calling `emitWithAck()`
2023-10-11 10:37:13 +02:00
Maxime Kjaer
1cdf36bfea test: build examples in the CI (#3856) 2023-10-10 20:02:52 +02:00
Toha
bbf1fdc7a6 docs: add Elephant.IO as PHP client library (#4779) 2023-10-10 17:32:19 +02:00
Damien Arrachequesne
2da559a8fa chore(release): 6.5.3
Diff: https://github.com/socketio/engine.io/compare/6.5.2...6.5.3
2023-10-06 10:20:34 +02:00
Damien Arrachequesne
9545b44b3c refactor: add cache-control header in the polling response
This header should not be needed since the client already includes a
cache busting query parameter ("t"), but a misconfigured CDN could
ignore the query parameters and cache the server response.

Related: https://github.com/socketio/socket.io/issues/4842
2023-10-05 17:19:08 +02:00
Damien Arrachequesne
ff1c861548 fix(webtransport): properly handle abruptly closed connections
Refreshing the page with a client connected with WebTransport would
trigger the following exception:

> node:internal/process/promises:288
>            triggerUncaughtException(err, true /* fromPromise */);
>            ^
>
> [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "0".] {
>   code: 'ERR_UNHANDLED_REJECTION'
> }

Related: https://github.com/socketio/engine.io/issues/688
2023-10-05 16:57:33 +02:00
Damien Arrachequesne
b4dc83eb9b docs(examples): add codesandbox configuration 2023-09-20 12:57:37 +02:00
Damien Arrachequesne
ccbb4c0773 docs: add example with connection state recovery 2023-09-20 12:45:04 +02:00
Théodore Prévot
4f633dd6a4 docs: add test should close the connection if no handshake is received (#31) 2023-09-19 17:15:55 +02:00
Damien Arrachequesne
d744fda772 docs: improve example with express-session
The example is now available with different syntaxes:

- CommonJS
- ES modules
- TypeScript

Related: https://github.com/socketio/socket.io/pull/4787
2023-09-13 15:56:15 +02:00
Damien Arrachequesne
8259cdac84 docs: use io.engine.use() with express-session
Related: https://github.com/socketio/socket.io/discussions/4819
2023-09-13 12:13:03 +02:00
Avi Vahl
c6bf8c0f57 fix: improve compatibility with node16 module resolution (#689)
Related: https://github.com/microsoft/TypeScript/issues/46770#issuecomment-966612103
2023-08-17 07:59:32 +02:00
Damien Arrachequesne
fd9dd74eee docs: use "connection" instead of "connect"
"connect" and "connection" have the same meaning, but "connection" is
the preferred version.
2023-08-12 10:10:55 +02:00
Damien Arrachequesne
9efa1d0aec test: add more stream decoding tests 2023-08-05 00:34:20 +02:00
Damien Arrachequesne
c332643ad8 chore(release): 4.7.2
Diff: https://github.com/socketio/socket.io/compare/4.7.1...4.7.2
2023-08-03 01:51:04 +02:00
Damien Arrachequesne
3468a197af fix(webtransport): properly handle WebTransport-only connections
A WebTransport-only connection has no `request` attribute, so we need
to handle that case.
2023-08-03 01:45:21 +02:00
Damien Arrachequesne
928d76d255 chore(release): 4.7.2
Diff: https://github.com/socketio/socket.io-client/compare/4.7.1...4.7.2
2023-08-03 01:40:17 +02:00
Damien Arrachequesne
09d45491c4 chore: bump engine.io to version 6.5.2
Diff: https://github.com/socketio/engine.io/compare/6.5.0...6.5.2
Release notes: https://github.com/socketio/engine.io/releases/tag/6.5.2
2023-08-03 00:39:46 +02:00
Damien Arrachequesne
74ca7ac0c7 chore: bump engine.io-client to version 6.5.2
Diff: https://github.com/socketio/engine.io-client/compare/6.5.1...6.5.2
Release notes: https://github.com/socketio/engine.io-client/releases/tag/6.5.2
2023-08-03 00:30:57 +02:00
Damien Arrachequesne
12ca32b534 chore(release): 6.5.2
Diff: https://github.com/socketio/engine.io/compare/6.5.1...6.5.2
2023-08-02 02:00:02 +02:00
Damien Arrachequesne
a306db09e8 fix(webtransport): add proper framing
WebTransport being a stream-based protocol, the chunking boundaries are
not necessarily preserved. That's why we need a header indicating the
type of the payload (plain text or binary) and its length.

We will use a format inspired by the WebSocket frame:

- first bit indicates whether the payload is binary
- the next 7 bits are either:
  - 125 or less: that's the length of the payload
  - 126: the next 2 bytes represent the length of the payload
  - 127: the next 8 bytes represent the length of the payload

Reference: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#decoding_payload_length

Related:

- https://github.com/socketio/engine.io/issues/687
- https://github.com/socketio/engine.io/issues/688
2023-08-02 01:00:42 +02:00
Damien Arrachequesne
58626c7edd chore(release): 5.2.1
Diff: https://github.com/socketio/engine.io-parser/compare/5.2.0...5.2.1
2023-08-02 00:32:16 +02:00
Damien Arrachequesne
0b5e98591e refactor: prepend a header to each WebTransport chunk
This commit updates the format of the header added in [1], in order to
match the format used for a WebSocket frame ([2]).

Two advantages:

- small payloads only need 1 byte instead of 4
- payloads larger than 2^31 bytes are supported

[1]: 6142324fa6
[2]: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#decoding_payload_length
2023-08-02 00:29:45 +02:00
Damien Arrachequesne
aea321cadc chore(release): 5.2.0
Diff: https://github.com/socketio/engine.io-parser/compare/5.1.0...5.2.0
2023-07-31 08:47:00 +02:00
Damien Arrachequesne
6142324fa6 feat: prepend a header to each WebTransport chunk
WebTransport is a stream-based protocol, so chunking boundaries are not
always preserved.

That's why we will now prepend a 4-bytes header to each chunk:

- first bit indicates whether the payload is plain text (0) or binary (1)
- next 31 bits indicate the length of the payload

See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#format
2023-07-31 08:09:27 +02:00
Damien Arrachequesne
2d0b75595c chore: bump dev dependencies 2023-07-31 08:08:54 +02:00
Jaro
0731c0d2f4 fix: clean up child namespace when client is rejected in middleware (#4773)
Related: https://github.com/socketio/socket.io/issues/4772
2023-07-21 08:33:46 +02:00
Damien Arrachequesne
03046a64ad docs: update the list of supported Node.js versions
The Engine.IO server uses `timeout.refresh()` (see [1]), which was
added in Node.js 10.2.0.

Reference: https://nodejs.org/api/timers.html#timeoutrefresh

Related: https://github.com/socketio/engine.io/issues/686

[1]: 37474c7e67
2023-07-09 10:14:49 +02:00
Damien Arrachequesne
7dd1350bf9 docs: update the list of supported Node.js versions
The server uses `timeout.refresh()` (see [1]), which was added in Node.js 10.2.0.

Reference: https://nodejs.org/api/timers.html#timeoutrefresh

Related: https://github.com/socketio/engine.io/issues/686

[1]: 37474c7e67
2023-07-09 10:08:50 +02:00
Damien Arrachequesne
56a53bceb9 ci: add Node.js 20 in the test matrix 2023-07-09 10:03:47 +02:00
Damien Arrachequesne
683720a67d test: fix flaky test 2023-07-09 10:03:46 +02:00
Damien Arrachequesne
a529eb08d6 chore: bump dev dependencies 2023-07-09 10:03:32 +02:00
Théodore Prévot
05488c41f6 docs: improve test suite (#46)
The second WebSocket created after an upgrade should gracefully close
and not throw an error as specified the official implementation.
2023-07-08 08:34:14 +02:00
Sleeyax
723c7bab4d docs: add test suite (#45) 2023-07-02 09:39:37 +02:00
Damien Arrachequesne
443e447087 docs(examples): add example with WebTransport 2023-06-29 11:21:27 +02:00
Damien Arrachequesne
2f6cc2fa42 chore(release): 4.7.1
Diff: https://github.com/socketio/socket.io/compare/4.7.0...4.7.1
2023-06-28 09:32:32 +02:00
Damien Arrachequesne
0536fccfc2 chore(release): 4.7.1
Diff: https://github.com/socketio/socket.io-client/compare/4.7.0...4.7.1
2023-06-28 09:18:27 +02:00
Damien Arrachequesne
6169bb8782 chore: bump dev dependencies 2023-06-28 09:11:32 +02:00
Damien Arrachequesne
84ec6cf427 refactor: expose the ESM build with debug (bis)
This reverts the previous commit ([1]), and expose the ESM build that
includes the debug package on a subpath:

```js
import { io } from "socket.io-client/debug";
```

Reference: https://nodejs.org/api/packages.html#subpath-exports

Related: https://github.com/socketio/socket.io-client/issues/1586

[1]: 781d753a62
2023-06-28 09:11:24 +02:00
Damien Arrachequesne
630ff412a4 chore: bump engine.io-client to version 6.5.1
Diff: https://github.com/socketio/engine.io-client/compare/6.5.0...6.5.1
Release notes: https://github.com/socketio/engine.io-client/releases/tag/6.5.1
2023-06-28 08:56:49 +02:00
Damien Arrachequesne
98915d0b61 chore(release): 6.5.1
Diff: https://github.com/socketio/engine.io/compare/6.5.0...6.5.1
2023-06-27 09:13:22 +02:00
Ben Weintraub
6dd2bc4f68 fix: prevent crash when accessing TextDecoder (#684)
The TextDecoder object was added on the global object in Node.js
v11.0.0, so older versions would throw:

> ReferenceError: TextDecoder is not defined

Reference: https://nodejs.org/api/util.html#new-textdecoderencoding-options
2023-06-27 09:01:26 +02:00
Damien Arrachequesne
00d8ee5b05 chore(release): 4.7.0
Diff: https://github.com/socketio/socket.io/compare/4.6.2...4.7.0
2023-06-22 11:27:45 +02:00
Damien Arrachequesne
9b235ec01d chore(release): 4.7.0
Diff: https://github.com/socketio/socket.io-client/compare/4.6.2...4.7.0
2023-06-22 11:20:22 +02:00
Max Stepanov
f2892aba0b fix: use same scope for setTimeout and clearTimeout calls (#1568)
Details:

- engine.io-client sets clearTimeoutFn and setTimeoutFn function
  depending on settings passed to manager

- socker.io-client is using manager.setTimeoutFn to start connection
  monitoring timer, but is using regular clearTimeout function to
  stop it when connection is established

- in some setups it is causing timer fail to stop and it will break
  connection every _timeout_ milliseconds (which is 20000 by default)
2023-06-22 09:33:11 +02:00
dependabot[bot]
87236baf87 chore: bump json5 from 2.1.3 to 2.2.3 (#120)
Bumps [json5](https://github.com/json5/json5) from 2.1.3 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.1.3...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-22 09:12:30 +02:00
dependabot[bot]
021618886a chore: bump decode-uri-component from 0.2.0 to 0.2.2 (#119)
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-22 09:12:16 +02:00
bitcoinfinancier
2d8b159e2a chore: add security policy (#124) 2023-06-22 09:10:50 +02:00
Damien Arrachequesne
7594aa40c6 refactor: expose the ESM build with debug
So that debug logs can be printed with vite:

```js
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react()],
  server: {
    port: 4000
  },
  resolve: {
    conditions: ["development"]
  }
})
```

Related: 781d753a62
2023-06-22 08:56:47 +02:00
Damien Arrachequesne
0eecad9185 refactor: export the isPacketValid() method
So that any custom parser does not have to implement their own.

Reference: https://socket.io/docs/v4/custom-parser/
2023-06-22 08:55:01 +02:00
Damien Arrachequesne
2dd5fa9dd4 ci: add Node.js 20 in the test matrix
Reference: https://github.com/nodejs/Release
2023-06-22 07:55:32 +02:00
Damien Arrachequesne
a5dff0ac83 docs(examples): increase httpd ProxyTimeout value (2) 2023-06-21 00:07:44 +02:00
Damien Arrachequesne
3035c25982 docs(examples): increase httpd ProxyTimeout value
With a value that is too small, the HTTP long-polling request receives
an HTTP 502 response code and the connection gets closed.
2023-06-20 23:57:46 +02:00
Damien Arrachequesne
5bc94b56bc fix: properly report timeout error when connecting
In some specific cases (Node.js client with WebSocket only), the reason
attached to the "connect_error" event was "websocket error" instead of
"timeout".

Related: https://github.com/socketio/socket.io/issues/4062
2023-06-20 18:48:11 +02:00
Damien Arrachequesne
63f181cc12 feat: serve client bundles with CORS headers
The version of the `cors` package matches the one used by `engine.io`.

Related: https://github.com/socketio/socket.io/issues/3552
2023-06-20 14:32:59 +02:00
Ray Foss
781d753a62 feat: expose ESM build with debug (#1585)
So that debug logs can be printed with vite:

```js
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react()],
  server: {
    port: 4000
  },
  resolve: {
    conditions: ["development"]
  }
})
```

Reference: https://v2.vitejs.dev/config/#resolve-conditions

Related:

- https://github.com/socketio/socket.io/issues/4731
- https://github.com/socketio/socket.io/issues/4635
- https://github.com/socketio/socket.io-client/issues/1516
2023-06-20 14:30:54 +02:00
Damien Arrachequesne
a250e283da chore: bump engine.io to version 6.5.0
Diff: https://github.com/socketio/engine.io/compare/6.4.2...6.5.0
Release notes: https://github.com/socketio/engine.io/releases/tag/6.5.0
2023-06-20 09:17:10 +02:00
SyedTayyabUlMazhar
e5c62cad60 fix: remove the Partial modifier from the socket.data type (#4740)
Wrapping SocketData with Partial causes issues when reading data even
if you've made sure to pass all values. If someone want to make their
type Partial or make only a few properties optional, they can do so in
their own type instead.

Related: https://github.com/socketio/socket.io/issues/4537
2023-06-20 07:49:02 +02:00
Damien Arrachequesne
887396dbc2 ci: add Node.js 20 in the test matrix
Reference: https://github.com/nodejs/Release
2023-06-19 08:16:23 +02:00
Damien Arrachequesne
8f14b98fff chore: bump engine.io-client to version 6.5.0
Diff: https://github.com/socketio/engine.io-client/compare/6.4.0...6.5.0
Release notes: https://github.com/socketio/engine.io-client/releases/tag/6.5.0
2023-06-16 12:40:51 +02:00
dependabot[bot]
9608781efe chore(deps): bump engine.io from 6.2.1 to 6.4.2 in /examples/latency (#678)
Bumps [engine.io](https://github.com/socketio/engine.io) from 6.2.1 to 6.4.2.
- [Release notes](https://github.com/socketio/engine.io/releases)
- [Changelog](https://github.com/socketio/engine.io/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/engine.io/compare/6.2.1...6.4.2)

---
updated-dependencies:
- dependency-name: engine.io
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-16 11:42:09 +02:00
Damien Arrachequesne
1f640a2a0f chore(release): 6.5.0
Diff: https://github.com/socketio/engine.io/compare/6.4.2...6.5.0
2023-06-16 11:36:09 +02:00
Damien Arrachequesne
1bfa9cd088 refactor: adapt to latest uWebSockets.js changes
Reference: https://github.com/uNetworking/uWebSockets.js/releases
2023-06-16 10:19:58 +02:00
Damien Arrachequesne
123b68c04f feat: add support for WebTransport
Reference: https://developer.mozilla.org/en-US/docs/Web/API/WebTransport
2023-06-11 09:42:45 +02:00
Damien Arrachequesne
a779bea9d7 chore(release): 5.1.0
Diff: https://github.com/socketio/engine.io-parser/compare/5.0.7...5.1.0
2023-06-11 07:50:57 +02:00
Damien Arrachequesne
670160d604 ci: add Node.js 20 in the test matrix 2023-06-11 07:45:09 +02:00
Damien Arrachequesne
8039f2e421 ci: upgrade to actions/checkout@3 and actions/setup-node@3
Reference: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
2023-06-11 07:44:23 +02:00
Damien Arrachequesne
bed70a4f25 feat: implement WebTransport-related encoding/decoding 2023-06-11 07:41:51 +02:00
Sean Oxley
3144d27458 fix(uws): discard any write to an aborted uWS response (#682)
This bug only exists for polling transport connections running on top
of uWS.

If the remote client abruptly disconnects (thus aborting the request)
while the server is waiting on an asynchronous operation such as
compression, the server may attempt to write a response via the aborted
response object. This causes an uncaught exception to be thrown.
2023-05-31 14:27:40 +02:00
Damien Arrachequesne
01d37624a8 docs(changelog): update the version range of the engine.io dependency 2023-05-31 11:28:00 +02:00
Damien Arrachequesne
faf914c9ab chore(release): 4.6.2
Diff: https://github.com/socketio/socket.io/compare/4.6.1...4.6.2
2023-05-31 11:15:41 +02:00
Damien Arrachequesne
a04ae1b094 chore(release): 4.6.2
Diff: https://github.com/socketio/socket.io-client/compare/4.6.1...4.6.2
2023-05-31 11:07:13 +02:00
Damien Arrachequesne
7c1db9d225 chore: bump socket.io-parser to version 4.2.3
Reference: https://github.com/advisories/GHSA-cqmj-92xf-r6r9
2023-05-31 11:02:00 +02:00
Damien Arrachequesne
164ba2a11e chore(release): 4.2.4
Diff: https://github.com/socketio/socket.io-parser/compare/4.2.3...4.2.4
2023-05-31 10:56:08 +02:00
Damien Arrachequesne
b0e6400c93 fix: properly detect plain objects
The typeof check was not sufficient, as it also matches arrays and
nulls.
2023-05-31 10:44:05 +02:00
Damien Arrachequesne
d9db4737a3 fix: ensure reserved events cannot be used as event names 2023-05-31 08:29:52 +02:00
Damien Arrachequesne
61dea7135f refactor: remove invalid comma from package.json 2023-05-25 15:00:46 +02:00
Damien Arrachequesne
0fc3694a13 chore(release): 5.0.7
Diff: https://github.com/socketio/engine.io-parser/compare/5.0.6...5.0.7
2023-05-24 14:50:09 +02:00
Damien Arrachequesne
e4a1c2b082 refactor: export typescript declarations for the commonjs build
Related:

- https://github.com/socketio/socket.io/issues/4621#issuecomment-1551853243
- https://github.com/socketio/engine.io-parser/issues/129
2023-05-24 14:43:54 +02:00
Damien Arrachequesne
15af22fc22 refactor: add a noop handler for the error event
We should reduce the scope of the "event" error in the next major
version, as it is overloaded today:

- it can be sent by the client (`socket.emit("error")`, which is a perfectly valid event name)
- it can be emitted when the connection encounters an error (an invalid packet for example)
- it can be emitted when a packet is rejected in a middleware (`socket.use()`)

Related: https://github.com/socketio/socket.io/issues/2047
2023-05-24 10:47:52 +02:00
Damien Arrachequesne
d3658944e5 chore: bump socket.io-parser to version 4.2.3
Reference: https://github.com/advisories/GHSA-cqmj-92xf-r6r9
2023-05-24 07:27:12 +02:00
Damien Arrachequesne
7bd77759bd docs: update the list of CVE 2023-05-23 08:40:03 +02:00
Damien Arrachequesne
6a5a004d1e docs(changelog): include changelog for release 3.4.3 2023-05-22 10:06:05 +02:00
Damien Arrachequesne
b6c824f824 chore(release): 4.2.3
Diff: https://github.com/socketio/socket.io-parser/compare/4.2.2...4.2.3
2023-05-22 08:25:34 +02:00
Damien Arrachequesne
dcc70d9678 refactor: export typescript declarations for the commonjs build
Related: https://github.com/socketio/socket.io/issues/4621#issuecomment-1551853243
2023-05-22 08:25:34 +02:00
Damien Arrachequesne
3b78117bf6 fix: check the format of the event name
A packet like '2[{"toString":"foo"}]' was decoded as:

{
  type: EVENT,
  data: [ { "toString": "foo" } ]
}

Which would then throw an error when passed to the EventEmitter class:

> TypeError: Cannot convert object to primitive value
>    at Socket.emit (node:events:507:25)
>    at .../node_modules/socket.io/lib/socket.js:531:14

History of the isPayloadValid() method:

- added in [78f9fc2](78f9fc2999) (v4.0.1, socket.io@3.0.0)
- updated in [1c220dd](1c220ddbf4) (v4.0.4, socket.io@3.1.0)
2023-05-22 08:25:33 +02:00
Damien Arrachequesne
12b0de4f52 chore: bump engine.io to version 6.4.2
Reference: https://github.com/advisories/GHSA-q9mw-68c2-j6m5

Related: https://github.com/socketio/socket.io/issues/4711
2023-05-10 10:20:42 +02:00
Mateusz Burzyński
7ead241ecf fix(exports): move types condition to the top (#1580)
Related: https://github.com/microsoft/TypeScript/issues/50762
2023-05-04 07:29:00 +02:00
Mateusz Burzyński
3d44aae381 fix(exports): move types condition to the top (#4698)
Related: https://github.com/microsoft/TypeScript/issues/50762
2023-05-04 07:27:09 +02:00
Damien Arrachequesne
cbf0362476 docs(examples): bump dependencies for the private messaging example
Related: https://github.com/socketio/socket.io/issues/4681
2023-05-02 18:07:07 +02:00
Damien Arrachequesne
95e215387c chore(release): 6.4.2
Diff: https://github.com/socketio/engine.io/compare/6.4.1...6.4.2
2023-05-02 01:27:20 +02:00
Damien Arrachequesne
fc480b4f30 fix: prevent crash when provided with an invalid query param
A specially crafted request could lead to the following exception:

> TypeError: Cannot read properties of undefined (reading 'handlesUpgrades')
>    at Server.onWebSocket (build/server.js:515:67)

This bug was introduced in [1], released in version 5.1.0 and included
in version 4.1.0 of the `socket.io` parent package. Older versions are
not impacted.

[1]: 7096e98a02
2023-05-02 01:07:40 +02:00
Damien Arrachequesne
0141951185 refactor(types): ensure compatibility with Express middlewares
In order to prevent issues like:

> error TS2345: Argument of type 'RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>' is not assignable to parameter of type 'Middleware'.
>  Types of parameters 'req' and 'req' are incompatible.
>  Type 'IncomingMessage' is missing the following properties from type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>': get, header, accepts, acceptsCharsets, and 29 more.
>
>  io.engine.use(sessionMiddleware);
                 ~~~~~~~~~~~~~~~~~

Related: https://github.com/socketio/socket.io/issues/4644

We could also have use the RequestHandler type from the
@types/express-serve-static-core package, but that would add 5 new
dependencies.

See also: https://github.com/socketio/engine.io/issues/673
2023-05-02 00:51:33 +02:00
Damien Arrachequesne
8b22162903 fix(uws): prevent crash when using with middlewares
The class used to accumulate the response headers did not expose the
exact same API as its wrapped type, which could lead to the following
error in some rare cases:

> TypeError: Cannot read properties of undefined (reading 'end')
>    at Polling.onDataRequest (build/transports-uws/polling.js:109:53)
>    at Polling.onRequest (build/transports-uws/polling.js:47:18)
>    at callback (build/userver.js:94:56)
>    at uServer.verify (build/server.js:152:9)

Related: https://github.com/socketio/socket.io/issues/4643
2023-05-02 00:50:34 +02:00
Ciel
93957828be fix: include error handling for Express middlewares (#674)
Following 24786e77c5.

Reference: https://expressjs.com/en/guide/error-handling.html
2023-05-02 00:00:47 +02:00
Damien Arrachequesne
911d0e3575 refactor: return HTTP 400 upon invalid request overlap
In both cases, the error comes from the client as it should not send
multiple concurrent requests, so a HTTP 4xx code is mandated.

Related: https://github.com/socketio/engine.io/issues/650
2023-05-01 07:42:43 +02:00
Asger Hautop Drewsen
bd6d4713b0 fix(typings): make clientsCount public (#675)
Related: https://github.com/socketio/engine.io/issues/672
2023-04-19 23:25:16 +03:00
Damien Arrachequesne
59280da20b docs(examples): update examples to docker compose v2
Reference: https://docs.docker.com/compose/

Related: https://github.com/socketio/socket.io/discussions/4669
2023-04-07 15:57:20 +02:00
Damien Arrachequesne
d0c0557c1b docs(changelog): add version of transitive dependencies 2023-03-27 17:55:46 +02:00
Damien Arrachequesne
50a4d37cb8 docs(changelog): add version of transitive dependencies 2023-03-27 17:35:42 +02:00
Damien Arrachequesne
cddb78e5fa chore(release): 0.2.2
Diff: https://github.com/socketio/socket.io-cluster-adapter/compare/0.2.1...0.2.2
2023-03-24 17:32:35 +01:00
Damien Arrachequesne
15fd56e78d chore: add socket.io-parser to peerDependencies
This should (at least in theory) fix sync issues for the
`socket.io-adapter` package, which is imported by both the `socket.io`
and `@socket.io/cluster-adapter` packages:

- `socket.io@4.5.0` should resolve `socket.io-adapter@~2.4.0`
- `socket.io@4.6.0` should resolve `socket.io-adapter@~2.5.0`
2023-03-24 17:28:57 +01:00
Damien Arrachequesne
e86ef45f87 ci: upgrade to actions/checkout@3 and actions/setup-node@3
Reference: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
2023-03-24 17:16:25 +01:00
Damien Arrachequesne
6458b2bef1 docs(example): basic WebSocket-only client 2023-03-24 11:17:29 +01:00
Damien Arrachequesne
b56da8a99f docs(examples): upgrade to React 18
Reference: https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html
2023-03-07 08:31:21 +01:00
Damien Arrachequesne
7952312911 chore(release): 4.6.1
Diff: https://github.com/socketio/socket.io/compare/4.6.0...4.6.1
2023-02-20 17:49:41 +01:00
Damien Arrachequesne
89175d0481 chore(release): 4.6.1
Diff: https://github.com/socketio/socket.io-client/compare/4.6.0...4.6.1
2023-02-20 17:46:20 +01:00
Damien Arrachequesne
121fd7c73d refactor: do not reuse the same packet ID for retries
The packet ID cannot be used for deduplication, because it's only
unique for the given session. If you reconnect on another server and
try to resend a packet, then the server won't be able to know whether
the packet has already been processed or not.
2023-02-20 17:31:02 +01:00
Damien Arrachequesne
46213a647e fix: prevent duplicate connections when multiplexing
This bug was introduced in [1]: a multiplexed socket could in some
cases send multiple CONNECT packets, resulting in duplicate connections
on the server side.

A cached socket will now be reopened only if it was inactive, that is,
if one had explicitly called socket.disconnect() before.

Related: https://github.com/socketio/socket.io-client/issues/1460

[1]: b7dd891e89
2023-02-20 17:09:50 +01:00
Damien Arrachequesne
4996f9ee71 fix: do not drain the queue while the socket is offline
In the previous implementation added in [1], the socket would try to
send the packet even if it was disconnected, which would needlessly
exhaust the number of retries.

[1]: 655dce9755
2023-02-20 17:01:22 +01:00
Damien Arrachequesne
0d0a7a22b5 fix: properly handle manually created dynamic namespaces
Namespaces that match the regex of a parent namespace will now be added
as a child of this namespace:

```js
const parentNamespace = io.of(/^\/dynamic-\d+$/);
const childNamespace = io.of("/dynamic-101");
```

Related:

- https://github.com/socketio/socket.io/issues/4615
- https://github.com/socketio/socket.io/issues/4164
- https://github.com/socketio/socket.io/issues/4015
- https://github.com/socketio/socket.io/issues/3960
2023-02-20 01:19:01 +01:00
Damien Arrachequesne
2a8565fd1e refactor: catch errors when trying to restore the connection state 2023-02-20 01:18:08 +01:00
Igor Lins e Silva
d0b22c6302 fix(types): fix nodenext module resolution compatibility (#4625)
The import added in [1] was invalid, because it used an non-exported
class.

Related: https://github.com/socketio/socket.io/issues/4621

[1]: d4a9b2cdcb
2023-02-20 01:15:35 +01:00
Damien Arrachequesne
7033c0ed27 chore(release): 6.4.1
Diff: https://github.com/socketio/engine.io/compare/6.4.0...6.4.1
2023-02-20 00:54:54 +01:00
Igor Lins e Silva
6e78489486 refactor: export BaseServer class (#669)
Related: https://github.com/socketio/socket.io/issues/4621
2023-02-17 23:24:50 +01:00
Nabaraj Subedi
e71f3d7dbe docs: minor style fix (#4619) 2023-02-16 09:25:43 +01:00
Damien Arrachequesne
535b068670 docs: add upgrade event in the documentation
Reference: 898bd1c9df/lib/socket.ts (L285)

Related: https://github.com/socketio/socket.io-website/issues/369
2023-02-14 15:25:57 +01:00
Damien Arrachequesne
a2e5d1f77f chore(release): 4.6.0
Diff: https://github.com/socketio/socket.io/compare/4.5.4...4.6.0
2023-02-07 01:07:46 +01:00
Damien Arrachequesne
5980918b89 chore(release): 4.6.0
Diff: https://github.com/socketio/socket.io-client/compare/4.5.4...4.6.0
2023-02-07 00:26:46 +01:00
Damien Arrachequesne
d8143cc067 refactor: do not persist session if connection state recovery if disabled
This is a follow-up commit of [1]. Without it, adapter.persistSession()
would be called even if the connection state recovery feature was
disabled.

[1]: 54d5ee05a6
2023-02-06 18:03:34 +01:00
Damien Arrachequesne
b2dd7cf660 chore: bump engine.io to version 6.4.0
Diff: https://github.com/socketio/engine.io/compare/6.3.1...6.4.0
Release notes: https://github.com/socketio/engine.io/releases/tag/6.4.0
2023-02-06 17:43:02 +01:00
Damien Arrachequesne
3734b74b45 revert: feat: expose current offset to allow deduplication
This reverts commit 4e64123862.

Using the id of the socket is not possible, since it is lost upon
reconnection (unless connection recovery is successful), so we revert
the previous change.
2023-02-06 17:36:37 +01:00
Damien Arrachequesne
dff34a3f17 chore: bump engine.io-client to version 6.4.0
The minor bump is due to changes on the server side, but we'll keep the
versions in sync.

Diff: https://github.com/socketio/engine.io-client/compare/6.3.1...6.4.0
Release notes: https://github.com/socketio/engine.io-client/releases/tag/6.4.0
2023-02-06 17:23:45 +01:00
Damien Arrachequesne
898bd1c9df chore(release): 6.4.0
Diff: https://github.com/socketio/engine.io/compare/6.3.1...6.4.0
2023-02-06 17:16:32 +01:00
dependabot[bot]
6220d140cc chore(deps): bump cookiejar from 2.1.2 to 2.1.4 (#667)
Bumps [cookiejar](https://github.com/bmeck/node-cookiejar) from 2.1.2 to 2.1.4.
- [Release notes](https://github.com/bmeck/node-cookiejar/releases)
- [Commits](https://github.com/bmeck/node-cookiejar/commits)

---
updated-dependencies:
- dependency-name: cookiejar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-06 17:06:11 +01:00
Damien Arrachequesne
24786e77c5 feat: add support for Express middlewares
This commit implements middlewares at the Engine.IO level, because
Socket.IO middlewares are meant for namespace authorization and are not
executed during a classic HTTP request/response cycle.

A workaround was possible by using the allowRequest option and the
"headers" event, but this feels way cleaner and works with upgrade
requests too.

Syntax:

```js
engine.use((req, res, next) => {
  // do something

  next();
});

// with express-session
import session from "express-session";

engine.use(session({
  secret: "keyboard cat",
  resave: false,
  saveUninitialized: true,
  cookie: { secure: true }
});

// with helmet
import helmet from "helmet";

engine.use(helmet());
```

Related:

- https://github.com/socketio/engine.io/issues/668
- https://github.com/socketio/engine.io/issues/651
- https://github.com/socketio/socket.io/issues/4609
- https://github.com/socketio/socket.io/issues/3933
- a lot of other issues asking for compatibility with express-session
2023-02-06 17:01:27 +01:00
Edouard Benauw
8aa94991ce feat: add description to the disconnecting and disconnect events (#4622)
See also: b862924b7f
2023-02-04 09:03:01 +01:00
Damien Arrachequesne
4e64123862 feat: expose current offset to allow deduplication
Related: 655dce9755
2023-02-04 08:56:55 +01:00
Damien Arrachequesne
4d6d95e079 fix(typings): do not expose browser-specific types
Related:

- https://github.com/socketio/socket.io-client/issues/1561
- b862924b7f
- 37d7a0aa79
2023-02-04 08:21:59 +01:00
Damien Arrachequesne
c54e09d092 test: add more tests for the retry mechanism 2023-02-04 08:04:38 +01:00
Damien Arrachequesne
0110e46842 chore: bump engine.io-client to version 6.3.1
Diff: https://github.com/socketio/engine.io-client/compare/6.3.0...6.3.1
Release notes: https://github.com/socketio/engine.io-client/releases/tag/6.3.1
2023-02-04 07:29:54 +01:00
Damien Arrachequesne
5ba0d498dc refactor: minor edit
Following 655dce9755
2023-02-03 08:27:15 +01:00
Damien Arrachequesne
b1eed5fd75 chore: bump engine.io-client to version 6.3.0
Diff: https://github.com/socketio/engine.io-client/compare/6.2.3...6.3.0
Release notes: https://github.com/socketio/engine.io-client/releases/tag/6.3.0
2023-02-03 08:20:45 +01:00
Damien Arrachequesne
b7dd891e89 fix: ensure manager.socket() returns an active socket
Related: https://github.com/socketio/socket.io-client/issues/1460
2023-02-03 08:16:38 +01:00
Damien Arrachequesne
655dce9755 feat: implement retry mechanism
Syntax:

```js
const socket = io({
  retries: 3,
  ackTimeout: 10000
});

// "my-event" will be sent up to 4 times (1 + 3), until the server sends an acknowledgement
socket.emit("my-event", (err) => {});
```

Notes:

- the order of the packets is guaranteed, as we send packets one by one
- the same packet id is reused for consecutive retries, in order to
allow deduplication on the server side
2023-02-01 08:19:34 +01:00
Damien Arrachequesne
9f3292525b test: add test with onAnyOutgoing() and binary attachments 2023-01-30 08:26:56 +01:00
Damien Arrachequesne
f27cba5b33 refactor: add recovered flag after a successful recovery
Following b4e20c5c70
2023-01-30 08:14:45 +01:00
Damien Arrachequesne
47b979d573 feat: add promise-based acknowledgements
This commit adds some syntactic sugar around acknowledgements:

```js
// without timeout
const response = await socket.emitWithAck("hello", "world");

// with a specific timeout
try {
  const response = await socket.timeout(1000).emitWithAck("hello", "world");
} catch (err) {
  // the server did not acknowledge the event in the given delay
}
```

Note: enviroments that do not support Promises ([1]) will need to add a
polyfill in order to use this feature

See also: 184f3cf7af

[1]: https://caniuse.com/promises
2023-01-30 08:08:06 +01:00
Damien Arrachequesne
115a9819fd refactor: do not include the pid by default
So that the client knows whether the connection state recovery feature
is enabled.

See also: 54d5ee05a6
2023-01-25 09:39:22 +01:00
Damien Arrachequesne
b4e20c5c70 feat: implement connection state recovery
Connection state recovery allows a client to reconnect after a
temporary disconnection and restore its state:

- id
- rooms
- data
- missed packets

See also: 54d5ee05a6
2023-01-25 09:21:08 +01:00
dependabot[bot]
0841bd5623 chore: bump ua-parser-js from 1.0.32 to 1.0.33 (#121)
Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 1.0.32 to 1.0.33.
- [Release notes](https://github.com/faisalman/ua-parser-js/releases)
- [Changelog](https://github.com/faisalman/ua-parser-js/blob/master/changelog.md)
- [Commits](https://github.com/faisalman/ua-parser-js/compare/1.0.32...1.0.33)

---
updated-dependencies:
- dependency-name: ua-parser-js
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-25 07:23:55 +01:00
Waldemar Schlegel
0c0eb00163 fix: add timeout method to remote socket (#4558)
The RemoteSocket interface, which is returned when the client is
connected on another Socket.IO server of the cluster, was lacking the
`timeout()` method.

Syntax:

```js
const sockets = await io.fetchSockets();

for (const socket of sockets) {
  if (someCondition) {
    socket.timeout(1000).emit("some-event", (err) => {
      if (err) {
        // the client did not acknowledge the event in the given delay
      }
    });
  }
}
```

Related: https://github.com/socketio/socket.io/issues/4595
2023-01-24 09:24:19 +01:00
Damien Arrachequesne
f8640d9451 refactor: export DisconnectReason type
Related: https://github.com/socketio/socket.io/issues/4556
2023-01-23 09:27:32 +01:00
Damien Arrachequesne
93d446a545 refactor: add charset when serving the bundle files
Reference: https://developer.mozilla.org/fr/docs/Web/HTTP/Headers/Content-Type

Related: https://github.com/socketio/socket.io/discussions/4589
2023-01-23 09:27:06 +01:00
Damien Arrachequesne
184f3cf7af feat: add promise-based acknowledgements
This commit adds some syntactic sugar around acknowledgements:

- `emitWithAck()`

```js
try {
  const responses = await io.timeout(1000).emitWithAck("some-event");
  console.log(responses); // one response per client
} catch (e) {
  // some clients did not acknowledge the event in the given delay
}

io.on("connection", async (socket) => {
    // without timeout
  const response = await socket.emitWithAck("hello", "world");

  // with a specific timeout
  try {
    const response = await socket.timeout(1000).emitWithAck("hello", "world");
  } catch (err) {
    // the client did not acknowledge the event in the given delay
  }
});
```

- `serverSideEmitWithAck()`

```js
try {
  const responses = await io.timeout(1000).serverSideEmitWithAck("some-event");
  console.log(responses); // one response per server (except itself)
} catch (e) {
  // some servers did not acknowledge the event in the given delay
}
```

Related:

- https://github.com/socketio/socket.io/issues/4175
- https://github.com/socketio/socket.io/issues/4577
- https://github.com/socketio/socket.io/issues/4583
2023-01-23 09:06:25 +01:00
Steve Baum
5d9220b69a feat: add the ability to clean up empty child namespaces (#4602)
This commit adds a new option, "cleanupEmptyChildNamespaces". With this
option enabled (disabled by default), when a socket disconnects from a
dynamic namespace and if there are no other sockets connected to it
then the namespace will be cleaned up and its adapter will be closed.

Note: the namespace can be connected to later (it will be recreated)

Related: https://github.com/socketio/socket.io-redis-adapter/issues/480
2023-01-23 07:56:14 +01:00
Damien Arrachequesne
129883958a test: add test with onAnyOutgoing() and binary attachments
Related:

- https://github.com/socketio/socket.io/issues/4374
- ae8dd88995
2023-01-19 12:05:35 +01:00
Damien Arrachequesne
6c27b8b0a6 test: add test with socket.disconnect(true)
Related: a65a047526
2023-01-19 11:53:53 +01:00
Damien Arrachequesne
f3ada7d8cc fix(typings): properly type emits with timeout
When emitting with a timeout (added in version 4.4.0), the "err"
argument was not properly typed and would require to split the client
and server typings. It will now be automatically inferred as an Error
object.

Workaround for previous versions:

```ts
type WithTimeoutAck<isEmitter extends boolean, args extends any[]> = isEmitter extends true ? [Error, ...args] : args;

interface ClientToServerEvents<isEmitter extends boolean = false> {
    withAck: (data: { argName: boolean }, callback: (...args: WithTimeoutAck<isEmitter, [string]>) => void) => void;
}

interface ServerToClientEvents<isEmitter extends boolean = false> {

}

const io = new Server<ClientToServerEvents, ServerToClientEvents<true>>(3000);

io.on("connection", (socket) => {
    socket.on("withAck", (val, cb) => {
        cb("123");
    });
});

const socket: Socket<ServerToClientEvents, ClientToServerEvents<true>> = ioc("http://localhost:3000");

socket.timeout(100).emit("withAck", { argName: true }, (err, val) => {
  // ...
});
```

Related: https://github.com/socketio/socket.io-client/issues/1555
2023-01-19 11:48:18 +01:00
Damien Arrachequesne
28dd668502 chore(release): 4.2.2
Diff: https://github.com/socketio/socket.io-parser/compare/4.2.1...4.2.2
2023-01-19 10:43:49 +01:00
Damien Arrachequesne
22c42e3545 fix: calling destroy() should clear all internal state
If a client was in the process of receiving some binary attachments
when the connection was abruptly closed, then the manager would call
`decoder.destroy()` ([1]) but was then stuck in a "parse error" loop
upon reconnection (since it expected a binary attachment and not a
CONNECT packet).

[1]: a1c528b089/lib/manager.ts (L520)
2023-01-19 10:16:42 +01:00
Damien Arrachequesne
ae8dd88995 fix: do not modify the input packet upon encoding
Note: this issue has existed since Socket.IO v1.0 (see [1]), because
the `deconstructPacket()` method also mutates its input argument.

This also explains why some adapters (like [2]) need to use
`process.nextTick()` when extending the `broadcast()` method, because
`Adapter.broadcast()` calls `Encoder.encode()` ([3]).

Related:

- https://github.com/socketio/socket.io/issues/4374
- https://github.com/socketio/socket.io-mongo-adapter/issues/10

[1]: 299849b002
[2]: https://github.com/socketio/socket.io-postgres-adapter/blob/0.3.0/lib/index.ts#L587-L590
[3]: https://github.com/socketio/socket.io-adapter/blob/2.4.0/lib/index.ts#L148
2023-01-19 10:06:13 +01:00
Marc Jansing
a21ad88828 docs(changelog): add note about maxHttpBufferSize default value (#4596)
Reference: https://github.com/socketio/socket.io/releases/tag/2.5.0
2023-01-18 08:16:27 +01:00
Damien Arrachequesne
a1c528b089 fix(typings): properly type emits with timeout (2)
This follows [1], in order to keep the label of each argument.

[1]: 33e417258c

Related:

- https://github.com/socketio/socket.io-client/pull/1570#issuecomment-1384075633
- https://github.com/microsoft/TypeScript/issues/39941
- https://github.com/microsoft/TypeScript/issues/48049
2023-01-17 15:56:37 +01:00
Engin Aydogan
33e417258c fix(typings): properly type emits with timeout (#1570)
When emitting with a timeout (added in version 4.4.0), the "err"
argument was not properly typed and would require to split the client
and server typings. It will now be automatically inferred as an Error
object.

Workaround for previous versions:

```ts
type WithTimeoutAck<isEmitter extends boolean, args extends any[]> = isEmitter extends true ? [Error, ...args] : args;

interface ClientToServerEvents<isEmitter extends boolean = false> {
    withAck: (data: { argName: boolean }, callback: (...args: WithTimeoutAck<isEmitter, [string]>) => void) => void;
}

interface ServerToClientEvents<isEmitter extends boolean = false> {

}

const io = new Server<ClientToServerEvents, ServerToClientEvents<true>>(3000);

io.on("connection", (socket) => {
    socket.on("withAck", (val, cb) => {
        cb("123");
    });
});

const socket: Socket<ServerToClientEvents, ClientToServerEvents<true>> = ioc("http://localhost:3000");

socket.timeout(100).emit("withAck", { argName: true }, (err, val) => {
  // ...
});
```

Related: https://github.com/socketio/socket.io-client/issues/1555
2023-01-16 12:31:01 +01:00
Damien Arrachequesne
214182b4f0 chore(release): 5.0.6
Diff: https://github.com/socketio/engine.io-parser/compare/5.0.5...5.0.6
2023-01-16 08:35:56 +01:00
Damien Arrachequesne
54d5ee05a6 feat: implement connection state recovery
Connection state recovery allows a client to reconnect after a
temporary disconnection and restore its state:

- id
- rooms
- data
- missed packets

Usage:

```js
import { Server } from "socket.io";

const io = new Server({
  connectionStateRecovery: {
    // default values
    maxDisconnectionDuration: 2 * 60 * 1000,
    skipMiddlewares: true,
  },
});

io.on("connection", (socket) => {
  console.log(socket.recovered); // whether the state was recovered or not
});
```

Here's how it works:

- the server sends a session ID during the handshake (which is
different from the current `id` attribute, which is public and can be
freely shared)

- the server also includes an offset in each packet (added at the end
of the data array, for backward compatibility)

- upon temporary disconnection, the server stores the client state for
a given delay (implemented at the adapter level)

- upon reconnection, the client sends both the session ID and the last
offset it has processed, and the server tries to restore the state

A few notes:

- the base adapter exposes two additional methods, persistSession() and
restoreSession(), that must be implemented by the other adapters in
order to allow the feature to work within a cluster

See: f5294126a8

- acknowledgements are not affected, because it won't work if the
client reconnects on another server (as the ack id is local)

- any disconnection that lasts longer than the
`maxDisconnectionDuration` value will result in a new session, so users
will still need to care for the state reconciliation between the server
and the client

Related: https://github.com/socketio/socket.io/discussions/4510
2023-01-12 12:21:56 +01:00
Damien Arrachequesne
da2b542797 perf: precompute the WebSocket frames when broadcasting
Note:

- only packets without binary attachments are affected
- the permessage-deflate extension must be disabled (which is the default)

Related:

- 5f7b47d40f
- 5e34722b0b
2023-01-12 08:50:07 +01:00
Damien Arrachequesne
4d6f4541c3 chore(release): 6.3.1
Diff: https://github.com/socketio/engine.io/compare/6.3.0...6.3.1
2023-01-12 08:23:07 +01:00
Damien Arrachequesne
69603b955a refactor: make the compress option optional
The compress option was inadvertently made mandatory in [1].

[1]: 6d87a4065a
2023-01-12 08:15:21 +01:00
Damien Arrachequesne
28f60b880a chore(release): 2.5.2
Diff: https://github.com/socketio/socket.io-adapter/compare/2.5.1...2.5.2
2023-01-12 08:09:40 +01:00
Damien Arrachequesne
ca39942ce0 chore: move ws from peerDependencies to dependencies
In order to prevent issues like [1].

Note: the version matches the one imported by the `engine.io` package

See: https://github.com/socketio/engine.io/blob/6.3.0/package.json#L43

[1]: https://github.com/socketio/socket.io-redis-adapter/issues/478
2023-01-12 08:02:52 +01:00
Tristan F
b7d54dbe8d docs: add Rust client implementation (#4592)
client-only implementation -- it *may* add server-side support in the future.
2023-01-12 06:26:22 +01:00
Tristan F
d4a9b2cdcb refactor(typings): add types for io.engine (#4591)
This adds typings for the socket.io engine field, which offers better
IntelliSense when retrieving the server, as well as more confidence on
the developer-side of what types of fields are entering the server.

Related: https://github.com/socketio/socket.io/issues/4590
2023-01-11 10:45:57 +01:00
Damien Arrachequesne
ae1ea77991 chore(release): 6.3.0
Diff: https://github.com/socketio/engine.io/compare/6.2.1...6.3.0
2023-01-10 17:28:24 +01:00
Damien Arrachequesne
a65a047526 fix: wait for all packets to be sent before closing the WebSocket connection
This reverts commit [1], which was included in `engine.io@5.1.0` and
`socket.io@4.1.0`.

The WebSocket connection was closed before all packets were written
out, so for example when calling `socket.disconnect(true)` on the
Socket.IO server (which disconnect from all namespaces and close the
connection), the client would receive only the first disconnect packet
and kept trying to reconnect to the other namespaces.

The only difference with the previous implementation (pre 5.1.0) is
that the "drain" event gets only called once at the end, and not after
each packet.

[1]: ad5306aeae

Related: https://github.com/socketio/engine.io/issues/648
2023-01-10 16:42:12 +01:00
Damien Arrachequesne
ed87609baf fix: fix the ES module wrapper
The package does not have a default export, so importing it from a
project using ES modules would break in some cases.

> Cannot destructure property 'Server' of '_engineIo.default'

Related: https://github.com/socketio/engine.io/issues/657
2023-01-10 15:28:43 +01:00
Damien Arrachequesne
bc98bf1232 refactor: bump prettier to version 2.8.1
This major bump creates a lot of noise, but it is necessary for
prettier to be able to parse new syntax such as:

- typed imports: `import { type xxx } from ...`
- private attributes: `class A { #b; #c() {} }`
2023-01-10 15:22:57 +01:00
Damien Arrachequesne
33dc073172 docs: add some TODOs for the next major release 2023-01-10 14:57:58 +01:00
iifawzi
d0fd4746af feat: add the "addTrailingSlash" option (#655)
The "addTrailingSlash" option allows to control whether a trailing
slash is added to the path of the HTTP requests:

- true (default): "/engine.io/"
- false: "/engine.io"

Related: 21a6e1219a

Signed-off-by: iifawzi <iifawzie@gmail.com>
2023-01-10 14:51:31 +01:00
Damien Arrachequesne
5e34722b0b perf: add the wsPreEncodedFrame option
This optimization is only applied if:

- the permessage-deflate extension is disabled (which is the default)
- the "ws" package is used (which is the default)

In that case, the WebSocket frame will only be computed once, when
broadcasting to multiple clients.

Related: 5f7b47d40f
2023-01-09 10:34:25 +01:00
Damien Arrachequesne
4e3991f740 chore(release): 2.5.1
Diff: https://github.com/socketio/socket.io-adapter/compare/2.5.0...2.5.1
2023-01-06 12:02:23 +01:00
Damien Arrachequesne
99b0f18819 fix: properly precompute the WebSocket frames
The named import is not supported in some cases:

> node_modules/socket.io-adapter/dist/index.js:170
>            packetOpts.wsPreEncodedFrame = ws_1.WebSocket.Sender.frame(data, {
>                                                          ^
>
> TypeError: Cannot read properties of undefined (reading 'Sender')
>     at RedisAdapter._encode (/.../node_modules/socket.io-adapter/dist/index.js:170:59)
>     at RedisAdapter.broadcast (/.../node_modules/socket.io-adapter/dist/index.js:117:37)

Related: https://github.com/socketio/socket.io-redis-adapter/issues/478
2023-01-06 11:58:04 +01:00
Damien Arrachequesne
05ebbad996 ci: temporarily disable browser tests
Until we migrate to webdriver.io.

Related: d882822908
2023-01-06 11:39:30 +01:00
Damien Arrachequesne
ed2b0cbfa3 chore(release): 5.0.5
Diff: https://github.com/socketio/engine.io-parser/compare/5.0.4...5.0.5
2023-01-06 11:38:26 +01:00
Mauricio Narvaez
351ba8245b fix: properly encode empty buffer in base64 encoding (#131)
An empty buffer was encoded into `bundefined` instead of `b`
(reproduced on Chrome v108 / Ubuntu).

Co-authored-by: Mauricio Narvaez <nvz@fb.com>
2023-01-06 11:26:29 +01:00
Damien Arrachequesne
00a8e7589e chore(release): 2.5.0
Diff: https://github.com/socketio/socket.io-adapter/compare/2.4.0...2.5.0
2023-01-06 09:26:10 +01:00
Damien Arrachequesne
5f7b47d40f perf: precompute the WebSocket frames when broadcasting
Note:

- only packets without binary attachments are affected
- the permessage-deflate extension must be disabled (which is the default)

Previous attempt:

- wsPreEncoded option: 5579d40c24
- fix for binary packets: a33e42bb7b
- revert: 88eee5948a
2023-01-06 08:42:51 +01:00
Damien Arrachequesne
6fffc2c3d7 ci: upgrade to actions/checkout@3 and actions/setup-node@3
Reference: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
2023-01-05 08:40:16 +01:00
Damien Arrachequesne
f5294126a8 feat: implement connection state recovery
More information about how this feature is supposed to work will be
provided in the main repository.
2023-01-05 08:39:19 +01:00
Damien Arrachequesne
d5c56d4094 refactor: bump prettier to version 2.8.1
This major bump creates a lot of noise, but it is necessary for
prettier to be able to parse new syntax.
2023-01-05 08:21:31 +01:00
Damien Arrachequesne
060745ada3 test: migrate to TypeScript 2023-01-02 11:28:45 +01:00
Damien Arrachequesne
5924e987b6 docs: improve the documentation of the protocol 2022-12-21 00:46:56 +01:00
Damien Arrachequesne
de247df875 docs: improve the documentation of the protocol 2022-12-19 11:00:06 +01:00
dependabot[bot]
8a937a4006 chore(deps): bump qs and express in /examples/latency (#665)
Bumps [qs](https://github.com/ljharb/qs) to 6.11.0 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together.


Updates `qs` from 6.7.0 to 6.11.0
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.7.0...v6.11.0)

Updates `express` from 4.17.1 to 4.18.2
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.1...4.18.2)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
- dependency-name: express
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-14 10:15:52 +01:00
dependabot[bot]
719e275ff7 chore(deps): bump qs from 6.9.4 to 6.11.0 (#664)
Bumps [qs](https://github.com/ljharb/qs) from 6.9.4 to 6.11.0.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.9.4...v6.11.0)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-14 10:15:26 +01:00
dependabot[bot]
8f8b217f1c chore(deps): bump engine.io from 4.1.2 to 6.2.1 in /examples/latency (#663)
Bumps [engine.io](https://github.com/socketio/engine.io) from 4.1.2 to 6.2.1.
- [Release notes](https://github.com/socketio/engine.io/releases)
- [Changelog](https://github.com/socketio/engine.io/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/engine.io/compare/4.1.2...6.2.1)

---
updated-dependencies:
- dependency-name: engine.io
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-14 10:15:12 +01:00
Damien Arrachequesne
da45d84c09 chore: bump ws to version 8.11.0
Diff: https://github.com/websockets/ws/compare/8.2.3...8.11.0
2022-12-14 07:58:30 +01:00
Damien Arrachequesne
547c541fb9 chore: add security policy 2022-12-14 07:47:51 +01:00
Damien Arrachequesne
18c6e0a6da chore: add security policy 2022-12-14 07:46:55 +01:00
Damien Arrachequesne
bd74e7c988 chore: add security policy 2022-12-14 07:42:42 +01:00
Damien Arrachequesne
6d87a4065a refactor: add types to socket.send()
Related: https://github.com/socketio/engine.io/issues/645
2022-12-06 00:31:02 +01:00
Damien Arrachequesne
3d28229cf0 docs: add note about socket.id
Related: https://github.com/socketio/engine.io/issues/644
2022-12-05 23:57:32 +01:00
dependabot[bot]
7fbea714db chore: bump decode-uri-component from 0.2.0 to 0.2.2 (#130)
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-05 21:58:42 +01:00
Damien Arrachequesne
3b7ced7af7 chore(release): 4.5.4
Diff: https://github.com/socketio/socket.io/compare/4.5.3...4.5.4
2022-11-22 22:45:13 +01:00
Damien Arrachequesne
c00bb9564c chore: bump engine.io to version 6.2.1
In order to fix CVE-2022-41940.

See also: https://github.com/socketio/engine.io/security/advisories/GHSA-r7qp-cfhv-p84w
2022-11-22 22:35:53 +01:00
Damien Arrachequesne
57e5f25e26 chore: bump socket.io-parser to version 4.2.1
In order to fix CVE-2022-2421.

See also: https://github.com/advisories/GHSA-qm95-pgcg-qqfq
2022-11-22 22:32:09 +01:00
Damien Arrachequesne
91ef8395d5 chore(release): 4.5.4
Diff: https://github.com/socketio/socket.io-client/compare/4.5.3...4.5.4
2022-11-22 22:28:31 +01:00
Damien Arrachequesne
4810bd7592 chore(release): 4.0.0
Diff: https://github.com/socketio/emitter/compare/3.1.0...4.0.0
2022-11-22 14:18:49 +01:00
Damien Arrachequesne
0852bda0b4 refactor: rename emitReserved to _emitReserved to improve mangling
Related: https://github.com/socketio/socket.io/discussions/4529
2022-11-22 14:03:24 +01:00
Damien Arrachequesne
d7bd2b1d52 docs: add changelog for version 3.6.1 2022-11-20 03:06:58 +01:00
Damien Arrachequesne
24b847be6a chore(release): 6.2.1
Diff: https://github.com/socketio/engine.io/compare/6.2.0...6.2.1
2022-11-20 02:14:27 +01:00
Jonathan Neve
425e833ab1 fix: catch errors when destroying invalid upgrades (#658)
Before this change, receiving an HTTP2 upgrade would make the server
crash:

> Error: read ECONNRESET
>    at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {
>  errno: -104,
>  code: 'ECONNRESET',
>  syscall: 'read'
> }

This can be reproduced with Node.js v14.15.3, v16.18.1 and v18.12.1.
2022-11-20 01:55:11 +01:00
dependabot[bot]
99adb00ba1 chore(deps): bump xmlhttprequest-ssl and engine.io-client in /examples/latency (#661)
Bumps [xmlhttprequest-ssl](https://github.com/mjwwit/node-XMLHttpRequest) to 1.6.3 and updates ancestor dependency [engine.io-client](https://github.com/socketio/engine.io-client). These dependencies need to be updated together.


Updates `xmlhttprequest-ssl` from 1.5.5 to 1.6.3
- [Release notes](https://github.com/mjwwit/node-XMLHttpRequest/releases)
- [Commits](https://github.com/mjwwit/node-XMLHttpRequest/compare/1.5.5...1.6.3)

Updates `engine.io-client` from 4.0.0 to 4.1.4
- [Release notes](https://github.com/socketio/engine.io-client/releases)
- [Changelog](https://github.com/socketio/engine.io-client/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/engine.io-client/compare/4.0.0...4.1.4)

---
updated-dependencies:
- dependency-name: xmlhttprequest-ssl
  dependency-type: indirect
- dependency-name: engine.io-client
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-20 00:46:22 +01:00
dependabot[bot]
d196f6a6b7 chore(deps): bump minimatch from 3.0.4 to 3.1.2 (#660)
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-20 00:43:47 +01:00
dependabot[bot]
7c1270f98c chore(deps): bump nanoid from 3.1.25 to 3.3.1 (#659)
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.25 to 3.3.1.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.25...3.3.1)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-20 00:43:37 +01:00
Damien Arrachequesne
535a01d889 ci: add Node.js 18 in the test matrix
A few notes:

- the certificates were recreated because Node.js 18 includes OpenSSL
v3, which has deprecated support for some legacy ciphers (like RC2)

- eiows currently fails to build on Node.js 18, so the tests are
temporarily skipped

See also: https://github.com/nodejs/Release
2022-11-20 00:20:30 +01:00
Tamas Flamich
1b71a6f5cb docs: remove "Vanilla JS" highlight from README (#656) 2022-11-18 21:49:23 +01:00
Damien Arrachequesne
d882822908 ci: migrate from zuul to webdriver.io
zuul is now archived [1] and does not support the new W3C WebDriver
protocol, since it relies on the wd package [2] under the hood, which
uses the (now deprecated) JSON Wire Protocol.

We will now use the webdriver.io test framework, which allows to run
our tests in local and on Sauce Labs (cross-browser and mobile tests).
This allows us to run our tests on latest versions of Android and iOS,
since Sauce Labs only supports the W3C WebDriver protocol for these
platforms ([3]).

[1]: https://github.com/defunctzombie/zuul
[2]: https://github.com/admc/wd
[3]: https://docs.saucelabs.com/dev/w3c-webdriver-capabilities/
2022-11-17 09:51:12 +01:00
Dirk Stolle
e8912891b2 ci: update actions in GitHub Actions workflows (#1564) 2022-11-15 11:34:22 +01:00
Damien Arrachequesne
9143aa4c8e chore: update browserslist 2022-11-15 10:34:46 +01:00
Damien Arrachequesne
194a9b762e ci: migrate from zuul to webdriver.io
zuul is now archived [1] and does not support the new W3C WebDriver
protocol, since it relies on the wd package [2] under the hood, which
uses the (now deprecated) JSON Wire Protocol.

We will now use the webdriver.io test framework, which allows to run
our tests in local and on Sauce Labs (cross-browser and mobile tests).
This allows us to run our tests on latest versions of Android and iOS,
since Sauce Labs only supports the W3C WebDriver protocol for these
platforms ([3]).

[1]: https://github.com/defunctzombie/zuul
[2]: https://github.com/admc/wd
[3]: https://docs.saucelabs.com/dev/w3c-webdriver-capabilities/
2022-11-15 10:13:08 +01:00
Dirk Stolle
a9758da4be ci: update actions in GitHub Actions workflows (#117) 2022-11-15 10:02:20 +01:00
Damien Arrachequesne
f0af8834f8 docs: add missing versions in the changelog
Related: https://github.com/advisories/GHSA-qm95-pgcg-qqfq
2022-11-09 11:42:23 +01:00
Annniee1
cedd3117cf chore: bump socket.io-parser to version 4.2.1 (#1559) 2022-11-05 23:05:44 +01:00
Damien Arrachequesne
f4b698418a docs: add missing versions in the changelog 2022-11-02 08:40:26 +01:00
Damien Arrachequesne
9ec85f7da1 docs: add missing versions in the changelog (2) 2022-11-02 08:15:35 +01:00
Damien Arrachequesne
f9b773ffa0 docs: add missing versions in the changelog 2022-11-02 07:48:35 +01:00
Damien Arrachequesne
945c84be47 chore(release): 4.5.3
Diff: https://github.com/socketio/socket.io/compare/4.5.2...4.5.3
2022-10-15 07:14:45 +02:00
Damien Arrachequesne
2eca8dad28 chore(release): 4.5.3
Diff: https://github.com/socketio/socket.io-client/compare/4.5.2...4.5.3
2022-10-15 07:04:22 +02:00
Damien Arrachequesne
7c056889ee docs: add jsdoc for each public method 2022-10-15 06:54:56 +02:00
Damien Arrachequesne
d3d0a2d5be fix(typings): accept an HTTP2 server in the constructor
Related:

- https://github.com/socketio/socket.io/issues/4434
- https://github.com/socketio/socket.io/issues/4494
2022-10-14 11:24:36 +02:00
Damien Arrachequesne
19b225b0c8 docs(examples): update dependencies of the basic CRUD example
Related: https://github.com/socketio/socket.io/issues/4409
2022-10-14 10:39:40 +02:00
Damien Arrachequesne
8fae95dd18 docs: add jsdoc for each public method 2022-10-14 10:30:08 +02:00
Damien Arrachequesne
2403b88057 fix: do not swallow user exceptions
Following [1], any exception in a user-provided event listener would
get caught in the try...catch of the decoder and result in the
reconnection of the socket.

[1]: c597023169

Related:

- https://github.com/socketio/socket.io-client/issues/1551
- https://github.com/socketio/socket.io-client/issues/1554
- https://github.com/socketio/socket.io-client/issues/1557
2022-10-13 16:26:35 +02:00
Damien Arrachequesne
e6f6b906db docs: add deprecation notice for the allSockets() method 2022-10-13 15:02:23 +02:00
Damien Arrachequesne
596eb88af7 ci: upgrade to actions/checkout@3 and actions/setup-node@3
Reference: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
2022-10-13 14:50:09 +02:00
Damien Arrachequesne
e357daf585 fix(typings): apply types to "io.timeout(...).emit()" calls
Typed events were not applied when calling "io.timeout(...).emit()".

Related: https://github.com/socketio/socket.io-client/issues/1555#issuecomment-1277289733

Reference: https://socket.io/docs/v4/typescript/
2022-10-13 14:50:09 +02:00
Damien Arrachequesne
1098618a8c ci: temporarily remove iOS 16 from the test matrix
Tests iPhone and iPad 16 are currently failing.

Saucelabs error message:

> An unknown server-side error occurred while processing the command. Original error: W3C capabilities should be provided

It might be time to migrate from zuul (https://github.com/defunctzombie/zuul).
2022-10-13 10:19:49 +02:00
Damien Arrachequesne
fe840e2eb3 chore(release): 0.2.1
Diff: https://github.com/socketio/socket.io-cluster-adapter/compare/0.2.0...0.2.1
2022-10-13 09:23:36 +02:00
Damien Arrachequesne
a5a1c29082 chore: update dev dependencies 2022-10-13 09:17:46 +02:00
Damien Arrachequesne
66b4079953 ci: add Node.js 18 in the test matrix
Reference: https://github.com/nodejs/Release
2022-10-13 09:15:34 +02:00
Rolando Andrade
be0a0e3217 fix: properly handle ERR_IPC_CHANNEL_CLOSED errors (#6)
Related: https://github.com/socketio/socket.io-cluster-adapter/issues/5
2022-10-13 09:11:37 +02:00
Damien Arrachequesne
ddf922aa9e docs: update test suite
The server must send "noop" packets during the upgrade process, in
order to properly end the ongoing HTTP long-polling request (so that no
message gets lost).

Related: c706741544
2022-10-11 16:04:48 +02:00
Damien Arrachequesne
5dc01f73b4 docs: update test suite
- add delay between duplicate poll requests to ensure order
- accept HTTP 400 response for duplicate poll requests
- catch WebSocket "error" event instead of "close" event
2022-09-23 08:50:39 +02:00
Damien Arrachequesne
10fa4a2690 refactor: add list of possible disconnection reasons
Note: some disconnection reasons could be merged in the next major
release, i.e. the Deno impl does not have "forced server close" and
"server shutting down"

Related: https://github.com/socketio/socket.io/issues/4387
2022-09-13 08:25:13 +02:00
Damien Arrachequesne
8be95b3bd3 chore(release): 4.5.2
Diff: https://github.com/socketio/socket.io/compare/4.5.1...4.5.2
2022-09-02 23:46:14 +01:00
Damien Arrachequesne
ba497ee3eb fix(uws): prevent the server from crashing after upgrade
This should fix a rare case where the Engine.IO connection was upgraded
to WebSocket while the Socket.IO socket was disconnected, which would
result in the following exception:

> TypeError: Cannot read properties of undefined (reading 'forEach')
>    at subscribe (/node_modules/socket.io/dist/uws.js:87:11)
>    at Socket.<anonymous> (/node_modules/socket.io/dist/uws.js:28:17)
>    at Socket.emit (node:events:402:35)
>    at WebSocket.onPacket (/node_modules/engine.io/build/socket.js:214:22)
>    at WebSocket.emit (node:events:390:28)
>    at WebSocket.onPacket (/node_modules/engine.io/build/transport.js:92:14)
>    at WebSocket.onData (/node_modules/engine.io/build/transport.js:101:14)
>    at message (/node_modules/engine.io/build/userver.js:56:30)

Related: https://github.com/socketio/socket.io/issues/4443
2022-09-02 23:42:26 +01:00
Damien Arrachequesne
2d70813729 chore(release): 4.5.2
Diff: https://github.com/socketio/socket.io-client/compare/4.5.1...4.5.2
2022-09-02 23:36:55 +01:00
Damien Arrachequesne
c597023169 fix: handle ill-formatted packet from server
The decoder can throw an error when trying to decode an invalid payload
sent by the server, so the manager will now catch it, close the
connection and then reconnect instead of crashing.

Related:

- https://github.com/socketio/socket.io/issues/4392
- https://github.com/socketio/socket.io-client/issues/1551
2022-09-02 23:28:35 +01:00
Alex
28038715cb ci: add explicit permissions to workflow (#4466)
Reference: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
2022-09-02 23:10:19 +01:00
Daniel Rosenwasser
134226e96c refactor: add missing constraints (#4431)
See also: https://github.com/microsoft/TypeScript/issues/49489
2022-09-01 21:13:55 +01:00
Damien Arrachequesne
5a2ccff9d1 chore(release): 4.2.1
Diff: https://github.com/socketio/socket.io-parser/compare/4.2.0...4.2.1
2022-06-27 15:42:25 +02:00
Damien Arrachequesne
b5d0cb7dc5 fix: check the format of the index of each attachment
A specially crafted packet could be incorrectly decoded.

Example:

```js
const decoder = new Decoder();

decoder.on("decoded", (packet) => {
  console.log(packet.data); // prints [ 'hello', [Function: splice] ]
})

decoder.add('51-["hello",{"_placeholder":true,"num":"splice"}]');
decoder.add(Buffer.from("world"));
```

As usual, please remember not to trust user input.
2022-06-27 15:39:24 +02:00
Damien Arrachequesne
9890b036cf chore: bump dependencies
Production:

- socket.io-parser: ~4.0.4 => ~4.2.0

Development:

- superagent: ^6.1.0 => ^8.0.0
- tsd: ^0.17.0 => ^0.21.0

Related: https://github.com/socketio/socket.io/issues/3709
2022-06-27 09:16:08 +02:00
Damien Arrachequesne
713a6b451b chore: bump mocha to version 10.0.0
Related: https://github.com/socketio/socket.io/issues/3710
2022-06-27 09:00:31 +02:00
Damien Arrachequesne
8c659bcccf chore: regenerate lockfile
For some reason, the lockfile was not in sync anymore with the
package.json file:

> `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync.

That may be linked to a new version of Node.js (v16.15.1).
2022-06-26 08:19:46 +02:00
Damien Arrachequesne
c814ce2968 feat: add the "maxPayload" field in the handshake
Added in `engine.io@6.2.0` and `socket.io@4.5.0`.

See also: 088dcb4dff
2022-06-12 09:55:08 +02:00
Damien Arrachequesne
1b3bb7cb03 feat: add the "maxPayload" field in the handshake
See also: 088dcb4dff
2022-06-12 09:48:47 +02:00
Lam Wei Li
917d1d29e1 refactor: replace deprecated String.prototype.substr() (#646)
`.substr()` is deprecated so we replace it with `.slice()` which works
similarily but isn't deprecated.

See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr

Signed-off-by: Lam Wei Li <peteriman@mail.com>
2022-06-06 08:42:45 +02:00
Damien Arrachequesne
020801ab8c chore: add changelog for version 3.6.0
Diff: https://github.com/socketio/engine.io/compare/3.5.0...3.6.0
2022-06-06 08:40:21 +02:00
Damien Arrachequesne
18f3fdab12 fix: prevent the socket from joining a room after disconnection
Calling `socket.join()` after disconnection would lead to a memory
leak, because the room was never removed from the memory:

```js
io.on("connection", (socket) => {
  socket.disconnect();
  socket.join("room1"); // leak
});
```

Related:

- https://github.com/socketio/socket.io/issues/4067
- https://github.com/socketio/socket.io/issues/4380
2022-05-25 23:18:42 +02:00
Damien Arrachequesne
3410584a93 refactor: use correct type for BroadcastOptions#except
The 'except' attribute is a set of room IDs, which is then converted to
a set of socket IDs in the computeExceptSids() method.

That wasn't caught because both types are aliases for 'string', but
Room could be extended to all primitive values in the future.

Reference: https://developer.mozilla.org/en-US/docs/Glossary/Primitive

Related: https://github.com/socketio/socket.io-adapter/issues/82
2022-05-25 07:06:27 +02:00
Damien Arrachequesne
5ab8289c0a chore(release): 4.5.1
Diff: https://github.com/socketio/socket.io/compare/4.5.0...4.5.1
2022-05-17 23:38:07 +02:00
Damien Arrachequesne
f0350a0100 chore(release): 4.5.1
Diff: https://github.com/socketio/socket.io-client/compare/4.5.0...4.5.1
2022-05-17 23:34:19 +02:00
Lucas Boemeke
ed1d6f912c test: make test script work on Windows (#643) 2022-05-11 09:00:17 +02:00
Damien Arrachequesne
30430f0985 fix: forward the local flag to the adapter when using fetchSockets()
Related:

- https://github.com/socketio/socket.io/issues/4359
- https://github.com/socketio/socket.io-redis-adapter/issues/454
2022-05-03 15:41:24 +02:00
h110m
9b43c9167c fix(typings): add HTTPS server to accepted types (#4351) 2022-05-03 08:15:22 +02:00
Damien Arrachequesne
764c99f136 chore(release): 5.0.4
Diff: https://github.com/socketio/engine.io-parser/compare/5.0.3...5.0.4
2022-04-30 14:13:42 +02:00
Damien Arrachequesne
bc7400a5e8 refactor: include base64-arraybuffer in the repository
In order to reduce the number of dependencies and the attack surface in
case of supply chain attacks.
2022-04-30 13:59:34 +02:00
Damien Arrachequesne
da182cba3e chore: point the CI badge towards the main branch 2022-04-30 13:54:19 +02:00
Damien Arrachequesne
a421bbec7b fix: add missing file extension for ESM import
Related: https://github.com/socketio/engine.io-parser/issues/127
2022-04-30 12:42:03 +02:00
Damien Arrachequesne
039b45cc65 fix(typings): update the type of RawData
We could also split the declaration of RawData with the "browser"
field:

```
// for Node.js
export type RawData = string | Buffer | ArrayBuffer | ArrayBufferView; // no Blob
// for the browser
export type RawData = string | ArrayBuffer | ArrayBufferView | Blob; // no Buffer
```

But it does not seem supported by the TypeScript compiler, so we'll
revert to just using "any" for now.

Related: https://github.com/socketio/engine.io-parser/issues/128
2022-04-30 12:36:57 +02:00
Damien Arrachequesne
43f9ee8d23 chore(release): 0.2.0
Diff: https://github.com/socketio/socket.io-cluster-adapter/compare/0.1.0...0.2.0
2022-04-28 16:16:13 +02:00
Damien Arrachequesne
055b7840d8 feat: broadcast and expect multiple acks
This feature was added in `socket.io@4.5.0`:

```js
io.timeout(1000).emit("some-event", (err, responses) => {
  // ...
});
```

Thanks to this change, it will now work with multiple Socket.IO
servers.

Related: https://github.com/socketio/socket.io/issues/4163
2022-04-28 16:11:12 +02:00
Damien Arrachequesne
8ecfcba5c1 chore(release): 4.5.0
Diff: https://github.com/socketio/socket.io/compare/4.4.1...4.5.0
2022-04-24 00:45:57 +02:00
Damien Arrachequesne
abdba07030 chore(release): 4.5.0
Diff: https://github.com/socketio/socket.io-client/compare/4.4.1...4.5.0
2022-04-24 00:37:51 +02:00
Damien Arrachequesne
faf68a5de1 chore: update default label for bug reports 2022-04-24 00:18:42 +02:00
Damien Arrachequesne
c0ba7344e2 chore: add Node.js 16 in the test matrix
See also: https://github.com/nodejs/Release
2022-04-24 00:17:23 +02:00
Damien Arrachequesne
e8590188ec refactor: replace the disconnected attribute by a getter 2022-04-24 00:13:56 +02:00
Damien Arrachequesne
74e3e601a4 feat: add support for catch-all listeners for outgoing packets
This is similar to `onAny()`, but for outgoing packets.

Syntax:

```js
socket.onAnyOutgoing((event, ...args) => {
  console.log(event);
});
```

Related: 531104d332
2022-04-23 23:57:03 +02:00
Damien Arrachequesne
692d54e9fd chore: point the CI badge towards the main branch 2022-04-23 22:59:48 +02:00
Damien Arrachequesne
6fdf3c9bfa refactor: import single-file 3rd party modules
This commit allows to:

- provide an ESM version of those modules ([1])
- reduce the attack surface in case of supply chain attacks
- reduce the size of the bundle with tree-shaking

As a downside, we won't receive security updates for those modules
anymore.

[1]: socketio/socket.io-client#1536

Related: df32277c3f
2022-04-23 22:55:39 +02:00
Damien Arrachequesne
b862924b7f feat: add details to the disconnect event
The "disconnect" event will now include additional details to help
debugging if anything has gone wrong.

Example when a payload is over the maxHttpBufferSize value in HTTP
long-polling mode:

```js
socket.on("disconnect", (reason, details) => {
  console.log(reason); // "transport error"

  // in that case, details is an error object
  console.log(details.message); "xhr post error"
  console.log(details.description); // 413 (the HTTP status of the response)

  // details.context refers to the XMLHttpRequest object
  console.log(details.context.status); // 413
  console.log(details.context.responseText); // ""
});
```

Related: b9252e2074
2022-04-23 00:57:23 +02:00
Damien Arrachequesne
572133a58d docs(examples): update example with webpack 2022-04-22 23:10:01 +02:00
Damien Arrachequesne
6e1bb62982 chore: bump engine.io to version 6.2.0
Release notes: https://github.com/socketio/engine.io/releases/tag/6.2.0
Diff: https://github.com/socketio/engine.io/compare/6.1.3...6.2.0
2022-04-22 22:43:31 +02:00
Damien Arrachequesne
06e6838b18 docs(examples): add server bundling example with rollup
Related: https://github.com/socketio/socket.io/issues/4329
2022-04-22 22:40:15 +02:00
WD
1f03a44d1f docs(examples): update create-react-app example (#4347) 2022-04-20 22:47:34 +02:00
Damien Arrachequesne
c7514b5aa6 chore(release): 4.2.0
Diff: https://github.com/socketio/socket.io-parser/compare/4.1.2...4.2.0
2022-04-18 00:26:27 +02:00
Damien Arrachequesne
931f1526a4 chore: add Node.js 16 in the test matrix
See also: https://github.com/nodejs/Release
2022-04-18 00:21:14 +02:00
Damien Arrachequesne
6c9cb27aeb chore: bump @socket.io/component-emitter to version 3.1.0
Related: https://github.com/socketio/socket.io-client/issues/1536
2022-04-18 00:20:17 +02:00
David Pfeffer
b08bc1a93e feat: allow the usage of custom replacer and reviver (#112)
Co-authored-by: Mocanu Cristian <mocanu.cristian93@gmail.com>
2022-04-18 00:19:02 +02:00
Damien Arrachequesne
d7e3ab7956 chore(release): 6.2.0
Diff: https://github.com/socketio/engine.io/compare/6.1.3...6.2.0
2022-04-17 23:53:53 +02:00
Damien Arrachequesne
ab6a6d4db8 chore(release): 3.1.0 2022-04-17 23:21:08 +02:00
Damien Arrachequesne
54468cf7a3 feat: add ESM version
Related: https://github.com/socketio/socket.io-client/issues/1536
2022-04-17 23:18:40 +02:00
Damien Arrachequesne
be3d7f0f1f docs(examples): add TODO example with Postgres and Node.js cluster 2022-04-07 12:35:00 +02:00
Damien Arrachequesne
d12aab2d69 docs(examples): add example with express-session
Related: https://github.com/socketio/socket.io/issues/3933
2022-04-02 11:08:26 +02:00
Damien Arrachequesne
9f758689f6 docs(examples): pin the version of karma-jasmine-html-reporter
Related:

- https://github.com/socketio/socket.io/issues/4325
- https://github.com/dfederm/karma-jasmine-html-reporter/issues/54
2022-04-01 14:42:34 +02:00
Damien Arrachequesne
0b35dc77c0 refactor: make the protocol implementation stricter
This commit handles several edge cases that were silently ignored
before:

- receiving several CONNECT packets during a session
- receiving any packet without CONNECT packet first
2022-03-31 12:24:31 +02:00
Damien Arrachequesne
531104d332 feat: add support for catch-all listeners for outgoing packets
This is similar to `onAny()`, but for outgoing packets.

Syntax:

```js
socket.onAnyOutgoing((event, ...args) => {
  console.log(event);
});
```
2022-03-31 10:35:09 +02:00
Damien Arrachequesne
8b204570a9 feat: broadcast and expect multiple acks
Syntax:

```js
io.timeout(1000).emit("some-event", (err, responses) => {
  // ...
});
```

The adapter exposes two additional methods:

- `broadcastWithAck(packets, opts, clientCountCallback, ack)`

Similar to `broadcast(packets, opts)`, but:

* `clientCountCallback()` is called with the number of clients that
  received the packet (can be called several times in a cluster)
* `ack()` is called for each client response

- `serverCount()`

It returns the number of Socket.IO servers in the cluster (1 for the
in-memory adapter).

Those two methods will be implemented in the other adapters (Redis,
Postgres, MongoDB, ...).

Related:

- https://github.com/socketio/socket.io/issues/1811
- https://github.com/socketio/socket.io/issues/4163
- https://github.com/socketio/socket.io-redis-adapter/issues/445
2022-03-31 07:49:09 +02:00
Damien Arrachequesne
0b7d70ca42 chore: bump lockfile to v2 2022-03-30 08:15:41 +02:00
Damien Arrachequesne
b92d65cf9c chore(release): 2.4.0
Diff: https://github.com/socketio/socket.io-adapter/compare/2.3.3...2.4.0
2022-03-30 08:03:38 +02:00
Damien Arrachequesne
af9d7936e9 chore: bump lockfile to v2 2022-03-30 07:59:34 +02:00
dependabot[bot]
d9909203cf chore(deps): bump ansi-regex from 3.0.0 to 3.0.1 (#81)
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-30 07:55:46 +02:00
Damien Arrachequesne
808c0450d8 refactor: do not throw on serverSideEmit() call
Related: https://github.com/socketio/socket.io-adapter/issues/75
2022-03-30 07:49:49 +02:00
Damien Arrachequesne
6c21bceb59 chore: add note about integers used as room identifier 2022-03-29 09:05:31 +02:00
Damien Arrachequesne
38ee887fef feat: notify listeners for each outgoing packet
Related:

- https://github.com/socketio/socket.io/pull/4145
- https://github.com/socketio/socket.io-adapter/pull/78
2022-03-29 08:56:26 +02:00
Damien Arrachequesne
a7f1c90a32 feat: broadcast and expect multiple acks
Tests will be added in the parent repository.

Related:

- https://github.com/socketio/socket.io/issues/1811
- https://github.com/socketio/socket.io/issues/4163
2022-03-29 08:54:54 +02:00
dependabot[bot]
75455fa8ba chore(deps): bump minimist from 1.2.5 to 1.2.6 (#80)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-28 07:47:01 +02:00
Damien Arrachequesne
088dcb4dff feat: add the "maxPayload" field in the handshake details
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}
```

Related: https://github.com/socketio/socket.io-client/issues/1531
2022-03-10 14:20:54 +01:00
Damien Arrachequesne
657f04e0b8 chore: add Node.js 16 in the test matrix
See also: https://github.com/nodejs/Release
2022-03-10 14:20:36 +01:00
Damien Arrachequesne
97f2fa3269 docs: add test suite for checking server compliance
Related: https://github.com/socketio/socket.io-protocol/issues/14
2022-03-01 07:59:50 +01:00
Damien Arrachequesne
e24b27b8ef refactor: return an HTTP 413 response for too large payloads
Before this, the connection was closed abrutly with an HTTP 502
response.

See also: f8100f9237

Related: https://github.com/socketio/socket.io/issues/4293
2022-02-28 07:21:53 +01:00
Damien Arrachequesne
ce3fe9d80b chore(release): 6.1.3
Diff: https://github.com/socketio/engine.io/compare/6.1.2...6.1.3
2022-02-23 07:40:31 +01:00
Damien Arrachequesne
1bc5b1a2fd chore: bump engine.io-parser to version 5.0.3
In order to make sure the types added in [1] are included.

Related:

- https://github.com/socketio/engine.io/issues/639
- https://github.com/socketio/engine.io/issues/640

[1]: ad5bd7ddf5
2022-02-23 07:36:58 +01:00
e3dio
5df4f18f3e perf(uws): remove nested inner functions 2022-02-23 07:16:25 +01:00
e3dio
3367440308 fix(uws): properly handle chunked content (#642)
With the engine based on µWebSockets.js (introduced in version 6.1.0),
a huge request body split in multiple chunks would throw the following
error:

> node:buffer:254
>   TypedArrayPrototypeSet(target, source, targetStart);
>   ^
>
> TypeError: Cannot perform %TypedArray%.prototype.set on a detached ArrayBuffer
>     at Buffer.set (<anonymous>)
>     at _copyActual (node:buffer:254:3)
> node:buffer:254
>   TypedArrayPrototypeSet(target, source, targetStart);
>   ^
>
> TypeError: Cannot perform %TypedArray%.prototype.set on a detached ArrayBuffer
>     at Buffer.set (<anonymous>)
>     at _copyActual (node:buffer:254:3)
>     at Function.concat (node:buffer:562:12)
>     at onEnd (.../node_modules/engine.io/build/transports-uws/polling.js:126:32)
>     at .../node_modules/engine.io/build/transports-uws/polling.js:143:17

Note: µWebSockets.js does not currently support chunked transfer
encoding.
2022-02-23 07:16:25 +01:00
Damien Arrachequesne
d3ae7ab878 docs: add test suite for checking server compliance
Related: https://github.com/socketio/socket.io-protocol/issues/14
2022-02-20 07:34:08 +01:00
dependabot[bot]
4952193c04 chore: bump cached-path-relative from 1.0.2 to 1.1.0 (#125)
Bumps [cached-path-relative](https://github.com/ashaffer/cached-path-relative) from 1.0.2 to 1.1.0.
- [Release notes](https://github.com/ashaffer/cached-path-relative/releases)
- [Commits](https://github.com/ashaffer/cached-path-relative/commits)

---
updated-dependencies:
- dependency-name: cached-path-relative
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-17 07:48:15 +01:00
Damien Arrachequesne
aed252c742 chore(release): 4.1.2
Diff: https://github.com/socketio/socket.io-parser/compare/4.1.1...4.1.2
2022-02-17 07:37:18 +01:00
dependabot[bot]
89209fa22a chore: bump cached-path-relative from 1.0.2 to 1.1.0 (#113)
Bumps [cached-path-relative](https://github.com/ashaffer/cached-path-relative) from 1.0.2 to 1.1.0.
- [Release notes](https://github.com/ashaffer/cached-path-relative/releases)
- [Commits](https://github.com/ashaffer/cached-path-relative/commits)

---
updated-dependencies:
- dependency-name: cached-path-relative
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-17 07:19:50 +01:00
dependabot[bot]
0a3b556de3 chore: bump path-parse from 1.0.6 to 1.0.7 (#108)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-17 07:18:40 +01:00
Gabba90
7f6b262ac8 fix: allow objects with a null prototype in binary packets (#114) 2022-02-17 07:18:11 +01:00
Jeffrey van Norden
a463d268ed fix(typings): allow CorsOptionsDelegate as cors options (#641)
Reference: https://www.npmjs.com/package/cors#configuring-cors-asynchronously

Related: 54a59cd8f0
2022-02-17 06:36:49 +01:00
dependabot[bot]
2b70ceee63 chore: bump ajv from 6.12.2 to 6.12.6 (#126)
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.12.2 to 6.12.6.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](https://github.com/ajv-validator/ajv/compare/v6.12.2...v6.12.6)

---
updated-dependencies:
- dependency-name: ajv
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-16 21:58:23 +01:00
dependabot[bot]
8e8346b706 chore: bump ajv from 6.12.2 to 6.12.6 (#115)
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.12.2 to 6.12.6.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](https://github.com/ajv-validator/ajv/compare/v6.12.2...v6.12.6)

---
updated-dependencies:
- dependency-name: ajv
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-16 21:57:15 +01:00
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
Chris Swithinbank
02c87a8561 fix(typings): ensure compatibility with TypeScript 3.x (#4259)
Labeled tuple elements were added in TypeScript 4.0.

Reference: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#labeled-tuple-elements

Related: 44e20ba5bf
2022-01-25 01:25:05 +01:00
Damien Arrachequesne
90fb0a99ac chore(release): 6.1.2
Diff: https://github.com/socketio/engine.io/compare/6.1.1...6.1.2
2022-01-18 18:00:23 +01:00
Damien Arrachequesne
e122e4be7b refactor: add additional types
Merged from https://github.com/socketio/engine.io/pull/630
2022-01-18 17:55:55 +01:00
Damien Arrachequesne
3f1e312a2c chore: bump package-lock.json file version
Note to future self: URL for dependencies from GitHub must use
"git+https" instead of "git+ssh" to make the CI pass, else you will
encounter the following error:

```
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/uNetworking/uWebSockets.js.git
npm ERR!
npm ERR! Warning: Permanently added the RSA host key for IP address '140.82.112.3' to the list of known hosts.
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
```
2022-01-18 17:53:58 +01:00
Damien Arrachequesne
45112a30d1 fix(uws): fix HTTP long-polling with CORS
When binding to an uWebSockets.js application, the server could crash
with the following error:

```
TypeError: res.onData is not a function
    at Polling.onDataRequest (build/transports-uws/polling.js:133:13)
    at Polling.onRequest (build/transports-uws/polling.js:47:18)
    at callback (build/userver.js:80:56)
```

Related: https://github.com/socketio/engine.io/issues/637
2022-01-18 17:49:28 +01:00
Damien Arrachequesne
8096c122bb chore(release): 5.0.3
Diff: https://github.com/socketio/engine.io-parser/compare/5.0.2...5.0.3
2022-01-17 10:24:51 +01:00
Damien Arrachequesne
ad5bd7ddf5 refactor: add additional types
Merged from https://github.com/socketio/engine.io/pull/630
2022-01-17 10:23:16 +01:00
Damien Arrachequesne
25a4b2bbf5 chore: replace base64-arraybuffer by @socket.io/base64-arraybuffer
The "base64-arraybuffer" package has been temporarily forked to [1],
until changes are merged upstream.

[1]: https://github.com/socketio/base64-arraybuffer

Related:

- https://github.com/niklasvh/base64-arraybuffer/issues/32
- https://github.com/socketio/socket.io-client/issues/1520
- https://github.com/socketio/socket.io-website/issues/313
- https://github.com/socketio/socket.io/discussions/4209
2022-01-17 10:23:11 +01:00
Yosi Attias
49bb7cf665 fix(uws): expose additional uWebSockets.js options (#634)
You can now pass additional options:

```js
const { App } = require("uWebSockets.js");
const { uServer } = require("engine.io");

const app = new App();
const server = new uServer();

server.attach(app, {
  compression: uWS.DEDICATED_COMPRESSOR_128KB, // defaults to none
  idleTimeout: 60, // defaults to 120
  maxBackpressure: 8 * 1024 // defaults to 1024 * 1024
});

app.listen(3000);
```

Related: https://github.com/socketio/engine.io/issues/633
2022-01-14 08:57:46 +01:00
Damien Arrachequesne
8b4d6a8176 fix(uws): handle invalid websocket upgrades
When binding to an uWebSockets.js App, there was an unhandled case that
could crash the server:

```
curl "http://localhost:3000/engine.io/?EIO=4&transport=websocket"
```

would result in:

```
Error: Returning from a request handler without responding or attaching an abort handler is forbidden!
terminate called without an active exception
```

Note: this does not apply to the default server based on ws, because
the error was caught elsewhere in the source code.

Related: https://github.com/socketio/socket.io/issues/4250
2022-01-14 08:18:03 +01:00
dependabot[bot]
a84595a04e chore(deps): bump engine.io from 4.0.0 to 4.1.2 in /examples/latency (#636)
Bumps [engine.io](https://github.com/socketio/engine.io) from 4.0.0 to 4.1.2.
- [Release notes](https://github.com/socketio/engine.io/releases)
- [Changelog](https://github.com/socketio/engine.io/blob/4.1.2/CHANGELOG.md)
- [Commits](https://github.com/socketio/engine.io/compare/4.0.0...4.1.2)

---
updated-dependencies:
- dependency-name: engine.io
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-14 07:59:43 +01:00
Damien Arrachequesne
f3b761dc56 chore(release): 6.1.1
Diff: https://github.com/socketio/engine.io/compare/6.1.0...6.1.1
2022-01-11 16:08:20 +01:00
Damien Arrachequesne
c0e194d449 fix: properly handle invalid data sent by a malicious websocket client
**IMPORTANT SECURITY FIX**

A malicious client could send a specially crafted HTTP request,
triggering an uncaught exception and killing the Node.js process:

> RangeError: Invalid WebSocket frame: RSV2 and RSV3 must be clear
>   at Receiver.getInfo (/.../node_modules/ws/lib/receiver.js:176:14)
>   at Receiver.startLoop (/.../node_modules/ws/lib/receiver.js:136:22)
>   at Receiver._write (/.../node_modules/ws/lib/receiver.js:83:10)
>   at writeOrBuffer (internal/streams/writable.js:358:12)

This bug was introduced by [1], included in `engine.io@4.0.0`, so
previous releases are not impacted.

[1]: f3c291fa61

Thanks to Marcus Wejderot from Mevisio for the responsible disclosure.
2022-01-11 15:52:15 +01:00
Damien Arrachequesne
37b6d8fff0 chore: update default label for bug reports 2022-01-10 08:55:56 +01:00
Damien Arrachequesne
eaf782c41b docs: remove broken badges
Related: https://github.com/socketio/socket.io/issues/4242
2022-01-10 08:05:04 +01:00
Damien Arrachequesne
af54565b2d docs: remove broken badges
Related: https://github.com/socketio/socket.io/issues/4242
2022-01-10 08:03:53 +01:00
Damien Arrachequesne
aa5312a4b6 chore: revert to lockfile v1
Updating to v2 fails in the CI on Node.js 12 & 14 with the following
error:

> npm ERR! Error while executing:
> npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/uNetworking/uWebSockets.js.git
> npm ERR!
> npm ERR! Warning: Permanently added the RSA host key for IP address '140.82.113.3' to the list of known hosts.
> npm ERR! git@github.com: Permission denied (publickey).
> npm ERR! fatal: Could not read from remote repository.
> npm ERR!
> npm ERR! Please make sure you have the correct access rights
> npm ERR! and the repository exists.
> npm ERR!
> npm ERR! exited with error code: 128

So we will revert the change for now.
2022-01-06 08:01:00 +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
Damien Arrachequesne
359d1e25e7 chore(release): 4.4.1
Diff: https://github.com/socketio/socket.io-client/compare/4.4.0...4.4.1
2022-01-06 07:24:53 +01:00
Orkhan Alikhanov
770ee5949f fix(types): make RemoteSocket.data type safe (#4234)
Related:

- https://github.com/socketio/socket.io/issues/4229
- fe8730ca0f
2022-01-06 07:14:55 +01:00
Damien Arrachequesne
3bf5d92735 refactor: add note about fetchSockets() for parent namespaces
Related: https://github.com/socketio/socket.io/issues/4235
2022-01-05 08:50:40 +01:00
Shayan Yousefi
fc82e44f73 refactor(typings): export Event type (#4215)
So that it can be used by the end users:

```ts
const myMiddleware = ([eventName, ...args]: Event, next: (err?: Error) => void) => {
  console.log(eventName); // inferred as string
  next();
}

io.on("connection", (socket) => {
  socket.use(myMiddleware);
});
```
2022-01-05 08:08:18 +01:00
Damien Arrachequesne
c840bad43a test: fix flaky tests 2022-01-05 08:00:55 +01:00
Damien Arrachequesne
f56fdd0f09 chore: remove duplicate package.json file
The additional package.json file, which was copied to
build/cjs/package.json, did hide the parent one, leading to several
issues and providing no real feature. The other one, copied to
build/esm/package.json, is needed though, to enforce the module type.

Related:

- https://github.com/socketio/socket.io/issues/4194
- https://github.com/socketio/socket.io-client/issues/1513
2022-01-04 09:57:43 +01:00
Orkhan Alikhanov
f2b8de7191 fix(typings): pass SocketData type to custom namespaces (#4233)
The `SocketData` type was only available on the main namespace.

Related: https://github.com/socketio/socket.io/issues/4229
See also: fe8730ca0f
2022-01-04 09:09:42 +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
Gray Zhang
19836d9abf chore: add types to exports field to be compatible with nodenext module resolution (#1522)
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

Reference: https://www.typescriptlang.org/tsconfig/#module
2021-12-28 10:22:45 +01:00
Damien Arrachequesne
c196689545 docs: fix basic crud example
Related: https://github.com/socketio/socket.io/issues/4213
2021-12-16 23:00:20 +01:00
Jeff Winder
b04967b52e refactor: import Node's setTimeout & clearTimeout to prevent ambiguity (#632) 2021-12-14 09:09:23 +01:00
Mikhail Dudin
7a70f63499 docs: fix reconnection handling in the chat demo app (#4189) 2021-12-01 00:03:43 +01:00
anderslatif
e5897dd7dc docs: add usage with ES modules (#4195) 2021-12-01 00:02:13 +01:00
Damien Arrachequesne
2071a66c5a docs: simplify nginx cluster example
- remove useless Dockerfile
- clean format
- migrate to @socket.io/redis-adapter
2021-11-24 18:15:26 +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
b839a3b400 fix: prevent double ack when emitting with a timeout
The ack was not properly removed upon timeout, and could be called
twice.

Related: f0ed42f18c
2021-11-18 14:03:07 +01:00
Damien Arrachequesne
71e34a3826 chore(release): 4.4.0
Diff: https://github.com/socketio/socket.io-client/compare/4.3.2...4.4.0
2021-11-18 13:51:36 +01:00
Damien Arrachequesne
1e1952b817 chore: bump engine.io-client version
Diff: https://github.com/socketio/engine.io-client/compare/6.0.1...6.1.1
2021-11-18 13:47:41 +01:00
Damien Arrachequesne
522ffbe7a8 fix: prevent double ack with timeout
The ack was not properly removed upon timeout, and could be called
twice.

Related: ccf7998cc5
2021-11-18 13:40:46 +01:00
Damien Arrachequesne
99c2cb8421 fix: fix socket.disconnect().connect() usage
Previously, calling `socket.disconnect().connect()` could, if the
connection was upgraded to WebSocket, result in "disconnect" being
emitted twice, and an engine being leaked.

Here's what happened:

> socket.disconnect()

- calls `socket.destroy()` so the socket doesn't listen to the manager events anymore
- then calls `manager._close()` which closes the underlying engine but not the manager itself (it waits for the "close" event of the engine)

> socket.connect()

- calls `socket.subEvents()` so the socket does listen to the manager events
- calls `manager.open()` which creates a new engine

And then the first engine emits a "close" event, which is forwarded to
the socket, hence the second "disconnect" event.

Related: https://github.com/socketio/socket.io-client/issues/1014
2021-11-18 13:39:40 +01:00
Damien Arrachequesne
f0ed42f18c feat: add timeout feature
Usage:

```js
socket.timeout(5000).emit("my-event", (err) => {
  if (err) {
    // the client did not acknowledge the event in the given delay
  }
});
```
2021-11-16 20:07:53 +01:00
Damien Arrachequesne
53d8fcafab fix: add package name in nested package.json
Note: the version must be kept in sync when publishing a new release

Related: socketio/socket.io-client#1513
2021-11-16 19:59:59 +01:00
Damien Arrachequesne
d54d12ce63 fix: prevent socket from reconnecting after middleware failure
Related: https://github.com/socketio/socket.io/discussions/4150
2021-11-16 19:57:47 +01:00
Damien Arrachequesne
ccf7998cc5 feat: add timeout feature
Usage:

```js
socket.timeout(5000).emit("my-event", (err) => {
  if (err) {
    // the server did not acknowledge the event in the given delay
  }
});
```
2021-11-16 19:56:44 +01:00
Damien Arrachequesne
b7213e71e4 test: fix flaky test
`srv.close()` only closes the underlying HTTP server, but this does not
terminate the existing WebSocket connections.

Reference: https://nodejs.org/api/http.html#serverclosecallback
2021-11-16 15:58:55 +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
75854a7518 chore(release): 2.3.3
Diff: https://github.com/socketio/socket.io-adapter/compare/2.3.2...2.3.3
2021-11-16 15:30:32 +01:00
Damien Arrachequesne
88eee5948a fix: fix broadcasting volatile packets with binary attachments
The binary attachments of volatile packets were discarded (only the
header packet was sent) due to a bug introduced in [1].

Note: the `wsPreEncoded` option is removed by this commit, as I wasn't
able to find an elegant (read: non explosive) way to keep it.

[1]: 5579d40c24

Related: https://github.com/socketio/socket.io/issues/3919
2021-11-16 15:24:55 +01:00
dependabot[bot]
83cce96d1a chore(deps): bump y18n from 4.0.0 to 4.0.3 (#79)
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.3.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/y18n-v4.0.3/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/compare/v4.0.0...y18n-v4.0.3)

---
updated-dependencies:
- dependency-name: y18n
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-16 15:24:26 +01:00
Damien Arrachequesne
cb26d5cbb6 chore(release): 5.0.2
Diff: https://github.com/socketio/engine.io-parser/compare/5.0.1...5.0.2
2021-11-14 07:26:24 +01:00
Damien Arrachequesne
7e271596c3 fix: add package name in nested package.json
Related: https://github.com/socketio/socket.io-client/issues/1513
2021-11-14 07:23:10 +01:00
Damien Arrachequesne
5f22ed0527 fix: fix vite build for CommonJS users
Related: https://github.com/socketio/socket.io-client/issues/1504
2021-11-14 07:23:10 +01:00
Damien Arrachequesne
02b0f73e2c fix: only set 'connected' to true after middleware execution
The Socket instance is only considered connected when the "connection"
event is emitted, and not during the middleware(s) execution.

```js
io.use((socket, next) => {
  console.log(socket.connected); // prints "false"
  next();
});

io.on("connection", (socket) => {
  console.log(socket.connected); // prints "true"
});
```

Related: https://github.com/socketio/socket.io/issues/4129
2021-11-12 07:31:52 +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
Nikita Kolmogorov
fe8730ca0f feat: add type information to socket.data (#4159)
Usage:

```js
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;
});
```
2021-11-08 15:21:48 +01:00
Damien Arrachequesne
4c306af945 chore(release): 6.1.0
Diff: https://github.com/socketio/engine.io/compare/6.0.0...6.1.0
2021-11-08 08:37:22 +01:00
Damien Arrachequesne
972de60ffb docs: add changelog for release 6.0.1
Merged from the 6.0.x branch.
2021-11-08 08:20:30 +01:00
Damien Arrachequesne
6d9f0c364a chore: bump mocha to version 9.1.3
The uWebSocket.js App has no close method for now, so we can't properly
stop the engine at the end of the tests, hence the "--exit".
2021-11-08 08:18:18 +01:00
Damien Arrachequesne
35b6b505df test: replace "s" package by string interpolation 2021-11-08 08:17:25 +01:00
dependabot[bot]
ab84c2d2f3 chore: bump ansi-regex from 5.0.0 to 5.0.1 (#123)
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-08 06:41:27 +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
ed50fc346b fix: fix payload encoding for v3 clients
The v3 parser (used for compatibility with older clients) was broken
during the migration to TypeScript ([1]).

This was not caught in the test suite because the Node.js client does
not support binary packet in polling mode (packets are base64-encoded).

[1]: c0d6eaa1ba

Backported from 6.0.x branch: 3f42262fd2
2021-11-06 08:03:57 +01:00
Damien Arrachequesne
271e2df94d feat: add an implementation based on uWebSockets.js
```js
const { App } = require("uWebSockets.js");
const { uServer } = require("engine.io");

const app = new App();
const server = new uServer();

server.attach(app);

app.listen(3000);
```

Reference: https://github.com/uNetworking/uWebSockets.js

Related: https://github.com/socketio/engine.io/issues/578
2021-11-02 22:46:09 +01:00
Tom Atkinson
37474c7e67 perf: refresh ping timer (#628)
Reference: https://nodejs.org/docs/latest/api/timers.html#timeoutrefresh
2021-11-01 21:33:15 +01:00
Sebastiaan Marynissen
9d86397243 fix: fix race condition in dynamic namespaces (#4137)
Using an async operation with `io.use()` could lead to the creation of
several instances of a same namespace, each of them overriding the
previous one.

Example:

```js
io.use(async (nsp, auth, next) => {
  await anOperationThatTakesSomeTime();
  next();
});
```

Related: https://github.com/socketio/socket.io/pull/4136
2021-10-24 07:46:29 +02:00
Naseem
44e20ba5bf refactor: add event type for use() (#4138) 2021-10-24 07:19:43 +02:00
Damien Arrachequesne
da0b8282f3 chore(release): 4.3.2
Diff: https://github.com/socketio/socket.io-client/compare/4.3.1...4.3.2
2021-10-17 01:13:27 +02:00
Damien Arrachequesne
6780f29624 fix: restore the default export (bis)
The previous commit, while successfully restoring support for:

```js
const socket = require("socket.io-client")(...);
```

breaks for some other cases:

- https://github.com/socketio/socket.io/issues/4128
- https://github.com/socketio/socket.io-client/issues/1509

According to [1], we should use `export = `, but this is not supported
by module "esnext":

> Export assignment cannot be used when targeting ECMAScript modules

So we'll go for this ugly workaround, at least until we remove the
default export in the next major release.

[1]: https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require
2021-10-17 01:00:28 +02: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
Josh Field
0ef2a4d02c fix: fix server attachment (#4127)
The check excluded an HTTPS server from being properly attached.

Related: https://github.com/socketio/socket.io/issues/4124
2021-10-16 23:58:55 +02:00
Damien Arrachequesne
fa6d4f6d84 chore(release): 5.0.1
Diff: https://github.com/socketio/engine.io-parser/compare/5.0.0...5.0.1
2021-10-16 01:23:30 +02:00
Damien Arrachequesne
900346ea34 fix: fix vite build
Some bundlers (like vite) do not support having a "browser" field in a
nested package.json.

Related: https://github.com/socketio/socket.io-client/issues/1504
2021-10-16 01:19:51 +02:00
Damien Arrachequesne
ca614b28f8 chore(release): 4.3.1
Diff: https://github.com/socketio/socket.io-client/compare/4.3.0...4.3.1
2021-10-16 01:13:08 +02:00
Damien Arrachequesne
f0aae8457a fix: restore the default export
The default export was accidentally removed in [1].

Note: that being said, users are encouraged to use the named exports,
because the default export has a different meaning for CommonJS and ES
modules users.

```js
// BAD
import io from "socket.io-client";

// GOOD
import { io } from "socket.io-client";
```

Related:

- https://github.com/socketio/socket.io-client/issues/1505
- https://github.com/socketio/socket.io-client/issues/1507
- https://github.com/socketio/socket.io-client/issues/1508

[1]: 16b65698ae
2021-10-16 01:09:43 +02:00
Chris Krycho
8737d0ae6f fix: restore the namespace export
This restores the previous behavior, where the "io" object available in
the browser could be used as a function (`io()`) or as a namespace
(`io.connect()`).

The breaking change was introduced in [1].

Related: https://github.com/socketio/socket.io/issues/4121

[1]: 16b65698ae
2021-10-16 00:52:31 +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
c76d36778d chore(release): 4.3.0
Diff: https://github.com/socketio/socket.io-client/compare/4.2.0...4.3.0
2021-10-14 14:37:33 +02:00
Damien Arrachequesne
91b948b860 refactor: move the typed events to @socket.io/component-emitter
The typed events have been moved to [1] in order to remove the
intermediary class and reduce the bundle size.

Diff: https://github.com/socketio/emitter/compare/2.0.0...3.0.0

[1]: https://github.com/socketio/emitter/
2021-10-14 14:09:23 +02:00
Damien Arrachequesne
ea86f413ed chore(release): 4.1.1
DIff: https://github.com/socketio/socket.io-parser/compare/4.1.0...4.1.1
2021-10-14 13:52:49 +02:00
Damien Arrachequesne
eb708d1936 chore: bump @socket.io/component-emitter to version 3.0.0
The typed events have been moved from [1] to [2], in order to remove
the intermediary class and reduce the bundle size.

Diff: https://github.com/socketio/emitter/compare/2.0.0...3.0.0

[1]: https://github.com/socketio/socket.io-client/
[2]: https://github.com/socketio/emitter/
2021-10-14 13:11:55 +02:00
Damien Arrachequesne
cd703fe28e chore(release): 3.0.0
Diff: https://github.com/socketio/emitter/compare/2.0.0...3.0.0
2021-10-14 12:35:03 +02:00
Damien Arrachequesne
84397cb0cd feat: add support for typed events
The StrictEventEmitter class that was defined in the socket.io-client
repository ([1]) is moved here, so we don't need to create an
intermediary class (Socket > StrictEventEmitter > Emitter) to get the
proper types.

As an additional benefit, the final bundle size should be decreased.

BREAKING CHANGE: we now use a named export instead of a default export

```js
// before
import Emitter from "@socket.io/component-emitter"

// after
import { Emitter } from "@socket.io/component-emitter"
```

[1]: a9e5b85580/lib/typed-events.ts
2021-10-14 12:25:39 +02:00
Abd Ul-Hameed Maree
a9e5b85580 feat(typings): add missing types for some emitter methods (#1502)
Co-authored-by: Abd UlHameed Maree <abd.maree@scandinaviatech.com>
2021-10-14 10:58:32 +02:00
Damien Arrachequesne
60edecb3bd feat: serve ESM bundle
Related:

- 0661564dc2
- https://github.com/socketio/socket.io-client/issues/1198
2021-10-13 18:17:12 +02:00
Damien Arrachequesne
0661564dc2 chore: migrate to rollup
This change allows us to:

- reduce the size of the bundle
- provide an ESM bundle (for usage in <script type="module">)

Related: https://github.com/socketio/socket.io-client/issues/1198
2021-10-13 18:09:41 +02:00
Damien Arrachequesne
16b65698ae feat: provide an ESM build with and without debug
See also: 00d7e7d7ee

Related:

- https://github.com/socketio/socket.io-client/issues/1188
- https://github.com/socketio/socket.io-client/issues/1378
2021-10-13 18:09:41 +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
718745305f chore: bump socket.io-parser to version 4.1.0
Diff: https://github.com/socketio/socket.io-parser/compare/4.0.4...4.1.0
2021-10-11 23:19:51 +02:00
Damien Arrachequesne
91fbd47e1e chore: bump engine.io-client to version 6.0.0
Release notes: https://github.com/socketio/engine.io-client/releases/6.0.0
Diff: https://github.com/socketio/engine.io-client/compare/5.2.0...6.0.0
2021-10-11 23:19:51 +02:00
Damien Arrachequesne
5ad3e5cc4b chore(release): 4.1.0
Diff: https://github.com/socketio/socket.io-parser/compare/4.0.4...4.1.0
2021-10-11 22:37:46 +02:00
Damien Arrachequesne
388c616a92 feat: provide an ESM build with and without debug
See also: 00d7e7d7ee
2021-10-11 22:35:12 +02:00
Damien Arrachequesne
fe5d97fc3d chore(release): 6.0.0
Diff: https://github.com/socketio/engine.io/compare/5.2.0...6.0.0
2021-10-08 16:12:32 +02:00
Damien Arrachequesne
401f4b6069 chore: add an ES module wrapper 2021-10-08 15:23:57 +02:00
Damien Arrachequesne
64d5754511 chore: bump ws
Release notes: https://github.com/websockets/ws/releases/tag/8.0.0
2021-10-08 15:05:51 +02:00
Damien Arrachequesne
c0d6eaa1ba chore: migrate to TypeScript
Related: https://github.com/socketio/engine.io/issues/510
2021-10-08 14:55:30 +02:00
roh-kan
4974e9077c docs: update .NET client library link (#4115) 2021-10-08 14:18:03 +02:00
Damien Arrachequesne
965a567ca0 chore(release): 5.0.0
Diff: https://github.com/socketio/engine.io-parser/compare/4.0.3...5.0.0
2021-10-04 11:02:35 +02:00
Damien Arrachequesne
59b4bad558 chore(release): 2.0.0
Diff: https://github.com/socketio/emitter/compare/1.3.0...2.0.0
2021-10-04 08:12:06 +02:00
Damien Arrachequesne
b19524608b chore: update package name 2021-10-04 08:06:06 +02:00
Damien Arrachequesne
2fd2d6bb0e chore: add default export
So that we can use `import Emitter from ...` in both CommonJS and ESM
modules.
2021-10-04 08:04:09 +02:00
Damien Arrachequesne
908fbc4f4c chore: add removeListener typings
Related: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55968
2021-10-04 08:01:23 +02:00
Damien Arrachequesne
e4d9fce4d8 chore: migrate to TypeScript
This change introduces an ESM build which will allow tree shaking. A
CJS build is also provided for backward compatibility.
2021-10-01 10:39:52 +02:00
douira
033c5d399a fix(typings): add name field to cookie option (#4099)
Reference: 18a6eb89fb/lib/server.js (L355)
2021-09-20 09:13:38 +02:00
Damien Arrachequesne
7a74b66872 test: remove hardcoded ports
Related: https://github.com/socketio/socket.io/issues/3447
2021-09-09 08:57:11 +02:00
Damien Arrachequesne
dc81fcf461 fix: send volatile packets with binary attachments
The binary attachments of volatile packets were discarded (only the
header packet was sent) due to a bug introduced by [1].

Related: https://github.com/socketio/socket.io/issues/3919

[1]: dc381b72c6
2021-09-09 08:55:51 +02:00
mingkaili
18a6eb89fb docs: remove the extra bracket in README (#627) 2021-09-09 07:21:04 +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
0a7efc8217 chore(release): 4.2.0
Diff: https://github.com/socketio/socket.io-client/compare/4.1.3...4.2.0
2021-08-30 09:15:30 +02:00
Damien Arrachequesne
f03eeca39a chore: bump dependencies 2021-08-30 08:27:46 +02:00
Damien Arrachequesne
ec3a784fa6 chore: bump dependencies 2021-08-30 08:21:47 +02:00
Damien Arrachequesne
66e00b7dd7 fix(typings): allow async listener in typed events
So that:

```ts
socket.on("my-event", async () => {
  // ...
});
```

is valid under the @typescript-eslint/no-misused-promises rule.

Related: https://github.com/socketio/socket.io-client/issues/1486
2021-08-30 08:21:47 +02:00
Damien Arrachequesne
d8cc8aef7e docs: update the link of the Repl.it badge
The link will now point towards a sample project, instead of the root
repository.

Related: https://github.com/socketio/socket.io/issues/3934
2021-08-30 08:03:55 +02:00
Damien Arrachequesne
ccfd8caba6 fix(typings): allow async listener in typed events
So that:

```ts
socket.on("my-event", async () => {
  // ...
});
```

is valid under the @typescript-eslint/no-misused-promises rule.

Related: https://github.com/socketio/socket.io-client/issues/1486
2021-08-30 08:01:29 +02:00
Tim Düsterhus
24fee27ba3 feat: ignore the query string when serving client JavaScript (#4024)
Related: https://github.com/socketio/socket.io/issues/4023
2021-08-30 07:59:47 +02:00
Michael Vartan
4e1b65699d feat: add an option to use native timer functions (#1479)
This allows to control the behavior of mocked timers (@sinonjs/fake-timers),
depending on the value of the "useNativeTimers" option:

- true: use native setTimeout function
- false (default): use classic timers, that may be mocked

Related: 5d1d5bea11
2021-08-29 09:31:25 +02:00
dependabot[bot]
ebb36f298d chore(deps): bump xmlhttprequest-ssl from 1.5.5 to 2.0.0 (#626)
Bumps [xmlhttprequest-ssl](https://github.com/mjwwit/node-XMLHttpRequest) from 1.5.5 to 2.0.0.
- [Release notes](https://github.com/mjwwit/node-XMLHttpRequest/releases)
- [Commits](https://github.com/mjwwit/node-XMLHttpRequest/compare/1.5.5...2.0.0)

---
updated-dependencies:
- dependency-name: xmlhttprequest-ssl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-29 09:08:48 +02:00
Damien Arrachequesne
313ca50ce8 chore(release): 5.2.0
Diff: https://github.com/socketio/engine.io/compare/5.1.1...5.2.0
2021-08-29 08:32:20 +02:00
Kamil93
b9dc43c3e1 docs: add documentation about heartbeat event (#623) 2021-08-29 08:25:06 +02:00
Damien Arrachequesne
78cd3bc7b9 test: remove duplicate test 2021-08-29 08:05:05 +02:00
Damien Arrachequesne
412bcc4298 chore(release): 4.0.3
Diff: https://github.com/socketio/engine.io-parser/compare/4.0.2...4.0.3
2021-08-29 07:55:13 +02:00
Damien Arrachequesne
6d7dd76130 fix: respect the offset and length of TypedArray objects
The parser now returns the TypedArray object instead of the underlying
array buffer, so its offset and length are now taken in account (which
is the behavior of the classic WebSocket implementation).

Notes:

- this was already the case for the Node.js implementation

- in v3, the TypedArray object was always converted to an array buffer
because a byte was added at the beginning ("message" type)

- we could also have used "data.slice().buffer", but it would have
resulted in the copy of the buffer

Related:

- https://github.com/socketio/engine.io-parser/issues/122
- https://github.com/socketio/engine.io-client/issues/677
2021-08-29 07:54:03 +02:00
dependabot[bot]
6dfab6970c chore: bump path-parse from 1.0.6 to 1.0.7 (#120)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-29 07:53:56 +02:00
anshul singh
f3acddf997 refactor: remove duplicate initilializations (#1489)
The attributes were already initialized, resulting in duplicate lines
in the final bundle.

Related: https://github.com/socketio/socket.io/issues/4063
2021-08-28 09:25:36 +02:00
Damien Arrachequesne
d4ef54cccb chore(release): 2.3.2
Diff: https://github.com/socketio/socket.io-adapter/compare/2.3.1...2.3.2
2021-08-28 08:19:55 +02:00
Damien Arrachequesne
12ee96147e ci: add Node.js 16 in the test matrix 2021-08-28 08:10:50 +02:00
dependabot[bot]
2b4cec08a3 chore(deps): bump glob-parent from 5.1.1 to 5.1.2 (#72)
Bumps [glob-parent](https://github.com/gulpjs/glob-parent) from 5.1.1 to 5.1.2.
- [Release notes](https://github.com/gulpjs/glob-parent/releases)
- [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2)

---
updated-dependencies:
- dependency-name: glob-parent
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-28 08:07:27 +02:00
dependabot[bot]
5fe8cacd6a chore(deps): bump path-parse from 1.0.6 to 1.0.7 (#73)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-28 08:07:11 +02:00
Shrikant Sharat Kandula
912e13ad30 fix: fix race condition when leaving rooms (#74)
This should fix the related issue:

```
TypeError: Cannot read property 'size' of undefined
    at Adapter._del (/app/node_modules/socket.io-adapter/dist/index.js:67:37)
    at Adapter.delAll (/app/node_modules/socket.io-adapter/dist/index.js:83:18)
    at Socket.leaveAll (/app/node_modules/socket.io/dist/socket.js:190:22)
    at Socket._onclose (/app/node_modules/socket.io/dist/socket.js:334:14)
    at Client.onclose (/app/node_modules/socket.io/dist/client.js:245:20)
    at Socket.emit (events.js:412:35)
    at Socket.onClose (/app/node_modules/engine.io/lib/socket.js:348:12)
    at Object.onceWrapper (events.js:519:28)
    at WebSocket.emit (events.js:400:28)
    at WebSocket.onClose (/app/node_modules/engine.io/lib/transport.js:106:10)
```

A test case was added, which reproduces the issue by adding a listener
to the "leave-room" event. This does not seem to be the case for the
user reporting the issue though, which may indicate that the root cause
is elsewhere.
2021-08-28 07:51:31 +02:00
vks-jrobertson
dfb46b55a5 fix: allow to set randomizationFactor to 0 (#1447)
Documentation: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#nullish-coalescing

Related: https://github.com/socketio/socket.io-client/issues/1231
2021-07-29 09:59:03 +02:00
brownman
310f8557a7 docs(examples): add missing module (#4018)
Fixes the following error:

> test/todo-management/todo.tests.ts:275:3 - error TS2582: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`.

Co-authored-by: brownman <brownman@users.noreply.github.com>
2021-07-15 21:48:20 +02:00
dependabot[bot]
75530b4dcd chore: bump browserslist from 4.12.0 to 4.16.6 (#106)
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.12.0 to 4.16.6.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.12.0...4.16.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-13 10:47:42 +02:00
dependabot[bot]
57324f3048 chore: bump elliptic from 6.5.3 to 6.5.4 (#102)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-13 10:47:33 +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
7326bd50df chore(release): 4.1.3
Diff: https://github.com/socketio/socket.io-client/compare/4.1.2...4.1.3
2021-07-10 12:03:09 +02:00
Damien Arrachequesne
94e27cd072 fix: fix io.except() method
Previously, calling `io.except("theroom").emit(...)` did not exclude
the sockets in the given room.

This method was forgotten in [1].

[1]: ac9e8ca6c7
2021-07-10 11:48:46 +02:00
Damien Arrachequesne
cef471bb93 chore: bump dependencies
`engine.io-client` diff: https://github.com/socketio/engine.io-client/compare/5.1.1...5.1.2
2021-07-04 00:53:16 +02:00
Damien Arrachequesne
a4dffc6527 fix: remove x-sourcemap header
This header is useless, as the client bundle already contains a
sourceMappingURL field.

Besides, Firefox prints the following warning:

> <url> is being assigned a //# sourceMappingURL, but already has one

Related: https://github.com/socketio/socket.io/issues/3958
2021-07-04 00:51:41 +02:00
Damien Arrachequesne
7c44893d78 chore: bump dependencies 2021-07-04 00:37:35 +02:00
Daniele TDC
b833f918c8 ci: update to node 16 (#3990)
See also: https://github.com/nodejs/Release#release-schedule
2021-06-28 09:09:44 +02:00
Daniele TDC
24d8d1f67f ci: update setup-node step (#3986) 2021-06-24 14:53:46 +02:00
Damien Arrachequesne
6397c1bdfd chore(release): 0.1.0 2021-06-22 07:06:15 +02:00
Damien Arrachequesne
ff370cfc46 Initial commit 2021-06-22 07:02:16 +02:00
Damien Arrachequesne
6f2a50b932 docs(examples): update example to webpack 5 2021-06-15 22:35:06 +02:00
Damien Arrachequesne
1f8a6c4ecb docs: add link to related packages 2021-06-14 08:21:28 +02:00
Damien Arrachequesne
eb01ff5803 chore(release): 0.1.0 2021-06-14 08:02:20 +02:00
Damien Arrachequesne
f2e3d162ab Initial commit 2021-06-14 07:59:12 +02:00
dependabot[bot]
8b4dcfc04a chore: bump browserslist from 4.12.0 to 4.16.6 (#119)
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.12.0 to 4.16.6.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.12.0...4.16.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-11 15:39:39 +02:00
dependabot[bot]
6ab8af0e07 chore: bump elliptic from 6.5.3 to 6.5.4 (#117)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-11 15:39:27 +02:00
dependabot[bot]
7e9e544a9a chore(deps): bump ws from 7.4.2 to 7.4.6 (#621)
Bumps [ws](https://github.com/websockets/ws) from 7.4.2 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.4.2...7.4.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-30 23:05:15 +02:00
Damien Arrachequesne
0667d826f6 chore(release): 2.3.1
Diff: https://github.com/socketio/socket.io-adapter/compare/2.3.0...2.3.1
2021-05-20 00:47:01 +02:00
Damien Arrachequesne
a33e42bb7b fix: restore compatibility with binary parsers
Related: 5579d40c24
2021-05-20 00:46:19 +02:00
dependabot[bot]
36d0acfd7e chore(deps): bump lodash from 4.17.20 to 4.17.21 (#69)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-20 00:22:52 +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
0cb6ac95b4 fix(typings): ensure compatibility with TypeScript 3.x
Labeled tuple elements were added in TypeScript 4.0.

Reference: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#labeled-tuple-elements

Related: https://github.com/socketio/socket.io/issues/3916
2021-05-17 23:15:22 +02:00
Damien Arrachequesne
a2cf2486c3 fix: ensure compatibility with previous versions of the adapter
Using `socket.io@4.1.0` with `socket.io-adapter@2.2.0` would lead to
the following error:

> Uncaught Error: unknown packet type NaN

Because the packet would be encoded twice, resulting in "undefined".

See also:

- 5579d40c24
- dc381b72c6

Related:

- https://github.com/socketio/socket.io/issues/3922
- https://github.com/socketio/socket.io/issues/3927
2021-05-17 23:14:36 +02:00
Damien Arrachequesne
b466c6f0b1 chore(release): 4.1.2
Diff: https://github.com/socketio/socket.io-client/compare/4.1.1...4.1.2
2021-05-17 23:08:31 +02:00
javiergonzalezGenially
35d27df2ae fix(typings): add missing closeOnBeforeunload option (#1469) 2021-05-17 22:01:39 +02:00
Poyan Nabati
c8dfbb1c1d fix(typings): add missing requestTimeout option (#1467) 2021-05-17 00:39:29 +02:00
Damien Arrachequesne
733ad4dc4e chore(release): 5.1.1
Diff: https://github.com/socketio/engine.io/compare/5.1.0...5.1.1
2021-05-17 00:29:34 +02:00
Damien Arrachequesne
43606865e5 fix: properly close the websocket connection upon handshake error
This should fix the following error:

> TypeError: Cannot read property 'writeHead' of undefined

This bug was introduced by [1], because the `if (res !== undefined) { ... }`
check was removed.

But `res` is indeed undefined when the client connects with WebSocket
directly, in that case we need to manually write the response content
(in the abortUpgrade method).

Please note that the previous behavior was invalid too, since the
WebSocket connection was left open when an error occurred during the
handshake.

[1]: 7096e98a02
2021-05-17 00:22:39 +02:00
dependabot[bot]
29bd4fe800 chore(deps): bump lodash from 4.17.20 to 4.17.21 (#619)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 00:21:34 +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
891b1870e9 fix(typings): properly type the adapter attribute
Related: https://github.com/socketio/socket.io/issues/3796
2021-05-11 23:59:44 +02:00
Damien Arrachequesne
b84ed1e41c fix(typings): properly type server-side events
See also: 93cce05fb3
2021-05-11 23:59:18 +02:00
Damien Arrachequesne
7d6a71c91d chore(release): 4.1.1
Diff: https://github.com/socketio/socket.io-client/compare/4.1.0...4.1.1
2021-05-11 23:54:24 +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
411499ebcf chore(release): 4.1.0
Diff: https://github.com/socketio/socket.io-client/compare/4.0.2...4.1.0
2021-05-11 09:16:28 +02:00
Damien Arrachequesne
70220b5333 chore: bump engine.io-client dependency
Diff: https://github.com/socketio/engine.io-client/compare/5.0.1...5.1.0
2021-05-11 09:12:12 +02:00
Damien Arrachequesne
95d9e4a42f test: fix randomly failing test 2021-05-11 00:06:03 +02:00
Damien Arrachequesne
499c89250d feat: notify upon namespace creation
A "new_namespace" event will be emitted when a new namespace is created:

```js
io.on("new_namespace", (namespace) => {
  // ...
});
```

This could be used for example for registering the same middleware for
each namespace.

See https://github.com/socketio/socket.io/issues/3851
2021-05-11 00:09:18 +02:00
Damien Arrachequesne
93cce05fb3 feat: add support for inter-server communication
Syntax:

```js
// server A
io.serverSideEmit("hello", "world");

// server B
io.on("hello", (arg) => {
  console.log(arg); // prints "world"
});
```

With acknowledgements:

```js
// server A
io.serverSideEmit("hello", "world", (err, responses) => {
  console.log(responses); // prints ["hi"]
});

// server B
io.on("hello", (arg, callback) => {
  callback("hi");
});
```

This feature replaces the customHook/customRequest API from the Redis
adapter: https://github.com/socketio/socket.io-redis/issues/370
2021-05-11 00:07:20 +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
03bda43550 chore(release): 2.3.0
Diff: https://github.com/socketio/socket.io-adapter/compare/2.2.0...2.3.0
2021-05-10 10:36:22 +02:00
Damien Arrachequesne
c4cbd4ba2d feat: add a serverSideEmit empty function
This function will be overriden in the Redis adapter, for inter-server
communication.
2021-05-10 10:35:42 +02:00
Damien Arrachequesne
5579d40c24 feat: add support for the "wsPreEncoded" writing option
A few notes:

- only the first element is pre-encoded, because the other elements are
buffers and will be sent as is over the WebSocket connection

- using `socket.packet()` was unexpectedly working, we will now use
`socket.client.writeToEngine()` (see [1])

See also: 7706b123df

[1]: https://github.com/socketio/socket.io/issues/3775
2021-05-10 10:09:54 +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
b81ce4c9d0 fix(typings): make "engine" attribute public 2021-05-06 14:36:25 +02:00
Damien Arrachequesne
d65b6ee84c fix: properly export the Socket class
Before this change, `require("socket.io").Socket` would return
"undefined".

Note: having access to the Socket class allows users to modify its
prototype.

Related: https://github.com/socketio/socket.io/issues/3726
2021-05-06 14:36:12 +02:00
Damien Arrachequesne
6279065209 chore(release): 4.0.2
Diff: https://github.com/socketio/socket.io-client/compare/4.0.1...4.0.2
2021-05-06 14:31:00 +02:00
Damien Arrachequesne
5394669488 fix(typings): add fallback to untyped event listener
See also: a11152f42b

Related:

- https://github.com/socketio/socket.io/issues/3885
- https://github.com/socketio/socket.io/issues/3872
- https://github.com/socketio/socket.io/issues/3833
2021-05-06 14:24:48 +02:00
Damien Arrachequesne
e20d487ac0 fix: properly export the Socket class
Before this change, `require("socket.io-client").Socket` would return
"undefined".

Note: having access to the Socket class allows users to modify its
prototype.

Related: https://github.com/socketio/socket.io/issues/3726
2021-05-06 14:24:08 +02:00
Damien Arrachequesne
34f822f783 fix: ensure buffered events are sent in order
Before this commit, an event sent in the "connect" handler could be
sent before the events that were buffered while disconnected.

```js
socket.on("connect", () => {
  socket.emit("bar");
});

socket.emit("foo"); // buffered while disconnected
```

In the example above, the "bar" event was sent first, which is not
correct.

Related: https://github.com/socketio/socket.io-client/issues/1458
2021-05-06 14:23:25 +02:00
Damien Arrachequesne
dd2a8fce00 fix: ensure connections are properly multiplexed
When passing the same `options` argument for two distinct Socket
instances, a new Manager was created:

```js
const opts = {};

const socket1 = io("/foo", opts);
const socket2 = io("/bar", opts);

console.log(socket1.io === socket2.io); // false
```

This bug was introduced by [1].

Note: the `options` argument is modified at the `socket.io-client`
level (path, query) and at the `engine.io-client` level (host, port),
which may not be optimal.

[1]: 7a0c2b504f

Related: https://github.com/socketio/socket.io/issues/3898
2021-05-06 14:22:54 +02:00
Damien Arrachequesne
39c138a1b5 docs: clarify the upgrade mechanism
Related: https://github.com/socketio/engine.io-protocol/issues/37
2021-05-06 00:16:42 +02:00
Damien Arrachequesne
8c9bd9262f chore(release): 5.1.0
Diff: https://github.com/socketio/engine.io/compare/5.0.0...5.1.0
2021-05-04 10:31:23 +02:00
Damien Arrachequesne
7706b123df perf: add a "wsPreEncoded" writing option
This option will be used when broadcasting a packet to multiple clients,
in order to only encode the packet once.

Usage:

```js
socket.write("test", {
  wsPreEncoded: "4test"
});
```

Note: pre-encoding the content with HTTP long-polling is a bit harder,
since the concatenation of the packets is specific to each client.
2021-05-04 08:44:06 +02:00
Branislav Katreniak
ad5306aeae perf(websocket): fix write back-pressure (#618)
This change should reduce memory usage when many packets are emitted to
many clients in a burst.

Co-authored-by: Branislav Katreniak <bkatreniak@slido.com>
2021-05-04 08:35:23 +02:00
Damien Arrachequesne
4c0aa73e06 refactor: remove "self" references 2021-04-30 14:38:31 +02:00
Damien Arrachequesne
252754353a feat: add the "initial_headers" and "headers" events
Those events will be emitted before the response headers are written to
the socket:

- "initial_headers": on the first request of the connection
- "headers": on all requests (HTTP long-polling and WebSocket upgrade)

Syntax:

```js

server.on("initial_headers", (headers, req) => {
  headers["test"] = "123";
  headers["set-cookie"] = "mycookie=456";
});

server.on("headers", (headers, req) => {
  headers["test"] = "789";
});
```

Related:

- https://github.com/socketio/engine.io/issues/557
- https://github.com/socketio/socket.io/issues/3630
2021-04-30 14:38:11 +02:00
Damien Arrachequesne
7096e98a02 feat: add a "connection_error" event
The "connection_error" event will be emitted when one of the following
errors occurs:

- Transport unknown
- Session ID unknown
- Bad handshake method
- Bad request
- Forbidden
- Unsupported protocol version

Syntax:

```js
server.on("connection_error", (err) => {
  console.log(err.req);		// the request object
  console.log(err.code);	// the error code, for example 1
  console.log(err.message);	// the error message, for example "Session ID unknown"
  console.log(err.context);     // some additional error context
});
```

Related:

- https://github.com/socketio/socket.io/issues/3819
- https://github.com/socketio/engine.io/issues/576
2021-04-30 13:04:28 +02:00
Damien Arrachequesne
3665aada47 docs(examples): basic CRUD application
See also: https://socket.io/get-started/basic-crud-application/
2021-04-23 00:08:18 +02:00
YuLe
7e81e66b2f docs: update README links (#1459) 2021-04-07 10:01:43 +02:00
dependabot[bot]
129094f7a5 chore: bump y18n from 4.0.0 to 4.0.1 (#118)
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-01 10:41:25 +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
2edf0f308c chore(release): 4.0.1
Diff: https://github.com/socketio/socket.io-client/compare/4.0.0...4.0.1
2021-04-01 01:07:04 +02:00
Damien Arrachequesne
86f28c3204 chore: bump engine.io-client version
Diff: https://github.com/socketio/engine.io-client/compare/5.0.0...5.0.1
2021-04-01 01:02:25 +02:00
divlo
c15022347c fix(typings): make auth property public (#1455)
Related: https://github.com/socketio/socket.io-client/issues/1453
2021-04-01 00:32:21 +02:00
alex.zeng
48f573f6f6 fix(typings): update definition to match wrapper.mjs (#1456) 2021-04-01 00:31:43 +02:00
Maxime Kjaer
a11152f42b fix(typings): add fallback to untyped event listener (#3834)
Related: https://github.com/socketio/socket.io/issues/3833
2021-03-31 11:37:37 +02:00
Maxime Kjaer
259f29720b docs(examples): remove unnecessary type annotations (#3855)
Typed events in Socket.IO 4.0 remove the need for writing type
annotations in callbacks of reserved events.
2021-03-24 23:12:22 +01:00
Damien Arrachequesne
b4ae8d2e19 docs(examples): update all examples to Socket.IO v4 2021-03-18 15:07:04 +01:00
Adán Toscano
64be1c9985 docs(examples): fix chat example (#3787) 2021-03-18 14:06:13 +01:00
Solomon English
1a72ae4fe2 fix(typings): update return type from emit (#3843)
```
(channel ? io.to(channel) : io).emit("stuff", message);
```

would no longer compile.

Related: https://github.com/socketio/socket.io/issues/3844
2021-03-18 11:36:34 +01: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
d28cde7afc chore(release): 4.0.0
The major bump is due to some breaking changes on the server side.

Diff: https://github.com/socketio/socket.io-client/compare/3.1.2...4.0.0
2021-03-10 12:25:27 +01:00
Damien Arrachequesne
43613d1b2c fix(bundle): restore support for JS modules
This change is needed so the bundle can be used with:

```
<script type="module" src="xxxx/socket.io.js"></script>
```

Related:

- https://github.com/socketio/socket.io/discussions/3828
- 13b32b39a4
- 8c08c5d5c3
2021-03-10 12:17:52 +01:00
KC Erb
6abfa1fa4c feat: add autoUnref option
With autoUnref set to true (default: false), the Socket.IO client will
allow the program to exit if there is no other active timer/socket in
the event system.

```js
const socket = io({
  autoUnref: true
});
```

Note: this option only applies to Node.js clients.

Related: https://github.com/socketio/socket.io-client/issues/1446
2021-03-10 12:16:12 +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
Damien Arrachequesne
887ba06536 chore(release): 5.0.0
Diff: https://github.com/socketio/engine.io/compare/4.1.1...5.0.0
2021-03-10 10:20:02 +01:00
Damien Arrachequesne
59023657a0 feat: add support for typed events
Syntax:

```ts
interface ServerToClientEvents {
  "my-event": (a: number, b: string, c: number[]) => void;
}

interface ClientToServerEvents {
  hello: (message: string) => void;
}

const socket: Socket<ServerToClientEvents, ClientToServerEvents> = io();

socket.emit("hello", "world");

socket.on("my-event", (a, b, c) => {
  // ...
});
```

The events are not typed by default (inferred as any), so this change
is backward compatible.

Related: https://github.com/socketio/socket.io/issues/3742
2021-03-10 01:24:56 +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
Damien Arrachequesne
edb734316f feat: remove dynamic require() with wsEngine
This change is necessary to get rid of:

> Critical dependency: the request of a dependency is an expression

when bundling the server with webpack.

BREAKING CHANGE: the syntax of the "wsEngine" option is updated

Before:

```js
const eioServer = require("engine.io")(httpServer, {
  wsEngine: "eiows"
});
```

After:

```js
const eioServer = require("engine.io")(httpServer, {
  wsEngine: require("eiows").Server
});
```

Related: https://github.com/socketio/engine.io/issues/609
2021-03-09 08:30:05 +01:00
Simone Mazzoni
868d89111d fix: set default protocol version to 3 (#616)
socket.io-client-swift libs version <=15.2.0, which uses protocol
version 3, do not explicitly add the EIO query parameter at transport
initialization. This omission leads the server to treat the client as
a client that supports the protocol version 4, previously set as
default, which is not correct for those versions of the client lib.

From socket.io-client-swift version v16.0.0 the EIO query parameter is
explicitly passed to specify the protocol version supported, but since
the allowEIO3 parameter aims to make the server compatible with
previous versions which in most of the cases are already used in
production and not easily upgradable, it makes more sense to default
the EIO version to 3 if not explicitly set by the client since the
newer client versions pass the EIO protocol version in query
parameters.

Related: https://github.com/socketio/socket.io/issues/3794
2021-03-09 08:23:36 +01:00
Bastian Kersting
063136b91d docs: fix typo (#36) 2021-03-02 12:40:47 +01:00
Damien Arrachequesne
b25495c069 feat: add some utility methods
This commit adds the following methods:

- fetchSockets: returns the matching socket instances

Syntax:

```js
// return all Socket instances
const sockets = await io.fetchSockets();

// return all Socket instances of the "admin" namespace in the "room1" room
const sockets = await io.of("/admin").in("room1").fetchSockets();
```

- socketsJoin: makes the matching socket instances join the specified rooms

Syntax:

```js
// make all Socket instances join the "room1" room
io.socketsJoin("room1");

// make all Socket instances of the "admin" namespace in the "room1" room join the "room2" room
io.of("/admin").in("room1").socketsJoin("room2");
```

- socketsLeave: makes the matching socket instances leave the specified rooms

Syntax:

```js
// make all Socket instances leave the "room1" room
io.socketsLeave("room1");

// make all Socket instances of the "admin" namespace in the "room1" room leave the "room2" room
io.of("/admin").in("room1").socketsLeave("room2");
```

- disconnectSockets: makes the matching socket instances disconnect

Syntax:

```js
// make all Socket instances disconnect
io.disconnectSockets();

// make all Socket instances of the "admin" namespace in the "room1" room disconnect
io.of("/admin").in("room1").disconnectSockets();
```

Those methods share the same semantics as broadcasting. They will also
work with multiple Socket.IO servers when using the Redis adapter. In
that case, the fetchSockets() method will return a list of RemoteSocket
instances, which expose a subset of the methods and attributes of the
Socket class (the "request" attribute cannot be mocked, for example).

Related:

- https://github.com/socketio/socket.io/issues/3042
- https://github.com/socketio/socket.io/issues/3418
- https://github.com/socketio/socket.io/issues/3570
- https://github.com/socketio/socket.io-redis/issues/283
2021-03-02 11:17:21 +01:00
Damien Arrachequesne
5a7fa132c4 feat: increase the default value of pingTimeout
This value was updated from 60000 to 5000 in [1], included in
`engine.io@3.2.0` (Feb 2018).

The reasoning back then:

Some users experienced long delays between disconnection on the
server-side and on the client-side. The "disconnect" event would take a
long time to fire in the browser, probably due to a timer being
delayed. Hence the change.

That being said, the current value (5s) now causes unexpected
disconnections when a big payload is sent over a slow network, because
it prevents the ping-pong packets from being exchanged between the
client and the server. This can also happen when a synchronous task
blocks the server for more than 5 seconds.

The new value (20s) thus seems like a good balance between quick
disconnection detection and tolerance to various delays.

Note: pingInterval + pingTimeout is still below the threshold of React
Native, which complains if a timer is set with a delay of more than 1
minute.

[1]: 65b1ad1b8a

Related:

- https://github.com/socketio/socket.io/issues/2770
- https://github.com/socketio/socket.io/issues/2769
- https://github.com/socketio/socket.io/issues/3054
- https://github.com/socketio/socket.io/issues/3376
2021-03-02 08:49:58 +01:00
Damien Arrachequesne
085d1de9df feat: allow to pass an array to io.to(...)
In some cases it is necessary to pass an array of rooms instead of a single room.

New syntax:

```
io.to(["room1", "room2"]).except(["room3"]).emit(...);

socket.to(["room1", "room2"]).except(["room3"]).emit(...);
```

Related: https://github.com/socketio/socket.io/issues/3048
2021-03-01 23:20:46 +01:00
Damien Arrachequesne
ac9e8ca6c7 fix: make io.to(...) immutable
Previously, broadcasting to a given room (by calling `io.to()`) would
mutate the io instance, which could lead to surprising behaviors, like:

```js
io.to("room1");
io.to("room2").emit(...); // also sent to room1

// or with async/await
io.to("room3").emit("details", await fetchDetails()); // random behavior: maybe in room3, maybe to all clients
```

Calling `io.to()` (or any other broadcast modifier) will now return an
immutable instance.

Related:

- https://github.com/socketio/socket.io/issues/3431
- https://github.com/socketio/socket.io/issues/3444
2021-03-01 23:17:08 +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
c679e62236 chore(release): 2.2.0
Diff: https://github.com/socketio/socket.io-adapter/compare/2.1.0...2.2.0
2021-02-27 02:08:54 +01:00
Damien Arrachequesne
1c9827ec11 feat: add some utility methods
This commit adds the following methods:

- fetchSockets: return the matching socket instances
- addSockets: make the matching socket instances join the specified rooms
- delSockets: make the matching socket instances leave the specified rooms
- disconnectSockets: disconnect the matching socket instances

Those methods will then be exposed by the Socket.IO server:

```js
// clear room
io.socketsLeave("room1");

// disconnect all sockets in room
io.in("room2").disconnectSockets();

// fetch socket instances in room
io.in("room3").fetchSockets();
```

This feature will also be extended in the Redis adapter to handle
multiple Socket.IO servers.
2021-02-27 01:37:53 +01:00
Sebastiaan Marynissen
985bb41fa2 feat: allow excluding all sockets in a room (#66) 2021-02-26 15:32:45 +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
78ec5a6e43 chore(release): 3.1.2
Diff: https://github.com/socketio/socket.io-client/compare/3.1.1...3.1.2
2021-02-26 01:10:30 +01:00
Damien Arrachequesne
83a65be78a chore: bump engine.io-client version
Diff: https://github.com/socketio/engine.io-client/compare/4.1.0...4.1.2
2021-02-26 01:08:39 +01:00
Damien Arrachequesne
494c64e44f fix: ignore packet received after disconnection
Related: https://github.com/socketio/socket.io/issues/3095
2021-02-26 00:58:30 +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
13b32b39a4 fix: restore support for web workers
A previous change ([1], included in 3.0.5) broke support for web
workers, which threw "window is not defined" when importing the bundle
in a web worker.

Related: https://github.com/socketio/socket.io/issues/3809

Reference: https://webpack.js.org/configuration/output/#outputglobalobject

[1]: 8c08c5d5c3
2021-02-26 00:43:26 +01:00
Damien Arrachequesne
7467216e02 docs(examples): 4th and final part of the "private messaging" example
See also: https://socket.io/get-started/private-messaging-part-4/
2021-02-17 00:24:23 +01:00
Damien Arrachequesne
7247b4051f docs(examples): 3rd part of the "private messaging" example
See also: https://socket.io/get-started/private-messaging-part-3/
2021-02-17 00:22:55 +01:00
Damien Arrachequesne
992c9380c3 docs(examples): 2nd part of the "private messaging" example
See also: https://socket.io/get-started/private-messaging-part-2/
2021-02-15 01:09:12 +01:00
Damien Arrachequesne
8b404f424b docs(examples): 1st part of the "private messaging" example 2021-02-10 00:33:39 +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
6f4bd7f8e7 fix: properly parse the CONNECT packet in v2 compatibility mode
In Socket.IO v2, the Socket query option was appended to the namespace
in the CONNECT packet:

{
  type: 0,
  nsp: "/my-namespace?abc=123"
}

Note: the "query" option on the client-side (v2) will be found in the
"auth" attribute on the server-side:

```
// client-side
const socket = io("/nsp1", {
  query: {
    abc: 123
  }
});
socket.query = { abc: 456 };

// server-side
const io = require("socket.io")(httpServer, {
  allowEIO3: true // enable compatibility mode
});

io.of("/nsp1").on("connection", (socket) => {
  console.log(socket.handshake.auth); // { abc: 456 } (the Socket query)
  console.log(socket.handshake.query.abc); // 123 (the Manager query)
});

More information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/#Add-a-clear-distinction-between-the-Manager-query-option-and-the-Socket-query-option

Related: https://github.com/socketio/socket.io/issues/3791
2021-02-03 22:54:07 +01:00
Damien Arrachequesne
4f2e9a716d fix(typings): update the types of "query", "auth" and "headers"
Related: https://github.com/socketio/socket.io/issues/3770
2021-02-03 22:53:38 +01:00
Damien Arrachequesne
311c5d14c3 chore(release): 3.1.1
Diff: https://github.com/socketio/socket.io-client/compare/3.1.0...3.1.1
2021-02-03 22:36:17 +01:00
Damien Arrachequesne
7a0c2b504f fix: include the path in the manager ID
Previously, the following code:

```js
const socket1 = io({
  path: "/test1"
});
const socket2 = io({
  path: "/test2"
});
```

would result in one single Manager, with the "/test2" path being
silently ignored.

Two distinct Manager instances will now be created.

Related: https://github.com/socketio/socket.io-client/issues/1225
2021-02-03 22:31:01 +01:00
Damien Arrachequesne
61afc5d8cb fix: remove polyfill for process in the bundle
A polyfill for Node.js "process" was included in the final bundle.

Reference: https://webpack.js.org/configuration/node/
2021-02-02 12:08:26 +01:00
david-fong
9e8f288ca9 fix(typings): add return types and general-case overload signatures (#3776)
See also: https://stackoverflow.com/questions/52760509/typescript-returntype-of-overloaded-function/52760599#52760599
2021-02-02 11:50:08 +01:00
david-fong
47f917afdd fix(typings): add return types and general-case overload signatures (#1440) 2021-02-02 11:29:08 +01:00
Mick Lawitzke
f02ab3bc96 fix(typings): fix the type of the "query" option (#1439)
Having type `Object` it was not possible to set values, e.g.:

```ts
if (!this.socket.io.opts.query) {
  this.socket.io.opts.query = {};
}
this.socket.io.opts.query.token = 'abc123';
```

Results in error:

> Element implicitly has an 'any' type because expression of type '"token"' can't be used to index type 'Object'.
2021-02-02 11:26:33 +01:00
Damien Arrachequesne
9534355b89 chore(release): 4.1.1
Diff: https://github.com/socketio/engine.io/compare/4.1.0...4.1.1
2021-02-02 10:51:04 +01:00
Damien Arrachequesne
ae840fa8ed chore: point towards the master branch for the CI badge
Reference: https://docs.github.com/en/actions/managing-workflow-runs/adding-a-workflow-status-badge#using-the-branch-parameter
2021-02-02 10:49:24 +01:00
Damien Arrachequesne
ff2b8aba48 fix: do not reset the ping timer after upgrade
There was two issues with this behavior:

- v3 clients (with allowEIO3: true) were also receiving a "ping" after
a successful upgrade, which is incorrect (in v3, it's the client that
sends the "ping", and the server answers with a "pong")

- the ping timer is not reset after upgrade on the client-side, so an
upgrade which took longer than the `pingTimeout` duration could lead to
a "ping timeout" error on the client-side

I think the latter issue is present since the initial implementation.

Related: https://github.com/socketio/socket.io-client-swift/pull/1309#issuecomment-768475704
2021-02-02 10:48:02 +01:00
Damien Arrachequesne
86eb4227b2 docs(examples): add example with traefik
Reference: https://doc.traefik.io/traefik/v2.0/
2021-01-31 23:47:23 +01:00
Damien Arrachequesne
be81a2ce6f chore: point towards the master branch for the CI badge 2021-01-28 14:17:28 +01:00
Damien Arrachequesne
0a63a17f63 refactor: remove unused line
In Socket.IO v2, the Socket `query` option was sent when connecting to
a custom namespace (but not for the main namespace).

This was fixed in Socket.IO v3 ([1]), so this line is now useless.

[1]: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/#Add-a-clear-distinction-between-the-Manager-query-option-and-the-Socket-query-option
2021-01-28 12:27:02 +01:00
Damien Arrachequesne
cf873fd831 docs(examples): update cluster examples to Socket.IO v3 2021-01-28 11:21:38 +01:00
Damien Arrachequesne
0d10e6131b docs(examples): update the nginx cluster example
Related: https://github.com/socketio/socket.io/discussions/3778

Reference: http://nginx.org/en/docs/http/ngx_http_upstream_module.html#hash
2021-01-28 10:52:26 +01:00
JPSO
10aafbbc16 ci: add Node.js 15 (#3765) 2021-01-20 22:34:51 +01:00
Hamdi Bayhan
f34cfca26d docs: fix broken link (#3759) 2021-01-17 22:10:37 +01:00
PrashoonB
d412e876b8 docs: add installation with yarn (#3757) 2021-01-15 22:20:04 +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
5529f34aaf chore(release): 3.1.0
Diff: https://github.com/socketio/socket.io-client/compare/3.0.5...3.1.0
2021-01-15 02:15:57 +01:00
Damien Arrachequesne
5d9b4eb42b chore: bump socket.io-parser version
Diff: https://github.com/socketio/socket.io-parser/compare/4.0.3...4.0.4
2021-01-15 01:59:56 +01:00
Damien Arrachequesne
13e16b9b79 chore: bump engine.io-client version
Diff: https://github.com/socketio/engine.io-client/compare/4.0.6...4.1.0
2021-01-15 01:56:01 +01:00
Damien Arrachequesne
af1b23ca85 chore(release): 4.0.4
Diff: https://github.com/socketio/socket.io-parser/compare/4.0.3...4.0.4
2021-01-15 01:45:17 +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
1c220ddbf4 fix: allow integers as event names
This commit restores the possibility to use integers as event names,
which was possible in Socket.IO v2.
2021-01-15 01:38:03 +01:00
Damien Arrachequesne
c95ab42aef chore(release): 2.1.0
Diff: https://github.com/socketio/socket.io-adapter/compare/2.0.3...2.1.0
2021-01-15 01:30:02 +01:00
Damien Arrachequesne
155fa6333a feat: add room events
The adapter will now emit the following events:

- create-room (arg: room)
- delete-room (arg: room)
- join-room (args: room, sid)
- leave-room (args: room, sid)

Related: https://github.com/socketio/socket.io/issues/2897
2021-01-15 01:22:49 +01:00
Jakob Ackermann
161091dd4c feat: confirm a weak but matching ETag (#3485)
When handling compression at the proxy server level, the client receives a weak ETag.
Weak ETags are prefixed with `W/`, e.g. `W/"2.2.0"`.
Upon cache validation we should take care of these too.

Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag
2021-01-15 01:04:55 +01:00
汪心禾 Wang, Xinhe
d52532b7be docs: add other client implementations (#3593)
Reference: https://socket.io/docs/#Other-client-implementations
2021-01-15 00:37:40 +01:00
Sergio Lenza
6b1d7901db docs(examples): Improve the chat example with more ES6 features (#3240) 2021-01-15 00:36:17 +01:00
EloniX-X
b55892ae80 docs: add run on repl.it badge to README (#3617) 2021-01-15 00:30:17 +01:00
Pablo Tejada
233650c222 feat(esm): export the Namespace and Socket class (#3699) 2021-01-15 00:28:20 +01:00
Damien Arrachequesne
313c5a9fb6 feat: make rooms and sids public
Related: https://github.com/socketio/socket.io-adapter/issues/63
2021-01-14 23:56:30 +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
e5b307c16d chore(release): 4.1.0
Diff: https://github.com/socketio/engine.io/compare/4.0.6...4.1.0
2021-01-14 01:47:14 +01:00
Damien Arrachequesne
663d326d18 feat: add support for v3.x clients
In order to ease the migration to Socket.IO v3, the Engine.IO server
can now communicate with v3.x clients.

```js
const eioServer = require("engine.io")(httpServer, {
  allowEIO3: true // false by default
});
```

If `allowEIO3` is false, the v3.x clients will now receive an HTTP 400
response ("Unsupported protocol version").

Note: the code of the v3 parser has been imported from [1] and
browser-related dependencies were removed.

[1]: https://github.com/socketio/engine.io-parser/tree/2.2.1

Related:

- https://github.com/socketio/engine.io-protocol/issues/35
- https://github.com/socketio/socket.io-protocol/issues/21
2021-01-14 01:44:52 +01:00
Mick Lawitzke
fe97243fab fix(typings): make Manager#opts public (#1437)
As stated in the [documentation][1], the query option can be set by
setting `socket.io.opts` but `opts` was private and readonly.

[1]: https://socket.io/docs/v3/client-api/#With-query-option
2021-01-11 22:47:28 +01:00
Damien Arrachequesne
4922e397f4 docs: points towards the website
The website is now much more stable, so there's no need to keep two
copies of the same content (which must be manually kept in sync).
2021-01-08 15:13:43 +01:00
Rohan Chougule
de8dffd252 refactor: strict type check in if expressions (#3744) 2021-01-08 14:58:37 +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
bcdd3bef85 chore(release): 3.0.5
Diff: https://github.com/socketio/socket.io-client/compare/3.0.4...3.0.5
2021-01-05 12:02:52 +01:00
Damien Arrachequesne
752dfe3b1e chore: bump debug version 2021-01-05 11:53:27 +01:00
Damien Arrachequesne
bf54327421 revert: restore the socket middleware functionality
This functionality was removed in [1] (included in 3.0.0), but
catch-all listeners and socket middleware features are complementary
rather than mutually exclusive.

The only difference with the previous implementation is that passing an
error to the `next` handler will create an error on the server-side,
and not on the client-side anymore.

```js
io.on("connection", (socket) => {

  socket.use(([ event, ...args ], next) => {
    next(new Error("stop"));
  });

  socket.on("error", (err) => {
    // to restore the previous behavior
    socket.emit("error", err);

    // or close the connection, depending on your use case
    socket.disconnect(true);
  });
});
```

This creates additional possibilities about custom error handlers, which
may be implemented in the future.

```js
// user-defined error handler
socket.use((err, [ event ], next) => {
  // either handle it
  socket.disconnect();

  // or forward the error to the default error handler
  next(err);
});

// default error handler
socket.use((err, _, next) => {
  socket.emit("error", err);
});
```

Related: https://github.com/socketio/socket.io/issues/3678

[1]: 5c73733985
2021-01-05 11:51:50 +01:00
Damien Arrachequesne
170b739f14 fix: properly clear timeout on connection failure
Related: https://github.com/socketio/socket.io/issues/3720
2021-01-05 11:51:08 +01:00
Damien Arrachequesne
cf9fc35836 chore: bump debug version 2021-01-05 11:46:06 +01:00
Damien Arrachequesne
53c73749a8 fix: emit a connect_error event upon connection failure
Related: https://github.com/socketio/socket.io/issues/3734
2021-01-05 11:42:54 +01:00
Damien Arrachequesne
444520d6cd chore(release): 4.0.3
Diff: https://github.com/socketio/socket.io-parser/compare/4.0.2...4.0.3
2021-01-05 11:26:13 +01:00
Damien Arrachequesne
b076dbb722 ci: migrate to GitHub Actions
Due to the recent changes to the Travis CI platform (see [1]), we will
now use GitHub Actions to run the tests.

Reference: https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-nodejs

[1]: https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing
2021-01-05 11:24:49 +01:00
Damien Arrachequesne
7c380d38eb chore: bump debug version 2021-01-05 11:00:39 +01:00
Damien Arrachequesne
b83f89c901 fix(typings): make sendBuffer and receiveBuffer public
See also: https://socket.io/docs/v3/client-offline-behavior/#Buffered-events
2021-01-05 10:17:58 +01:00
Damien Arrachequesne
8c08c5d5c3 refactor: remove global polyfill from webpack config
Fixes https://github.com/socketio/socket.io-client/issues/1407
2021-01-05 10:15:27 +01:00
Damien Arrachequesne
9b621523ef chore(release): 4.0.6
Diff: https://github.com/socketio/engine.io/compare/4.0.5...4.0.6
2021-01-04 23:27:25 +01:00
Damien Arrachequesne
5a91253f21 chore: bump ws and debug versions 2021-01-04 23:03:49 +01:00
Stijn de Witt
230cd19164 chore: bump dependencies 2021-01-04 10:28:17 +01:00
Damien Arrachequesne
a0a3481c64 test: fix random test failure 2021-01-04 10:27:57 +01:00
Nika Jones
65b657428a docs: fix the protocol CONNECT character (#22)
The correct connect character is `0` (zero) and not `O` (the capital
letter 'o').
2021-01-02 23:27:34 +01:00
Dante Calderón
4111013bc7 refactor: validate socket id before loop in addAll (#64) 2021-01-02 23:24:15 +01:00
Damien Arrachequesne
788d95ad1c ci: init GitHub actions
Reference: https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-nodejs
2021-01-02 23:23:01 +01:00
Damien Arrachequesne
2874d5f972 chore: update GitHub issue templates 2020-12-30 11:45:17 +01:00
Damien Arrachequesne
f773b4889c chore: update GitHub issue templates 2020-12-30 11:34:30 +01:00
Damien Arrachequesne
fffa0a3fb7 chore: update GitHub issue templates 2020-12-30 10:28:34 +01:00
Marko Žarković
cec27502f5 fix: correctly pass the options when using the Server constructor (#610)
Fixes https://github.com/socketio/engine.io/issues/580
2020-12-30 10:04:47 +01:00
Damien Arrachequesne
04ea3585e8 docs(changelog): include changelog for release 3.5.0
Merged from the 3.5.x branch.
2020-12-30 10:01:18 +01:00
Damien Arrachequesne
292d62ea69 docs(examples): update TypeScript example
Includes b3de861a92
2020-12-30 09:45:22 +01:00
Damien Arrachequesne
178e899f48 docs(examples): add Angular TodoMVC + Socket.IO example 2020-12-17 12:42:23 +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
david-fong
7bc7a7b624 refactor: switch to native javascript bind (#1423)
The polyfill for the bind() method was necessary for IE6/7/8, which we
do not support anymore.

Related: https://caniuse.com/mdn-javascript_builtins_function_bind
2020-12-11 11:55:57 +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
Damien Arrachequesne
085cd6c56d chore(release): 3.0.4
Diff: https://github.com/socketio/socket.io-client/compare/3.0.3...3.0.4
2020-12-07 11:43:11 +01:00
Damien Arrachequesne
1fba399b17 ci: migrate to GitHub Actions
Due to the recent changes to the Travis CI platform (see [1]), we will
now use GitHub Actions to run the tests.

Reference: https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-nodejs

[1]: https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing
2020-12-07 11:37:03 +01:00
Damien Arrachequesne
e7115b88bb chore(release): 4.0.5
Diff: https://github.com/socketio/engine.io/compare/4.0.4...4.0.5
2020-12-07 11:26:35 +01:00
Damien Arrachequesne
f8f60fc860 fix: keep track of active sockets
When a given socket was disconnected, either by the server-side or by the client-side, the manager was closed too, regardless of the other connected sockets.

```js
const socket1 = io({
  autoConnect: false
});
const socket2 = io("/test");

socket1.disconnect(); // also disconnect socket2
```

This bug was introduced in [1].

[1]: b60e909039
2020-12-07 11:24:15 +01:00
Damien Arrachequesne
ec1f8c3474 fix: emit an error when reaching a v2.x server
A WebSocket-only v3.x client is able to reach a v2.x server, as the
Engine.IO handshake are compatible, but the v2.x server does not send
a sid in the Socket.IO handshake, which resulted in:

> Uncaught TypeError: Cannot read property 'sid' of undefined

A 'connect_error' event will now be emitted.

References:

- https://github.com/socketio/engine.io-protocol#difference-between-v3-and-v4
- https://github.com/socketio/socket.io-protocol#difference-between-v5-and-v4
- https://socket.io/docs/v3/migrating-from-2-x-to-3-0/
2020-12-07 11:18:55 +01:00
Damien Arrachequesne
f5efa1e02a refactor: use ES6 syntax for the tests 2020-12-07 10:57:28 +01:00
Damien Arrachequesne
312bd356c7 ci: migrate to GitHub Actions
Due to the recent changes to the Travis CI platform (see [1]), we will
now use GitHub Actions to run the tests.

Reference: https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-nodejs

[1]: https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing
2020-12-07 10:52:08 +01:00
Damien Arrachequesne
88799daa22 chore(release): 4.0.2
Diff: https://github.com/socketio/engine.io-parser/compare/4.0.1...4.0.2
2020-12-07 10:13:22 +01:00
Damien Arrachequesne
2ccdeb2779 fix: add base64-arraybuffer as prod dependency
The dependency was previously only listed as dev dependency, so that it
was not included when installing the server (the "engine.io" package,
which does not require it) and was explicitly included by the client
(the "engine.io-client" package, which needs it for the browser build).

But it failed with yarn v2, due to its stricter package boundaries:

> ERROR in ../../../.yarn/cache/engine.io-parser-npm-4.0.1-6bdb879e8a-3b71ef8b5a.zip/node_modules/engine.io-parser/lib/decodePacket.browser.js 7:18-47
> Module not found: Error: engine.io-parser tried to access base64-arraybuffer, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

> Required package: base64-arraybuffer (via "base64-arraybuffer")
> Required by: engine.io-parser@npm:4.0.1 (via xxx/.yarn/cache/engine.io-parser-npm-4.0.1-6bdb879e8a-3b71ef8b5a.zip/node_modules/engine.io-parser/lib/)

Related:

- https://dev.to/arcanis/introducing-yarn-2-4eh1#strict-package-boundaries
- https://github.com/socketio/engine.io-parser/issues/116
2020-12-07 09:53:28 +01:00
Damien Arrachequesne
b26993e51b ci: update configuration for GitHub Actions
The specific cron hour is meant to prevent concurrent usage of the
Sauce Labs account.
2020-12-07 09:50:41 +01:00
david-fong
226b491846 refactor(typings): make typing information more specific (#1418) 2020-12-07 09:06:57 +01:00
Damien Arrachequesne
adffc03977 ci: migrate to GitHub Actions
Due to the recent changes to the Travis CI platform (see [1]), we will
now use GitHub Actions to run the tests.

Reference: https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-nodejs

[1]: https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing
2020-12-07 09:02:41 +01:00
Damien Arrachequesne
683fc1dd8e docs: update CI badge
[skip ci]
2020-12-03 16:17:47 +01:00
Damien Arrachequesne
f5bdf6c40d ci: migrate to GitHub Actions
Due to the recent changes to the Travis CI platform (see [1]), we will
now use GitHub Actions to run the tests.

Reference: https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-nodejs

[1]: https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing
2020-12-03 16:05:05 +01:00
Stijn de Witt
4e6d40493d chore: make tests work on Windows (#3708) 2020-11-28 01:55:19 +01:00
Pablo Tejada
28c7cc0856 style(issue-template): fix typo (#3700)
[skip ci]
2020-11-25 11:09:17 +01:00
Damien Arrachequesne
f2098b031d chore(release): 4.0.2
Diff: https://github.com/socketio/socket.io-parser/compare/4.0.1...4.0.2
2020-11-25 11:00:16 +01:00
Damien Arrachequesne
66973a340c chore: cleanup dist folder before compilation 2020-11-25 10:59:02 +01:00
Pascal Sthamer
4efa005846 fix: move @types/component-emitter to dependencies (#99)
Otherwise consumers of socket.io-parser (and socket.io) need to have it
listed in their devDependencies.
2020-11-25 10:51:40 +01:00
Luiz Pereira
b3de861a92 fix(typings): export extraHeaders option (#1410) 2020-11-20 23:09:27 +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
66e4fdf2e6 chore(release): 3.0.3
Diff: https://github.com/socketio/socket.io-client/compare/3.0.2...3.0.3
2020-11-19 01:01:33 +01:00
Damien Arrachequesne
e2a4c56709 chore: cleanup dist folder before compilation 2020-11-19 00:59:42 +01:00
Damien Arrachequesne
bec15240ea fix: properly export io in ES modules wrapper
The syntax was invalid:

```
export const io = io;
             ^

SyntaxError: Identifier 'io' has already been declared
    at Loader.moduleStrategy (internal/modules/esm/translators.js:122:18)
```
2020-11-19 00:56:25 +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
a883e3238e chore(release): 3.0.2
Diff: https://github.com/socketio/socket.io-client/compare/3.0.1...3.0.2
2020-11-18 00:00:42 +01:00
Damien Arrachequesne
719307801a fix(typings): export withCredentials option
Related: https://github.com/socketio/socket.io-client/issues/1405
2020-11-17 23:54:57 +01:00
Damien Arrachequesne
625d146f28 chore: bump engine.io-client version
Diff: https://github.com/socketio/engine.io-client/compare/4.0.2...4.0.4
2020-11-17 23:54:57 +01:00
Damien Arrachequesne
7b3ec9fad9 fix: add io as named exports
The TypeScript (build/index.d.ts) and ES modules exports did not match,
which caused issues with webpack and ts-loader.

Related: https://github.com/socketio/socket.io-client/issues/1396
2020-11-17 23:54:56 +01:00
Damien Arrachequesne
43705d7a91 fix: merge Engine.IO options
So that the following example:

```js
const io = require('socket.io')({
  pingTimeout: 10000
});

io.listen(3000);
```

behaves the same as:

```js
const io = require('socket.io')(3000, {
  pingTimeout: 10000
});
```

Before this change, the options in the first example were not forwarded
to the Engine.IO constructor, which is not really intuitive.

The previous syntax (which is still valid):

```js
const io = require('socket.io')();

io.listen(3000, {
  pingTimeout: 10000
});
```
2020-11-17 23:33:18 +01:00
Damien Arrachequesne
c2981c6040 chore(release): 4.0.4
Diff: https://github.com/socketio/engine.io/compare/4.0.3...4.0.4
2020-11-17 22:51:56 +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
67ca12c533 chore(release): 4.0.3
Diff: https://github.com/socketio/engine.io/compare/4.0.2...4.0.3
2020-11-17 10:06:52 +01:00
Damien Arrachequesne
c596e54343 docs(examples): update React Native example
This includes `engine.io-client@4.0.3`, which fixes two issues with
React Native.

See also:

- 177b95fe46
- ccb99e3718

[skip ci]
2020-11-17 09:44:05 +01:00
Yusuke Sakurai
96cd2c9ae4 fix(typings): export ManagerOptions (#1398) 2020-11-17 00:03:22 +01:00
Damien Arrachequesne
567231e27a docs: minor fix
Related: https://github.com/socketio/socket.io-client-swift/pull/1309#issuecomment-723518797
2020-11-09 11:31:38 +01:00
Damien Arrachequesne
f7e0009120 docs(examples): update TypeScript example
In order to test 50671d984a

[skip ci]
2020-11-09 10:47:50 +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
969d5c95f8 chore(release): 3.0.1
Diff: https://github.com/socketio/socket.io-client/compare/3.0.0...3.0.1
2020-11-09 10:27:33 +01:00
Damien Arrachequesne
ca34eddf4b chore: bump engine.io-client version 2020-11-09 10:23:42 +01:00
Damien Arrachequesne
d00c0c0d9d docs(examples): update examples to Socket.IO v3
Other examples need some additional work (Redis adapter migration, ...).
2020-11-09 10:19:40 +01:00
Damien Arrachequesne
9ddccf398e chore: bump engine.io-client 2020-11-09 10:11:20 +01:00
Damien Arrachequesne
16fd658274 chore(release): 4.0.2
Diff: https://github.com/socketio/engine.io/compare/4.0.1...4.0.2
2020-11-09 10:03:04 +01:00
Avi Vahl
19ab1e9e4e fix(typings): export Socket and SocketOptions types (#1394)
These were exposed by @types/socket.io-client.
2020-11-09 09:00:07 +01:00
Avi Vahl
f62f180eda fix: export ServerOptions and Namespace types (#3684)
@types/socket.io used to export these.
2020-11-09 08:58:14 +01:00
Andrew Stoker
17b8c2f199 fix: add extension in the package.json main entry (#608)
The `main` entry for the `package.json` file is for defining the entry
point. The entry is currently missing the required `.js` extension,
this PR brings it back.
2020-11-08 02:00:54 +01:00
Damien Arrachequesne
50671d984a fix(typings): update the signature of the emit method
The previous signature was not compatible with EventEmitter.emit(). The typescript compilation threw:

```
node_modules/socket.io/dist/namespace.d.ts(89,5): error TS2416: Property 'emit' in type 'Namespace' is not assignable to the same property in base type 'EventEmitter'.
  Type '(ev: string, ...args: any[]) => Namespace' is not assignable to type '(event: string | symbol, ...args: any[]) => boolean'.
    Type 'Namespace' is not assignable to type 'boolean'.
node_modules/socket.io/dist/socket.d.ts(84,5): error TS2416: Property 'emit' in type 'Socket' is not assignable to the same property in base type 'EventEmitter'.
  Type '(ev: string, ...args: any[]) => this' is not assignable to type '(event: string | symbol, ...args: any[]) => boolean'.
    Type 'this' is not assignable to type 'boolean'.
      Type 'Socket' is not assignable to type 'boolean'.
```

Note: the emit calls cannot be chained anymore:

```js
socket.emit("hello").emit("world"); // will not work anymore
```
2020-11-08 00:07:56 +01:00
Damien Arrachequesne
3add3e1b82 chore: restore package-lock.json file 2020-11-05 22:27:32 +01:00
Damien Arrachequesne
8a69f15437 chore: restore package-lock.json file 2020-11-05 22:25:35 +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
b7e07ba633 chore(release): 3.0.0
Diff: https://github.com/socketio/socket.io-client/compare/2.3.1...3.0.0
2020-11-05 22:06:25 +01:00
Damien Arrachequesne
e73271e652 chore(release): 2.0.3
Diff: https://github.com/socketio/socket.io-adapter/compare/1.1.2...2.0.3
2020-11-05 16:19:45 +01:00
Damien Arrachequesne
c04443375f docs: add compatibility table 2020-11-05 16:16:36 +01:00
Damien Arrachequesne
e339323654 chore(release): 4.0.1
Diff: https://github.com/socketio/socket.io-parser/compare/3.4.1...4.0.1
2020-11-05 16:07:35 +01:00
Damien Arrachequesne
b80de070cb docs: describe the 5th revision of the protocol
This revision will be included in Socket.IO v3.
2020-11-05 11:36:59 +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
ffa280450d chore(release): 3.0.0-rc4
Diff: https://github.com/socketio/socket.io-client/compare/3.0.0-rc3...3.0.0-rc4
2020-10-30 23:02:06 +01:00
Damien Arrachequesne
09393952e3 feat: emit an Error object upon middleware error
See 54bf4a44e9
2020-10-30 22:54:13 +01:00
Damien Arrachequesne
54bf4a44e9 feat: emit an Error object upon middleware error
This commit restores the ability to send additional data in the
middleware functions, which was removed during the rewrite to
Typescript ([1]).

The only difference with the previous implementation is that the client
will now emit a "connect_error" (previously, "error") event with an
actual Error object, with both the message and an optional "data"
attribute.

```js
// server-side
io.use((socket, next) => {
  const err = new Error("not authorized");
  err.data = { content: "Please retry later" };
  next(err);
});

// client-side
socket.on("connect_error", err => {
  console.log(err.message); // not authorized
  console.log(err.data.content); // Please retry later
});
```

[1]: a5581a9789
2020-10-30 22:52:08 +01:00
Damien Arrachequesne
aa7574f884 feat: serve msgpack bundle
See 71d60480af
2020-10-27 23:17:12 +01:00
Damien Arrachequesne
969debe88c refactor: rework of the Manager events
- rename "connect_error" to "error"
- remove "reconnecting" (duplicate of "reconnect_attempt")

The updated list of events emitted by the Manager:

- open:                successful (re)connection
- error:               (re)connection failure (previously: "connect_error") or error after a successful connection
- close:               disconnection

- ping:                ping packet
- packet:              data packet

- reconnect_attempt:   reconnection attempt (previously: "reconnect_attempt" & "reconnecting")
- reconnect:           successful reconnection
- reconnect_error:     reconnection failure
- reconnect_failed:    reconnection failure after all attempts

For reference, the Socket instance emits the following events:

- connect:             successful connection to a Namespace
- connect_error:       connection failure
- disconnect:          disconnection
2020-10-27 23:07:44 +01:00
Damien Arrachequesne
64056d6616 docs(examples): update TypeScript example 2020-10-27 22:18:07 +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
a9127cee83 chore(release): 3.0.0-rc3
Diff: https://github.com/socketio/socket.io-client/compare/3.0.0-rc2...3.0.0-rc3
2020-10-27 00:41:32 +01:00
Damien Arrachequesne
13e1db7c94 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.

Breaking change: the Socket instance will now emit a "connect_error"
event instead of "error" (which is not a reserved event anymore)

```js
// before
socket.on("error", () => {});

// after
socket.on("connect_error", () => {});
```
2020-10-26 10:04:05 +01:00
Damien Arrachequesne
55f464f59e feat: add support for catch-all listeners
Inspired from EventEmitter2 [1]

The API is similar to the one on the server-side:

```js
socket.onAny((event, ...args) => {});

socket.prependAny((event, ...args) => {});

socket.offAny(); // remove all listeners

socket.offAny(listener);

const listeners = socket.listenersAny();
```

[1]: https://github.com/EventEmitter2/EventEmitter2
2020-10-26 10:03:27 +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
412769fd18 chore(release): 4.0.1-rc3
Diff: https://github.com/socketio/socket.io-parser/compare/4.0.1-rc2...4.0.1-rc3
2020-10-26 00:16:09 +01:00
Damien Arrachequesne
5c73733985 feat: add support for catch-all listeners
Inspired from EventEmitter2 [1]

```js
io.on("connect", socket => {

  socket.onAny((event, ...args) => {});

  socket.prependAny((event, ...args) => {});

  socket.offAny(); // remove all listeners

  socket.offAny(listener);

  const listeners = socket.listenersAny();
});
```

Breaking change: the socket.use() method is removed

This method was introduced in [2] for the same feature (having a
catch-all listener), but there were two issues:

- the API is not very user-friendly, since the user has to know the structure of the packet argument
- it uses an ERROR packet, which is reserved for Namespace authentication issues (see [3])

[1]: https://github.com/EventEmitter2/EventEmitter2
[2]: https://github.com/socketio/socket.io/issues/434
[3]: https://github.com/socketio/socket.io-protocol
2020-10-25 23:44:01 +01:00
Damien Arrachequesne
db1d27432d 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. But I feel the
name makes more sense:

```js
socket.on("connect", () => {});
socket.on("connect_error", () => {});

// instead of
socket.on("error", () => {});
```
2020-10-25 22:57:26 +01:00
Damien Arrachequesne
71d60480af feat: add bundle with msgpack parser
Pros:

- events with binary content are sent as 1 WebSocket frame (instead of 2 with the default parser)
- payloads with lots of numbers should be smaller

Cons:

- no IE9 support (https://caniuse.com/mdn-javascript_builtins_arraybuffer)
- a slightly bigger bundle size (61.1 vs 59.9 KB)

Source: https://github.com/darrachequesne/socket.io-msgpack-parser
2020-10-25 22:47:31 +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
3284208a6d chore: bump engine.io-client 2020-10-22 00:36:45 +02:00
Damien Arrachequesne
58943c3b30 chore(release): 4.0.1
Diff: https://github.com/socketio/engine.io/compare/4.0.0...4.0.1
2020-10-22 00:30:51 +02:00
Damien Arrachequesne
c099338e04 refactor: remove binary handling for the polling transport
Since Engine.IO v4, the binary payloads are always encoded as base64
with the polling transport.

See https://github.com/socketio/engine.io-protocol#difference-between-v3-and-v4
2020-10-22 00:12:05 +02:00
Damien Arrachequesne
fe093bae1a fix: do not overwrite CORS headers upon error
The Access-Control-Allow-xxx headers added by the cors middleware were
overwritten when sending an error response.

Those lines should have been removed in [1].

[1]: 61b949259e

Related: https://github.com/socketio/engine.io/issues/605
2020-10-22 00:11:06 +02:00
Aleksey Druzhinin
e3d272f542 docs: fix small typo (#98) 2020-10-21 23:28:36 +02:00
Damien Arrachequesne
d5ceef94ed chore(release): 2.0.3-rc2
Diff: https://github.com/socketio/socket.io-adapter/compare/2.0.3-rc1...2.0.3-rc2
2020-10-20 14:27:38 +02:00
Damien Arrachequesne
f7c6eca48c docs: add compatibility table 2020-10-20 14:22:57 +02:00
Damien Arrachequesne
2e023bf2b6 feat: add init() and close() methods
These extension points may be used by another adapter, in order to open
or close a connection to a database for example.

In Socket.IO v2, the join() method did accept a callback:

```js
socket.join("room1", () => {
  io.to("room1").emit("hello");
});
```

Depending on the adapter, it may now return a promise:

```js
await socket.join("room1");
io.to("room1").emit("hello");
```

Related: https://github.com/socketio/socket.io/issues/3662
2020-10-20 14:18:57 +02:00
Damien Arrachequesne
f3cbe983a1 refactor: additional typings 2020-10-17 03:37:53 +02:00
Damien Arrachequesne
7ddad2c09d feat: add volatile events
A volatile packet will be dropped if:

- the socket is not connected
- the low-level transport is not ready (for example, a HTTP POST request is already pending)

Syntax:

```js
socket.volatile.emit("volatile event", "might or might not be sent");
```
2020-10-17 03:37:29 +02:00
Damien Arrachequesne
0d74f290cd refactor(typings): export Socket class
In order to be able to cast it on the argument of the "connect" event:

```js
import { Socket } from "socket.io";

io.on("connect", (socket: Socket) => {
  // ...
});
```
2020-10-17 03:36:15 +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
a81b9f31cf docs(examples): add example with TypeScript
There are two issues with the typings:

- on the client-side, the Emitter class is not properly imported (hence the @ts-ignore)
- on the server-side, the Socket class is not exported (in order to cast it in the "connect" event)
2020-10-15 13:38:46 +02:00
Damien Arrachequesne
20ea6bd277 docs(examples): add example with ES modules 2020-10-15 13:26:55 +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
Damien Arrachequesne
b600e78f71 chore(release): 3.0.0-rc2
Diff: https://github.com/socketio/socket.io-client/compare/3.0.0-rc1...3.0.0-rc2
2020-10-15 13:00:43 +02:00
Damien Arrachequesne
8a5db7fa36 refactor: remove duplicate _sockets map
Both the "connected" and the "_sockets" maps were used to track the
Socket instances in the namespace.

Let's merge them into "sockets". It's a breaking change, but:

- the "sockets" object did already exist in Socket.IO v2 (and appears in some examples/tutorials)
- "sockets" makes more sense than "connected" in my opinion
- there was already a breaking change regarding the "connected" property (from object to Map)

Breaking change: the "connected" map is renamed to "sockets"
2020-10-15 12:45:42 +02:00
Damien Arrachequesne
5f417d256b chore(release): 2.0.3-rc1
Diff: https://github.com/socketio/socket.io-adapter/compare/2.0.2...2.0.3-rc1
2020-10-15 12:18:09 +02:00
Damien Arrachequesne
0a9762cac2 refactor: use Namespace#sockets to broadcast 2020-10-15 12:15:32 +02:00
Damien Arrachequesne
2a05042e2c refactor: add additional typings 2020-10-15 12:04:42 +02:00
Damien Arrachequesne
91cd255ba7 fix: close clients with no namespace
After a given timeout, a client that did not join any namespace will be
closed in order to prevent malicious clients from using the server
resources.

The timeout defaults to 45 seconds, in order not to interfere with the
Engine.IO heartbeat mechanism (30 seconds).
2020-10-15 11:54:06 +02:00
Damien Arrachequesne
58b66f8089 refactor: hide internal methods and properties
There is no concept of package-private methods in TypeScript, so we'll
just prefix them with "_" and mark them as private in the JSDoc.
2020-10-15 11:54:06 +02:00
Damien Arrachequesne
669592d120 feat: move binary detection back to the parser
See 285e7cd0d8

Breaking change: the Socket#binary() method is removed, as this use
case is now covered by the ability to provide your own parser.
2020-10-15 10:45:56 +02:00
Damien Arrachequesne
178909471a feat: move binary detection back to the parser
See 285e7cd0d8

Breaking change: the Socket#binary() method is removed, as this use
case is now covered by the ability to provide your own parser.
2020-10-15 10:37:06 +02:00
Damien Arrachequesne
64b6648236 chore(release): 4.0.1-rc2
Diff: https://github.com/socketio/socket.io-parser/compare/4.0.1-rc1...4.0.1-rc2
2020-10-15 10:24:47 +02:00
Damien Arrachequesne
58b3d09f1c chore: protocol version 5
There are two differences with the 4th version:

- a CONNECT packet can now contain a payload (for authentication purposes)
- the underlying Engine.IO protocol has been updated

Reference: https://github.com/socketio/engine.io-protocol#difference-between-v3-and-v4
2020-10-15 01:51:51 +02:00
Damien Arrachequesne
285e7cd0d8 feat: move binary detection back to the parser
The binary detection was moved from the parser to the client/server in
[1], in order to allow the user to skip the binary detection for huge
JSON payloads.

```js
socket.binary(false).emit(...);
```

The binary detection is needed in the default parser, because the
payload is encoded with JSON.stringify(), which does not support binary
content (ArrayBuffer, Blob, ...).

But other parsers (like [2] or [3]) do not need this check, so we'll
move the binary detection back here and remove the socket.binary()
method, as this use case is now covered by the ability to provide your
own parser.

Note: the hasBinary method was copied from [4].

[1]: f44256c523
[2]: https://github.com/darrachequesne/socket.io-msgpack-parser
[3]: https://github.com/darrachequesne/socket.io-json-parser
[4]: https://github.com/darrachequesne/has-binary
2020-10-15 01:46:47 +02:00
Damien Arrachequesne
c7998d5446 refactor: add Manager and Socket typings 2020-10-14 22:59:58 +02:00
Damien Arrachequesne
2d2a31e5c0 chore: publish the wrapper.mjs file 2020-10-14 01:53:37 +02:00
Damien Arrachequesne
2c7c230153 chore: publish the wrapper.mjs file 2020-10-14 01:51:30 +02:00
Damien Arrachequesne
a66473f93a chore: use socketio GitHub organization 2020-10-14 01:49:06 +02:00
Damien Arrachequesne
946a9f008c chore: fix test script 2020-10-14 00:00:02 +02:00
Damien Arrachequesne
ebb0575fa8 chore(release): 3.0.0-rc1
Diff: https://github.com/socketio/socket.io/compare/2.3.0...3.0.0-rc1
2020-10-13 23:36:21 +02:00
Damien Arrachequesne
a838ff1fc8 chore(release): 3.0.0-rc1
Diff: https://github.com/socketio/socket.io-client/compare/2.3.1...3.0.0-rc1
2020-10-13 23:35:22 +02:00
Damien Arrachequesne
b68f816323 chore: bump debug 2020-10-13 23:24:41 +02:00
Damien Arrachequesne
c0d171f728 test: use the reconnect event of the Manager
Following 132f8ec918
2020-10-13 23:02:09 +02:00
Damien Arrachequesne
9c7a48d866 test: use the complete export name
Following fa7d41f55d

Ref: https://nodejs.org/dist/latest-v14.x/docs/api/packages.html#packages_subpath_exports
2020-10-13 23:02:09 +02:00
Damien Arrachequesne
4bd5b2339a feat: throw upon reserved event names
These events cannot be used by the end users, because they are part of
the Socket.IO public API, so using them will now throw an error
explicitly.
2020-10-13 23:02:09 +02:00
Damien Arrachequesne
a8c0600609 feat: remove the 'origins' option
The underlying Engine.IO server now supports a 'cors' option, which
will be forwarded to the cors module.

Breaking change: the 'origins' option is removed

Before:

```js
new Server(3000, {
  origins: ["https://example.com"]
});
```

The 'origins' option was used in the allowRequest method, in order to
determine whether the request should pass or not. And the Engine.IO
server would implicitly add the necessary Access-Control-Allow-xxx
headers.

After:

```js
new Server(3000, {
  cors: {
    origin: "https://example.com",
    methods: ["GET", "POST"],
    allowedHeaders: ["content-type"]
  }
});
```

The already existing 'allowRequest' option can be used for validation:

```js
new Server(3000, {
  allowRequest: (req, callback) => {
    callback(null, req.headers.referer.startsWith("https://example.com"));
  }
});
```
2020-10-13 23:02:08 +02:00
Damien Arrachequesne
8b6b100c28 feat: add ES6 module export
Both CommonJS and ES6 import are now supported:

- with `{ "type": "commonjs" }` in the package.json file

```js
const io = require("socket.io")(8080);
// or
const { Server } = require("socket.io");
const io = new Server(8080);
```

- with `{ "type": "module" }`

```js
import { Server } from "socket.io";

const io = new Server(8080);
```

Related: https://nodejs.org/api/packages.html#packages_dual_commonjs_es_module_packages
2020-10-13 23:02:08 +02:00
Damien Arrachequesne
83a2356648 refactor: properly delegate to the main namespace 2020-10-13 23:02:08 +02:00
Damien Arrachequesne
2875d2cfdf feat: do not reuse the Engine.IO id
In previous versions, the Socket#id attribute was equal (or derived,
for a non-default namespace) to the underlying Engine.IO id, which is
used as a mean to authenticate the user throughout the Engine.IO
session and thus is sensitive information that should be kept secret.

The problem with reusing the Engine.IO id is that users could be
tempted to transmit this id to other clients, in order to implement
private messaging for example.

So we'll now generate a new random id for each new socket.

Please note that this id will now be different from the one found in
the query parameters of the HTTP requests.
2020-10-13 23:02:07 +02:00
Damien Arrachequesne
3289f7ec37 feat: remove the implicit connection to the default namespace
In previous versions, a client was always connected to the default
namespace, even if it requested access to another namespace.

This meant that the middlewares registered for the default namespace
were triggered in any case, which is a surprising behavior for end
users.

This also meant that the query option of the Socket on the client-side
was not sent in the Socket.IO CONNECT packet for the default namespace:

```js
// default namespace: query sent in the query params
const socket = io({
  query: {
    abc: "def"
  }
});

// another namespace: query sent in the query params + the CONNECT packet
const socket = io("/admin", {
  query: {
    abc: "def"
  }
});
```

The client will now send a CONNECT packet in any case, and the query
option of the Socket is renamed to "auth", in order to make a clear
distinction with the query option of the Manager (included in the query
parameters of the HTTP requests).

```js
// server-side
io.use((socket, next) => {
  // not triggered anymore
});

io.of("/admin").use((socket, next => {
  // triggered
  console.log(socket.handshake.query.abc); // "def"
  console.log(socket.handshake.auth.abc); // "123"
});

// client-side
const socket = io("/admin", {
  query: {
    abc: "def"
  },
  auth: {
    abc: "123"
  }
});
```
2020-10-13 23:02:07 +02:00
Damien Arrachequesne
7a51c76413 refactor: migrate tests to TypeScript 2020-10-13 23:02:06 +02:00
Damien Arrachequesne
64bd9fb01a chore: include Engine.IO v4
Release notes: https://github.com/socketio/engine.io/releases/tag/4.0.0
2020-10-13 23:02:06 +02:00
Damien Arrachequesne
4396bd0b3d chore: point towards the develop branch of the client
The package-lock.json file is temporarily removed in order to include
the latest commits to the client and make the tests pass.
2020-10-13 23:02:06 +02:00
Damien Arrachequesne
cbabb0308e feat: add ES6 module export
- with `{ "type": "commonjs" }` in the package.json file

```js
const io = require("socket.io-client");

const socket = io("/");
```

- with `{ "type": "module" }`

```js
import io from "socket.io-client";

const socket = io("/");

// or
import { Manager } from "socket.io-client";

const manager = new Manager();
const socket = manager.socket("/");
```

Related: https://nodejs.org/api/packages.html#packages_dual_commonjs_es_module_packages
2020-10-13 22:53:53 +02:00
Damien Arrachequesne
7fc3c42234 chore(release): 4.0.1-rc1
Diff: https://github.com/socketio/socket.io-parser/compare/4.0.0...4.0.1-rc1
2020-10-12 15:21:44 +02:00
Damien Arrachequesne
e826992c8e refactor: remove the 'connect_timeout' event
The 'connect_timeout' event is now merged with the 'connect_error'
event, and will now emit an Error object instead of a plain string.
2020-10-12 15:03:09 +02:00
Damien Arrachequesne
b60e909039 refactor: remove the 'connecting' event
This event was added in 41956806a7

But it does not convey the information that the Socket is actually
sending a CONNECT packet to the server. It should maybe be moved to the
Socket#onopen() method, but let's remove it for now as it is not
documented anywhere.
2020-10-12 15:03:09 +02:00
Damien Arrachequesne
6494f61be0 feat: throw upon reserved event names
These events cannot be used by the end users, because they are part of
the Socket.IO public API, so using them will now throw an error
explicitly.

Related: f7ed81e5d2
2020-10-12 15:03:09 +02:00
Damien Arrachequesne
132f8ec918 feat: split the events of the Manager and Socket
Previously, most of the events emitted by the Manager were also emitted
by the Socket instances, but it was somehow misleading for the end
users because they don't have the same meaning:

- Manager: the state of the low-level connection (with connection and reconnection events)
- Socket: the state of the connection to the Namespace (only 'connect', 'disconnect' and 'error')

For example, the `reconnect` event:

```js
socket.on("reconnect", () => {
  console.log(socket.connected); // might be false, which is a bit surprising
});
```

Breaking change: the Socket instance will no longer forward the events
of its Manager

Those events can still be accessed on the Manager instance though:

```js
socket.io.on("reconnect", () => {
  // ...
});
```
2020-10-12 15:03:09 +02:00
Damien Arrachequesne
6cd2e4eab0 refactor: remove the packetBuffer array
The parser#encode() method is now synchronous, so the packetBuffer
array is useless.
2020-10-12 11:41:55 +02:00
Damien Arrachequesne
c07b91db96 chore: restore the source-map generation 2020-10-12 11:16:26 +02:00
Damien Arrachequesne
bbe94adb82 feat: do not reuse the Engine.IO id
Related: 3b0cb1158c
2020-10-08 03:04:49 +02:00
Damien Arrachequesne
249e0bef90 feat: remove the implicit connection to the default namespace
Related: 09b6f23339
2020-10-08 02:04:03 +02:00
Damien Arrachequesne
78f9fc2999 feat: add support for a payload in a CONNECT packet 2020-10-08 02:00:09 +02:00
Damien Arrachequesne
be8c3141bd chore: include Engine.IO client v4
The ping-pong mechanism has been reverted (server now sends a ping and
expects a pong from the client), so we cannot compute the latency like
we did in previous versions.

Release notes: https://github.com/socketio/engine.io-client/releases/tag/4.0.0
2020-10-06 22:50:52 +02:00
Damien Arrachequesne
f2f4a4c7c7 chore: point towards the develop branch of the server
The package-lock.json file is temporarily removed in order to include
the latest commits to the server and make the tests pass.
2020-10-06 22:41:17 +02:00
Damien Arrachequesne
429846b0a1 chore: bump socket.io-parser
Breaking change:

- the encode() method is now synchronous

Please note that the exchange [protocol][1] is left untouched and thus
stays in version 4.

Diff: https://github.com/socketio/socket.io-parser/compare/3.4.1...4.0.0

[1] https://github.com/socketio/socket.io-protocol
2020-10-06 01:20:12 +02:00
Damien Arrachequesne
9eb8561cbc refactor: use require for debug dependency
So that the lines can be properly excluded by the webpack-remove-debug
loader ([1]).

[1] https://github.com/johngodley/webpack-remove-debug
2020-10-06 01:17:31 +02:00
Damien Arrachequesne
091d25edf1 chore: add dist 2020-10-06 01:15:30 +02:00
Damien Arrachequesne
cab895f477 refactor: use prettier to format tests 2020-10-06 00:21:14 +02:00
Damien Arrachequesne
697bea2d81 refactor: migrate to TypeScript 2020-10-06 00:21:14 +02:00
Damien Arrachequesne
003cb38cae test: add Node.js 12 and 14 in the build matrix
Node.js 8 is removed, as it is now EOL.
2020-10-06 00:20:25 +02:00
Damien Arrachequesne
3c11eb9d2e refactor: remove gulp from the build
Plain npm scripts should be sufficient for our use case.
2020-10-05 15:48:22 +02:00
Damien Arrachequesne
f08b933800 docs: remove reference to JSON3
The `json3` dependency, previously used for compatibility with IE6/7,
was removed in [1] and included in `socket.io-parser@3.0.0` and
`socket.io-client@2.0.0` ([2]).

The slim build now only removes the debug dependency (~3KB min+gzip).

[1] e39f5a8c6a (diff-b9cfc7f2cdf78a7f4b91a753d10865a2)
[2] ff4cb3eed0 (diff-b9cfc7f2cdf78a7f4b91a753d10865a2R28)
2020-10-05 11:08:15 +02:00
Damien Arrachequesne
8df2120a6f docs: add a sample session with HTTP requests and WebSocket frames 2020-10-05 01:43:53 +02:00
Damien Arrachequesne
f9c0e74b14 chore: bump eiows to 3.3.2
The CI was failing with Node.js 14.13.0.
2020-10-05 01:04:17 +02:00
Alessandro Magionami
bb43ff2988 docs: add example with fastify (#3654)
See https://github.com/alemagio/fastify-socket.io
2020-10-04 23:20:05 +02:00
Damien Arrachequesne
ba55991ba0 style: minor edits 2020-10-02 12:38:18 +02:00
Damien Arrachequesne
621aeba569 docs: add a history of revisions
Backported from master.
2020-10-02 12:32:42 +02:00
Damien Arrachequesne
4b9e14a951 docs: add a history of revisions 2020-10-02 12:28:40 +02:00
Damien Arrachequesne
d389bb93e4 docs: rework of the protocol documentation 2020-10-02 12:06:26 +02:00
Damien Arrachequesne
bce66e8296 docs: rework of the protocol documentation 2020-10-02 00:11:24 +02:00
Damien Arrachequesne
27a0ab5d38 docs: restore the 'upgrades' param in the handshake
Related: 660263fae2
2020-10-01 15:18:43 +02:00
Damien Arrachequesne
2f1abed2e2 docs: clarify the session examples 2020-10-01 15:09:24 +02:00
Damien Arrachequesne
bd2ba234d9 docs: clarify the session examples 2020-10-01 14:59:37 +02:00
Damien Arrachequesne
4631ed6ab3 chore(release): 2.3.1
Diff: https://github.com/socketio/socket.io-client/compare/2.3.0...2.3.1
2020-09-30 18:32:33 +02:00
Damien Arrachequesne
7f73a289f5 test: fix tests in IE 2020-09-30 17:42:32 +02:00
Damien Arrachequesne
67c54b8344 chore: bump engine.io-parser and socket.io-parser
Diff:

- https://github.com/socketio/engine.io-parser/compare/2.2.0...2.2.1
- https://github.com/socketio/socket.io-parser/compare/3.3.0...3.3.1

Related:

- https://github.com/socketio/socket.io-client/pull/1376
- https://github.com/socketio/socket.io-client/issues/1234
2020-09-30 16:14:19 +02:00
Damien Arrachequesne
15a52ab721 test: remove arrow function (for now)
It was included by the previous commit, but the test code is not
currently transpiled to ES5 so it breaks IE in the CI.

Let's use a plain function for now.
2020-09-30 16:11:54 +02:00
Luke Olney
050108b228 fix: fix reconnection after opening socket asynchronously (#1253)
Closes https://github.com/socketio/socket.io/issues/3358
2020-09-30 16:01:15 +02:00
Damien Arrachequesne
ea8804eee5 docs(changelog): include changelog for release 2.2.1
Merged from the 2.2.x branch.
2020-09-30 15:31:11 +02:00
Damien Arrachequesne
ccadd5a462 docs(changelog): include changelog for release 3.3.1
Merged from the 3.3.x branch.
2020-09-30 02:45:53 +02:00
Damien Arrachequesne
b570025a79 chore: bump engine.io-client and downgrade debug
The newer versions need to be transpiled to ES5, so we'll rollback for
now as it breaks IE11.

We'll have to find a way to provide the users who bundle the Engine.IO
(or Socket.IO) client (with webpack for example) with a source code
which does not include debug (or document the usage of
webpack-remove-debug [1]).

[1] https://github.com/johngodley/webpack-remove-debug
2020-09-30 02:26:29 +02:00
Damien Arrachequesne
1fb1b78020 chore: remove unused dependencies
- base64-arraybuffer => dev
- has-cors => dev
- object-component => removed
2020-09-30 02:24:16 +02:00
devmi
0c39f145fa docs: add section about Debug / logging on the client side (#1278) 2020-09-30 02:09:10 +02:00
Mithilesh Pradhan
6ce02ee3b0 docs: add server port in the example (#1359) 2020-09-30 01:52:26 +02:00
Damien Arrachequesne
f4a4d89f15 chore: update package-lock.json file
Following previous commit, the lock file was not up-to-date.
2020-09-30 00:20:59 +02:00
rookieKing
3c1d860420 chore: bump component-emitter dependency (#1376)
Subscribing/unsubscribing for a lot of different event types could lead
to a memory leak.

See aa2e57acc7

Diff: https://github.com/component/emitter/compare/1.2.1...1.3.0
2020-09-30 00:13:12 +02:00
Damien Arrachequesne
b7dbbd28c8 test: fix race condition in the tests
Even with a timeout of 0, the 'open' event was emitted before the
timeout was reached, so the tests would randomly fail in the CI.
2020-09-30 00:07:29 +02:00
Damien Arrachequesne
0540c36510 refactor(typings): add server options
Greatly inspired from:

- https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/engine.io
- https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/socket.io
2020-09-29 02:04:27 +02:00
Damien Arrachequesne
1108ede120 chore: bump socket.io-parser
Breaking change:

- the encode() method is now synchronous

Please note that the exchange [protocol][1] is left untouched and thus
stays in version 4.

Diff: https://github.com/socketio/socket.io-parser/compare/3.4.1...4.0.0

[1] https://github.com/socketio/socket.io-protocol
2020-09-28 16:07:09 +02:00
Damien Arrachequesne
5d81b13431 chore(release): 2.0.2
Diff: https://github.com/socketio/socket.io-adapter/compare/2.0.1...2.0.2
2020-09-28 15:32:41 +02:00
Damien Arrachequesne
e57f528944 chore(release): 2.0.1
Diff: https://github.com/socketio/socket.io-adapter/compare/2.0.0...2.0.1
2020-09-28 15:14:58 +02:00
Damien Arrachequesne
c043650f1c fix: Adapter#encode() is now synchronous
See https://github.com/socketio/socket.io-parser/releases/tag/4.0.0
2020-09-28 15:11:56 +02:00
Damien Arrachequesne
c04d7f5c47 chore(release): 4.0.0
This release will be included in Socket.IO v3.

Diff: https://github.com/socketio/socket.io-parser/compare/3.4.1...4.0.0
2020-09-28 14:55:19 +02:00
Damien Arrachequesne
9e601c6940 refactor: export Packet interface and refactor imports 2020-09-28 14:37:47 +02:00
Damien Arrachequesne
029f478992 feat: remove Server#set() method
This method was kept for backward-compatibility with pre-1.0 versions.
2020-09-26 01:47:17 +02:00
Damien Arrachequesne
424a473c22 refactor: use ES6 Maps instead of plain objects
These attributes were not part of the public API, so there's no
breaking change.
2020-09-26 01:21:51 +02:00
Damien Arrachequesne
1507b416d5 feat: remove Socket#rooms object
The value stored in the adapter will now be used, instead of
duplicating it in the Socket class.

Breaking change: Socket#rooms is now a Set instead of an object

Closes https://github.com/socketio/socket.io/issues/2890
2020-09-26 00:48:55 +02:00
Damien Arrachequesne
84437dc2a6 chore: bump socket.io-adapter
Breaking changes:

- Namespace#connected is now a Map instead of an object.

- Namespace#clients() is renamed to Namespace#allSockets() and now
returns a Promise

Diff: https://github.com/socketio/socket.io-adapter/compare/1.1.2...2.0.0
2020-09-26 00:24:54 +02:00
Damien Arrachequesne
2464de7d2b refactor: use prettier to format tests 2020-09-25 23:47:23 +02:00
Damien Arrachequesne
a5581a9789 refactor: migrate to TypeScript 2020-09-25 23:41:53 +02:00
Damien Arrachequesne
7216d7adfb chore(release): 2.0.0
Diff: https://github.com/socketio/socket.io-adapter/compare/1.1.2...2.0.0
2020-09-25 23:09:21 +02:00
Damien Arrachequesne
b52b4ef49e refactor: migrate to TypeScript 2020-09-25 23:01:42 +02:00
Damien Arrachequesne
cfdc4794f6 refactor: use prettier to format test code 2020-09-24 12:02:19 +02:00
Damien Arrachequesne
28d4f0309b refactor: do not convert Blobs
This was needed in a previous version of the parser, which used msgpack
to encode the payload.

Blobs (and Files) will now be included in the array of binary
attachments without any additional transformation.

Breaking change: the encode method is now synchronous

See also 299849b002
2020-09-24 11:48:25 +02:00
Damien Arrachequesne
fe33ff7c87 test: actually test the parser
The assertions were not checked, because the functions are asynchronous.

Besides, the Blob tests were throwing in the browser:

> Uncaught ReferenceError: can't access lexical declaration 'BlobBuilder' before initialization
2020-09-24 11:48:24 +02:00
dependabot[bot]
00e73598a0 chore: bump elliptic from 6.5.2 to 6.5.3 (#96)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-23 00:57:41 +02:00
Damien Arrachequesne
dd7cd60ba2 refactor: convert all tests to ES6 syntax 2020-09-23 00:28:54 +02:00
Damien Arrachequesne
aeae87c220 fix: do not catch encoding errors
It does not make sense to catch the errors thrown by JSON.stringify()
and convert them to an ERROR packet (which are meant for namespace
authentication errors), it should be caught higher in the stack.

Related: 92c530da47
2020-09-23 00:28:53 +02:00
Damien Arrachequesne
567c0ca965 refactor: use PacketType enum wherever applicable 2020-09-23 00:24:38 +02:00
Damien Arrachequesne
c327acbc3c fix: throw upon invalid payload format
An invalid packet was previously parsed as an ERROR packet, which was
then ignored because it didn't contain any 'nsp' (namespace) field.

This behavior was wrong because:

- it means the other side is sending invalid payloads, so the
connection must be closed right away

- ERROR packets are meant for namespace authentication failures

Parsing an invalid payload will now throw an error, which must be
caught by the caller.

Closes https://github.com/socketio/socket.io-parser/issues/86
2020-09-22 23:33:03 +02:00
Damien Arrachequesne
b23576a73e refactor: migrate to TypeScript 2020-09-22 22:42:17 +02:00
Diego Molina
af165ae1c2 docs: adjusting Sauce Labs name (#3578) 2020-09-19 03:01:19 +02:00
Damien Arrachequesne
ea41f225ee perf: update benchmarks 2020-09-18 14:09:53 +02:00
Damien Arrachequesne
6a59237ed0 test: add Node.js 12 and 14 in the build matrix
Node.js 8 is removed, as it is now EOL.

Note: the node_modules folder is cached by default
2020-09-17 15:27:33 +02:00
Damien Arrachequesne
3d760b71d7 refactor: use ES6 syntax 2020-09-17 14:48:46 +02:00
Damien Arrachequesne
13cc07d6ad refactor: use prettier to format code 2020-09-17 14:31:06 +02:00
Damien Arrachequesne
d9bfcaeedb test: add Node.js 12 and 14 in the build matrix
Node.js 8 is removed, as it is now EOL.

Note: the node_modules folder is cached by default
2020-09-17 14:30:34 +02:00
Damien Arrachequesne
1238ddb995 chore: add package-lock.json file 2020-09-17 12:14:57 +02:00
Damien Arrachequesne
130f28a43c refactor: rename clients and clientRooms methods
In Socket.IO glossary:

- a Client manages the low-level connection and can be associated with several Sockets
- a Socket belongs to a given Namespace
2020-09-16 22:27:27 +02:00
Damien Arrachequesne
53ed3f4099 feat: use ES6 Sets and Maps
The sids and the rooms objects are now Map<string, Set<string>>:

sids => Map<SocketId, Set<Room>>
rooms => Map<Room, Set<SocketId>>

Breaking changes: the clients() and clientRooms() methods will now
return a Set instead of an array.

Also, the rooms argument in the broadcast() method will now be a Set
too.

Besides, the callbacks were removed from all function signatures, as
every operation is synchronous. Regarding the Redis adapter, the
clients() method is the only operation which will now return a promise.

This change allows us to remove the Room class, which was used to have
an external length attribute (instead of computing Object.keys()
everytime).
2020-09-16 22:19:56 +02:00
Damien Arrachequesne
a05379b1e8 test: use eiows
The eiows package is the published version of [1], which is a fork of
uws (a performant WebSocket server written in C++ with bindings for
Node.js).

[1] https://github.com/mmdevries/uws
2020-09-14 22:20:36 +02:00
Damien Arrachequesne
428b4f5200 docs: update links to other repositories 2020-09-14 22:04:49 +02:00
Damien Arrachequesne
ec83022ef4 docs: update examples with ES6 syntax 2020-09-14 22:00:40 +02:00
Damien Arrachequesne
609223959c docs: update latency example
The enchilada module fails to bundle the Engine.IO client, so we'll
just import the published bundle.

The exception seems to come from debug:

> Spread must be the final element of an element list
2020-09-11 02:40:28 +02:00
Damien Arrachequesne
70b1c36be1 chore(release): 4.0.0
Diff: https://github.com/socketio/engine.io/compare/v4.0.0-alpha.1...4.0.0
Full diff: https://github.com/socketio/engine.io/compare/3.4.0...4.0.0
2020-09-11 00:59:57 +02:00
Damien Arrachequesne
851c1177fc chore(release): 4.0.1
Diff: https://github.com/socketio/engine.io-parser/compare/4.0.0...4.0.1
2020-09-11 00:49:45 +02:00
Damien Arrachequesne
886f9ea7c4 fix: use a terser-compatible representation of the separator
By default, terser (the mangler used by webpack) will replace the '\x1e'
by an unreadable character in the optimized output.

One solution would be to use the 'ascii_only' option:

```
module.exports = {
  optimization: {
    minimize: true,
    minimizer: [
      new TerserPlugin({
        terserOptions: {
          output: {
            ascii_only: true
          }
        }
      })
    ]
  }
};
```

But it would require anyone who tries to bundle the engine.io client to
use this plugin, so we'll rather use String.fromCharCode().

Note: String.fromCharCode(30) === '\u001e' === '\x1e'
2020-09-11 00:24:56 +02:00
Damien Arrachequesne
9df38d57fb docs: update the list of supported engines
As Node.js 8 is now EOL.
2020-09-10 15:52:32 +02:00
Damien Arrachequesne
078527a384 feat: disable perMessageDeflate by default
The WebSocket permessage-deflate extension, while useful is some cases,
adds some extra memory overhead for each WebSocket connection, and
results in huge memory usage in production deployments.

It will now be disabled by default.
2020-09-10 15:46:04 +02:00
Damien Arrachequesne
54c67978d5 docs: update the default value of maxHttpBufferSize
Following 734f9d1268
2020-09-10 15:22:43 +02:00
Damien Arrachequesne
1916d3ae62 test: remove Node.js 8 from the test matrix
Reference: https://github.com/nodejs/Release
2020-09-10 15:20:00 +02:00
Damien Arrachequesne
14ca7a1cfc chore: restore package-lock.json file
The package-lock.json file was removed in the previous commit, in order
to sync the client version when upgrading the parser (and make the
tests pass).
2020-09-09 02:09:44 +02:00
Damien Arrachequesne
ed29e5955d chore: bump engine.io-parser version
See also: https://github.com/socketio/engine.io-protocol#difference-between-v3-and-v4

Release: https://github.com/socketio/engine.io-parser/releases/tag/4.0.0
Diff: https://github.com/socketio/engine.io-parser/compare/2.2.0...4.0.0
2020-09-09 00:00:25 +02:00
Damien Arrachequesne
01df755d4b docs: update README 2020-09-08 23:30:51 +02:00
Damien Arrachequesne
ebf6e8cd49 chore(release): 4.0.0
Diff: https://github.com/socketio/engine.io-parser/compare/v4.0.0-alpha.1...v4.0.0
2020-09-08 23:15:39 +02:00
Damien Arrachequesne
03b49674e6 chore: bump cookie version
Release: https://github.com/jshttp/cookie/releases/tag/v0.4.0
Diff: https://github.com/jshttp/cookie/compare/v0.3.1...v0.4.1
2020-09-08 02:47:18 +02:00
Damien Arrachequesne
eb2d8cc4c6 test: add Node.js 14 in the test matrix
Ref: https://github.com/nodejs/Release
2020-09-08 01:31:17 +02:00
Damien Arrachequesne
8edf2d1478 fix: keep track of the buffer initial length
The write buffer is mutable, so its initial length must be saved when
encoding the payload.
2020-09-08 01:30:32 +02:00
Damien Arrachequesne
6efedfa0f3 feat: restore the upgrade mechanism
See 660263fae2
2020-09-08 01:30:32 +02:00
Damien Arrachequesne
66287d919f test: pin the Node.js version for the browser tests
The build fails with Node.js 12. Let's pin the version for now, we'll
investigate later.
2020-09-08 01:30:21 +02:00
dependabot[bot]
373886f195 chore: bump elliptic from 6.5.2 to 6.5.3 (#115)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-07 13:23:44 +02:00
Damien Arrachequesne
660263fae2 docs: restore the upgrade mechanism in v4
After re-reading the goals of Engine.IO [1], it seems the upgrade
mechanism is better for the user experience, so we'll keep that way.

[1] https://github.com/socketio/engine.io#goals
2020-09-07 13:18:54 +02:00
Damien Arrachequesne
e0b35d054f docs: points towards the website
The website is now much more stable, so there's no need to keep two
copies of the same content (which must be manually kept in sync).
2020-09-01 09:37:29 +02:00
Damien Arrachequesne
a66f083d3e docs(examples): add create-react-app example
Related: https://github.com/socketio/socket.io-client/issues/1330
2020-07-09 11:32:48 +02:00
Damien Arrachequesne
f5a8f52f19 docs(examples/react-native): update video 2020-06-05 21:36:15 +02:00
Damien Arrachequesne
7a219f9459 docs(examples/react-native): add example with React Native
Includes e5bc1063cc
2020-06-05 08:57:04 +02:00
Damien Arrachequesne
5d16319692 docs(examples/webpack-build-server): update engine.io version
In order to include [0], which fixes the following error:

ERROR in ./node_modules/engine.io/lib/server.js
Module not found: Error: Can't resolve 'uws' in '/media/damien/git/other-bets/socket.io-parent/socket.io/examples/webpack-build-server/node_modules/engine.io/lib'
 @ ./node_modules/engine.io/lib/server.js 107:27-41
 @ ./node_modules/engine.io/lib/engine.io.js
 @ ./node_modules/socket.io/lib/index.js
 @ ./lib/index.js

[0] 85e544afd9
2020-06-04 16:36:19 +02:00
Damien Arrachequesne
09708eb307 docs(changelog): include changelog for release 3.4.2
Merged from the 3.4.x branch.
2020-06-04 16:23:05 +02:00
Damien Arrachequesne
82cdca23ba fix: remove implicit require of uws
So that bundlers like webpack do not try to include it in the build.

As a side-effect, any implementation which matches the API of the ws
module can now be used.

Before that change, you had to explicitly exclude uws:

```
// webpack.config.js
module.exports = {
  // ...
  externals: {
     uws: 'uws'
  }
};
```

Related: https://github.com/socketio/engine.io/issues/575
2020-06-04 14:24:42 +02:00
Damien Arrachequesne
8f90ba9c67 docs(examples): add example with passport authentication 2020-05-22 08:36:43 +02:00
Damien Arrachequesne
3dd2a0ea41 chore(release): 4.0.0-alpha.1
Diff: https://github.com/socketio/engine.io-parser/compare/v4.0.0-alpha.0...v4.0.0-alpha.1
2020-05-19 15:15:20 +02:00
Damien Arrachequesne
cab7db0404 feat: implement the version 4 of the protocol
See https://github.com/socketio/engine.io-protocol for the list of
changes.

Note: The 'base64-arraybuffer' dependency must now be explicitly
included by the client (not needed by the server).
2020-05-19 15:07:53 +02:00
Damien Arrachequesne
cf3a759b89 docs: fix typo 2020-05-19 14:36:20 +02:00
Damien Arrachequesne
9806892ea5 docs: describe revision 4 of the protocol
This version is still subject to change, feedback is welcome!

The rationale behind the changes are listed in the relevant section.
2020-05-19 14:18:02 +02:00
Damien Arrachequesne
1aec01ab18 docs: add table of contents 2020-05-19 12:50:11 +02:00
Damien Arrachequesne
c725310be0 docs: add reference to version 2 2020-05-19 12:41:39 +02:00
Damien Arrachequesne
725d551b75 docs: add some additional examples for the protocol v3 2020-05-19 12:12:25 +02:00
Damien Arrachequesne
a8130ce3a9 chore: release 3.4.1
Diff: https://github.com/socketio/socket.io-parser/compare/3.4.0...3.4.1
2020-05-13 07:59:21 +02:00
bcaller
dcb942d24d fix: prevent DoS (OOM) via massive packets (#95)
When maxHttpBufferSize is large (1e8 bytes), a payload of length 100MB
can be sent like so:

99999991:422222222222222222222222222222222222222222222...

This massive packet can cause OOM via building up many many
`ConsOneByteString` objects due to concatenation:
99999989 `ConsOneByteString`s and then converting the massive integer to
a `Number`.

The performance can be improved to avoid this by using `substring`
rather than building the string via concatenation.

Below I tried one payload of length 7e7 as the 1e8 payload took so
long to process that it timed out before running out of memory.

```
==== JS stack trace =========================================

    0: ExitFrame [pc: 0x13c5b79]
Security context: 0x152fe7b808d1 <JSObject>
    1: decodeString [0x2dd385fb5d1] [/node_modules/socket.io-parser/index.js:~276] [pc=0xf59746881be](this=0x175d34c42b69 <JSGlobal Object>,0x14eccff10fe1 <Very long string[69999990]>)
    2: add [0x31fc2693da29] [/node_modules/socket.io-parser/index.js:242] [bytecode=0xa7ed6554889 offset=11](this=0x0a2881be5069 <Decoder map = 0x3ceaa8bf48c9>,0x14eccff10fe1 <Very...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xa09830 node::Abort() [node]
 2: 0xa09c55 node::OnFatalError(char const*, char const*) [node]
 3: 0xb7d71e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xb7da99 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xd2a1f5  [node]
 6: 0xd2a886 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
 7: 0xd37105 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
 8: 0xd37fb5 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 9: 0xd3965f v8::internal::Heap::HandleGCRequest() [node]
10: 0xce8395 v8::internal::StackGuard::HandleInterrupts() [node]
11: 0x1042cb6 v8::internal::Runtime_StackGuard(int, unsigned long*, v8::internal::Isolate*) [node]
12: 0x13c5b79  [node]
```
2020-05-13 07:37:32 +02:00
Damien Arrachequesne
a5d04354e6 test: transpile to es5 with babelify 2020-05-13 07:23:37 +02:00
Damien Arrachequesne
94623c8f8b docs(changelog): include changelog for release 3.4.1
Merged from the 3.4.x branch.
2020-04-17 14:57:35 +02:00
Damien Arrachequesne
2a1aa1c59c docs(examples): bump dependencies
In order to include https://github.com/socketio/engine.io/releases/tag/3.4.1
2020-04-17 14:37:31 +02:00
Damien Arrachequesne
17747e4d69 docs(chat-example): bump dependencies
In order to include https://github.com/socketio/engine.io/releases/tag/3.4.1
2020-04-17 11:21:10 +02:00
Damien Arrachequesne
415332fc7c test: actually test empty payload handling (#113)
Fixes https://github.com/socketio/engine.io-parser/issues/112
2020-04-15 14:53:41 +02:00
Damien Arrachequesne
dcdbccb3dd fix: ignore errors when forcefully closing the socket (#601)
In order to catch the following errors:

```
events.js:288
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at afterWriteDispatched (internal/stream_base_commons.js:154:25)
    at writeGeneric (internal/stream_base_commons.js:145:3)
    at Socket._writeGeneric (net.js:780:11)
    at Socket._write (net.js:792:8)
    at doWrite (_stream_writable.js:441:12)
    at writeOrBuffer (_stream_writable.js:425:5)
    at Socket.Writable.write (_stream_writable.js:316:11)
    at abortConnection (<myproject>/node_modules/engine.io/lib/server.js:506:12)
    at <myproject>/node_modules/engine.io/lib/server.js:353:7
    at Server.verify (<myproject>/node_modules/engine.io/lib/server.js:158:14)
    at Server.handleUpgrade (<myproject>/node_modules/engine.io/lib/server.js:351:8)
```

Closes https://github.com/socketio/engine.io/issues/596, https://github.com/socketio/engine.io/pull/598
2020-04-15 11:42:31 +02:00
Damien Arrachequesne
281de9ed47 docs(tweet-stream-example): migrate example
From https://github.com/darrachequesne/socket.io-tweet-stream
2020-04-14 10:17:47 +02:00
Damien Arrachequesne
edb95ea221 docs(whiteboard-example): update dependencies 2020-04-14 10:04:27 +02:00
Damien Arrachequesne
b74bb80122 docs(chat-example): remove dependency to the parent project 2020-04-14 09:56:42 +02:00
Damien Arrachequesne
71ece3ebf6 chore(release): 4.0.0-alpha.1 2020-02-12 08:33:47 +01:00
Damien Arrachequesne
b27215dcee chore(release): 4.0.0-alpha.0 2020-02-12 07:50:43 +01:00
Damien Arrachequesne
734f9d1268 feat: decrease the default value of maxHttpBufferSize
This change reduces the default value from 100 mb to a more sane 1 mb.

This helps protect the server against denial of service attacks by
malicious clients sending huge amounts of data.
2020-02-11 07:59:13 +01:00
Damien Arrachequesne
61b949259e feat: use the cors module to handle cross-origin requests
We'll now rely on the standard cors module (https://github.com/expressjs/cors),
instead of the custom implementation that is error-prone and not
really user-friendly.

Breaking change: the handlePreflightRequest option is removed by the
change.

Before:

```
new Server({
  handlePreflightRequest: (req, res) => {
    res.writeHead(200, {
      "Access-Control-Allow-Origin": 'https://example.com',
      "Access-Control-Allow-Methods": 'GET',
      "Access-Control-Allow-Headers": 'Authorization',
      "Access-Control-Allow-Credentials": true
    });
    res.end();
  }
})
```

After:

```
new Server({
  cors: {
    origin: "https://example.com",
    methods: ["GET"],
    allowedHeaders: ["Authorization"],
    credentials: true
  }
})
```
2020-02-11 07:54:25 +01:00
Damien Arrachequesne
bafe684a19 refactor: refactor the handling of the options 2020-02-10 12:07:41 +01:00
Damien Arrachequesne
61e639b257 test: add Node.js 10, 12 and 13 in the test matrix
uws is no longer maintained, and did not support Node.js >= 10.

We now use a fork in order to support the newer versions of Node.js.
It is maintained there: https://github.com/mmdevries/uws

And can be installed with: `npm i github:mmdevries/uws#2.4.1`

We could also try to support uWebSockets.js, but it does not have the
same API as ws.

The "engines" attribute has also been added in the package.json file,
since we broke the support for Node.js 6 in the latest minor release.

Source: https://github.com/mmdevries/uws
Related: https://github.com/socketio/engine.io/pull/583
2020-02-06 13:36:13 +01:00
Damien Arrachequesne
a374471d06 feat: disable cookie by default and add sameSite attribute
The cookie might be used for sticky-session, but is not mandatory so it
makes sense to disable it by default.

The change also add a SameSite=Lax attribute by default.

Breaking change: the syntax has changed from

```
new Server({
  cookieName: "test",
  cookieHttpOnly: false,
  cookiePath: "/custom"
})
```

to

```
new Server({
  cookie: {
    name: "test",
    httpOnly: false,
    path: "/custom"
  }
})
```

All other options (domain, maxAge, sameSite, ...) are now supported.

Reference: https://github.com/jshttp/cookie#options-1
2020-02-05 08:33:00 +01:00
Damien Arrachequesne
7f5a903f91 chore(release): 4.0.0-alpha.0 2020-02-04 12:36:20 +01:00
Damien Arrachequesne
31ff87593f feat: reverse the ping-pong mechanism
The ping packets will now be sent by the server, because the timers set
in the browsers are not reliable enough. We suspect that a lot of
timeout problems came from timers being delayed on the client-side.

Breaking change: v3.x clients will not be able to connect anymore (they
will send a ping packet and timeout while waiting for a pong packet).

Related: https://github.com/socketio/engine.io/issues/312
2020-02-04 12:31:44 +01:00
Damien Arrachequesne
840145d3e5 test: add node.js 12 in the test matrix
See https://github.com/nodejs/Release
2020-01-15 08:52:14 +01:00
Damien Arrachequesne
50853738e0 fix: properly decode binary packets
This fixes the previous commit, allowing to properly decode binary packets in the browser (based on
the binaryType attribute).
2020-01-15 00:00:33 +01:00
Damien Arrachequesne
2ae2520a34 chore: point towards the v4 branch 2020-01-14 23:08:07 +01:00
Damien Arrachequesne
f3c291fa61 feat: generateId method can now return a Promise
Related:

- https://github.com/socketio/engine.io/issues/538
- https://github.com/socketio/engine.io/pull/535
2020-01-14 21:58:42 +01:00
Damien Arrachequesne
33564b2391 refactor: use prettier to format code 2020-01-14 21:58:38 +01:00
Damien Arrachequesne
a947ae59a2 feat: remove packet type when encoding binary packets
Only packets of 'message' type can contain binary data, so it makes sense to remove the prefix in
order to avoid the concatenation of the packet type.

Breaking change: the packet containing binary data will now be sent without any transformation

Protocol v3: { type: 'message', data: <Buffer 01 02 03> } => <Buffer 04 01 02 03>
Protocol v4: { type: 'message', data: <Buffer 01 02 03> } => <Buffer 01 02 03>
2020-01-14 21:54:05 +01:00
Damien Arrachequesne
8eb58a689a refactor: remove Object.keys polyfill
This polyfill is now useless, as we do not plan to support IE < 9 anymore.
2020-01-14 21:54:05 +01:00
Damien Arrachequesne
744bf40d4f refactor: migrate to ES6 syntax and use prettier to format code 2020-01-14 13:28:12 +01:00
Damien Arrachequesne
da93fb6ef3 refactor: migrate to ES6 syntax 2020-01-12 22:47:18 +01:00
Damien Arrachequesne
ae23c7ef4c [chore] release 1.1.2 2019-11-25 13:19:48 +01:00
Joway
b9074fa36f [fix] fix memory leak when leave a room after socket close (#58) 2019-11-25 13:14:47 +01:00
Darío Hereñú
f7ab50cc59 [docs] Remove duplicate word (#57) 2019-11-25 13:13:53 +01:00
Damien Arrachequesne
661f1e7fac [chore] Release 2.3.0
Diff: https://github.com/socketio/socket.io-client/compare/2.2.0...2.3.0
2019-09-20 12:22:41 +02:00
Damien Arrachequesne
47161a65d4 [chore] Release 2.3.0
Diff: https://github.com/socketio/socket.io/compare/2.2.0...2.3.0
2019-09-20 12:18:39 +02:00
Damien Arrachequesne
71d7b79965 [chore] Bump engine.io-client to version 3.4.0
Also includes the bump of the debug dependency.

Diff: https://github.com/socketio/engine.io-client/compare/3.3.1...3.4.0
2019-09-20 12:02:21 +02:00
Lukas Drgon
8b4a539e7a [docs] Add CDN link (#1318) 2019-09-20 12:01:51 +02:00
Damien Arrachequesne
40cf185574 [ci] use Node.js 10 for compatibility with Gulp v3
It seems Node.js 12 (which is now 'latest') does not work with Gulp v3. In the future, we will
either have to migrate to Gulp v4, or remove Gulp from the build system.
2019-09-20 11:25:13 +02:00
Damien Arrachequesne
cf39362014 [chore] Bump socket.io-parser to version 3.4.0
Diff: https://github.com/socketio/socket.io-parser/compare/3.3.0...3.4.0
2019-09-20 11:04:11 +02:00
Damien Arrachequesne
652402a856 [chore] Release 3.4.0
The build failure is due to some ES6 usage in the debug dependency, which will have to be fixed
in the future (by using Babel for example).

Diff: https://github.com/socketio/socket.io-parser/compare/3.3.0...3.4.0
2019-09-20 11:00:03 +02:00
Dimitar Nestorov
9b3572ea23 [chore] Bump debug to version 4.1.0 (#92) 2019-09-20 10:51:26 +02:00
flaambe
4d01b2c84c test: remove deprecated Buffer usage (#3481) 2019-09-20 10:50:12 +02:00
Jonatan Juárez
82271921db [docs] Fix the default value of the 'origins' parameter (#3464)
Fix documentation about default origins value. The default should read `*:*` instead of `*
2019-09-20 10:37:54 +02:00
Damien Arrachequesne
1150eb50e9 [chore] Bump engine.io to version 3.4.0
Diff: https://github.com/socketio/engine.io/compare/3.3.1...3.4.0
2019-09-20 10:31:25 +02:00
Damien Arrachequesne
ecfcc69a7a [chore] Release 3.4.0
Diff: https://github.com/socketio/engine.io/compare/3.3.2...3.4.0
2019-09-13 13:51:49 +02:00
Damien Arrachequesne
7bf75812c3 [chore] Bump engine.io-parser to version 2.2.0
Diff: https://github.com/socketio/engine.io-parser/compare/2.1.3...2.2.0
2019-09-13 13:46:43 +02:00
Yosi Attias
c471e03e09 [chore] Bump ws to latest version (#587) 2019-09-13 11:24:48 +02:00
Brian Kopp
c144895133 [feat] add additional debug messages (#586)
These additional messages will help more quickly diagnose the reason for error messages.
2019-09-13 11:21:37 +02:00
Dimitar Nestorov
a967626a1d [chore] Bump debug to version 4.1.0 (#581) 2019-09-13 11:19:02 +02:00
Damien Arrachequesne
f1ce1abdbb [chore] Release 2.2.0
Diff: https://github.com/socketio/engine.io-parser/compare/2.1.3...2.2.0
2019-09-13 11:06:09 +02:00
Gaubee
47893e1145 [perf] use Buffer.from instead of manually copying the ArrayBuffer (#108)
Ref: https://nodejs.org/docs/latest/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length
2019-09-13 11:01:01 +02:00
Matthias Ludwig
72f7463be9 [test] fix a typo in the tests (#111)
should encode payloads as string: there is no type 'post'.
2019-09-13 10:50:31 +02:00
Matthias Ludwig
e9a20cb1ca [test] ensure the message packet is properly coerced to string (#110)
result is string '1' not number1
2019-09-13 10:49:08 +02:00
Damien Arrachequesne
5bbbfe2411 [ci] remove Node.js 4 and 6 from the build matrix
We keep Node.js 9 for compatibility with the 'uws' dependency (as Node.js 10 fails), but we'll
upgrade later.
2019-09-13 10:34:57 +02:00
Oliver Salzburg
ad844f4b32 [fix] Deprecated Buffer usage in dependency (#585)
The `Buffer` constructor has been deprecated in favor of safer alternatives.
See https://nodejs.org/en/docs/guides/buffer-constructor-deprecation/

This was fixed in base64id@2.0.0
2019-06-18 08:51:50 +02:00
vendethiel
6bd7817e8a Remove bower, update history, release 1.3.0 2019-04-15 22:41:56 +02:00
vendethiel
3ab04d399d update nodejs versions for travis 2019-04-15 22:35:47 +02:00
ven
6ef9d2cda2 Merge pull request #73 from STRML/noDeopt
Prevent v8 deopt when using [].slice.call(arguments)
2019-04-09 15:29:01 +02:00
Damien Arrachequesne
569759fc8c [perf] Add a benchmark for encoding / decoding 2019-03-19 23:56:03 +01:00
Damien Arrachequesne
df387fc593 [chore] Update Makefile 2019-03-19 23:56:03 +01:00
Damien Arrachequesne
aedf8eb29e [refactor] Use Buffer.allocUnsafe instead of new Buffer (#104)
Breaking change: drop support for Node.js 4 (since Buffer.allocUnsafe was added in v5.10.0)

Reference: https://nodejs.org/docs/latest/api/buffer.html#buffer_class_method_buffer_allocunsafe_size
2019-03-19 23:56:03 +01:00
Grant Timmerman
9c1e73c752 [chore] Update the license of the chat example (#3410)
There was no obvious reason to use BSD instead of MIT for that very basic chat app.

Closes #3411
2019-03-15 22:22:22 +01:00
Damien Arrachequesne
cb0ac6fddc [chore] Release 3.3.2 2018-11-29 22:51:12 +01:00
Damien Arrachequesne
ec4e12a063 [revert] Allow configuration of Access-Control-Allow-Origin value (#511)
This reverts commit ebf1a96f42.

Related: https://github.com/socketio/socket.io/issues/3381
2018-11-29 22:49:34 +01:00
Damien Arrachequesne
3020e455ab [chore] Release 2.2.0 2018-11-29 00:15:03 +01:00
Damien Arrachequesne
df05b73bb9 [chore] Release 2.2.0 2018-11-29 00:00:45 +01:00
Damien Arrachequesne
06e9a4ca26 [chore] Bump dependencies
- engine.io-client: https://github.com/socketio/engine.io-client/compare/3.2.0...3.3.1
- socket.io-parser: https://github.com/socketio/socket.io-parser/compare/3.2.0..3.3.0
2018-11-28 22:51:53 +01:00
Damien Arrachequesne
4a93871496 [chore] Update the Makefile 2018-11-28 22:48:39 +01:00
Damien Arrachequesne
eeafa44d01 [fix] Remove any reference to the global variable
Related: https://github.com/socketio/socket.io-client/issues/1166
2018-11-28 22:48:12 +01:00
Markko Legonkov
b00ae50be6 [feat] Add cache-control header when serving the client source (#2907) 2018-11-20 08:02:04 +01:00
Nadir Hussain Laskar
d3c653d876 [docs] Add Touch Support to the whiteboard example (#3104) 2018-11-20 08:01:09 +01:00
Antonio
a7fbd1ac4a [fix] Throw an error when trying to access the clients of a dynamic namespace (#3355)
Accessing the clients of a dynamic namespace throws because doing `io.of(/your-regex/g)` returns a namespace with no adapter and the clients methods tries to access `namespace.adapter.clients`.
2018-11-20 07:40:11 +01:00
Damien Arrachequesne
190d22b46e [chore] Bump dependencies
- engine.io: https://github.com/socketio/engine.io/compare/3.2.0...3.3.1
- socket.io-parser: https://github.com/socketio/socket.io-parser/compare/3.2.0..3.3.0
2018-11-20 07:33:41 +01:00
Damien Arrachequesne
7b8fba7ea2 [test] Update Travis configuration
Reference: https://github.com/nodejs/Release
2018-11-20 07:32:39 +01:00
Damien Arrachequesne
dfc34e482c [chore] Pin zuul version
The CI seems to fail with the new version:

/home/travis/build/[secure]io/engine.io-client/node_modules/zuul/bin/zuul:332
            throw err.message;
            ^
internet explorer@8: [eval("(window.zuul_msg_bus ? window.zuul_msg_bus.splice(0, 1000) : []);")] Not JSON response
2018-11-19 22:59:59 +01:00
JinHyuk Kim
de1fd36dc9 [docs] Fix incorrect socket.io-protocol version in Readme (#89)
Ref: https://github.com/socketio/socket.io-protocol
2018-11-19 22:31:13 +01:00
Damien Arrachequesne
64d6044659 [chore] Release 3.3.1 2018-11-19 22:27:16 +01:00
Oliver Salzburg
9956445251 [fix] Replace deprecated Buffer usage (#565)
The `Buffer` constructor has been deprecated in favor of safer alternatives.
See https://nodejs.org/en/docs/guides/buffer-constructor-deprecation/
2018-11-19 22:22:13 +01:00
Damien Arrachequesne
e081616a3f [chore] Point towards branch 'develop' of engine.io-client 2018-11-19 22:15:19 +01:00
Emmanuel DEMEY
e5f0ceaee0 [docs] Use new JavaScript syntax inside the README (#3360) 2018-11-08 00:26:54 +01:00
Damien Arrachequesne
2c856caf03 [chore] Release 3.3.0 2018-11-08 00:21:51 +01:00
Damien Arrachequesne
0de72b9cc2 [chore] Release 3.3.0 2018-11-07 23:58:21 +01:00
Damien Arrachequesne
b47efb270d [fix] Remove any reference to the global variable
Related: https://github.com/socketio/socket.io-client/issues/1166
2018-11-07 23:31:49 +01:00
Damien Arrachequesne
d95e38f6b6 [chore] Update the Makefile 2018-11-07 23:16:54 +01:00
Damien Arrachequesne
b57e06304e [test] Update travis configuration 2018-11-07 23:15:29 +01:00
JinHyuk Kim
48f340ec12 [refactor] Fix a small typo and code styling (#88) 2018-11-07 22:53:25 +01:00
Damien Arrachequesne
3e2f415f49 [chore] Bump ws to version 6.1.0 (#564) 2018-11-02 07:39:38 +01:00
Jacco Flenter
ebf1a96f42 [feat] Allow configuration of Access-Control-Allow-Origin value (#511)
It's now possible to specify an origins value (default value is '*') when initialising the engine. This value will be returned as the Access-Control-Allow-Origin value.

Related: #449
2018-11-02 07:38:16 +01:00
Damien Arrachequesne
0151c6a684 [chore] Release 3.2.1 2018-11-02 07:29:08 +01:00
shapel
bc7b2393de [fix] Processing error code on abort connection (#562)
Fixes #561
2018-11-02 07:25:53 +01:00
Damien Arrachequesne
021a7dc751 [docs] Point the status badge towards the master branch 2018-11-02 06:20:43 +01:00
Damien Arrachequesne
1f2fc43d74 [chore] Release 2.1.3 2018-11-01 06:44:53 +01:00
Amit Portnoy
19694042f5 [chore] Update to blob@0.0.5 (avoid reference to 'global') (#107)
Source: https://github.com/amitport/blob/releases/tag/v0.0.5

Closes #99 
Related https://github.com/socketio/socket.io-client/issues/1166
2018-11-01 06:31:42 +01:00
Damien Arrachequesne
2377dcc613 [fix] Do not mutate the input upon packet encoding (#105)
Fixes #95
2018-11-01 06:26:16 +01:00
Damien Arrachequesne
ebdf467371 [test] Add a basic test for UTF-8 encoding/decoding (#106) 2018-11-01 06:26:13 +01:00
Damien Arrachequesne
e184cac0fa [chore] Pin zuul version
The CI fails with the new version: https://travis-ci.org/socketio/engine.io-parser/jobs/448690970

> /home/travis/build/[secure]io/engine.io-parser/node_modules/zuul/bin/zuul:332
>             throw err.message;
>             ^
> internet explorer@8: [eval("(window.zuul_msg_bus ? window.zuul_msg_bus.splice(0, 1000) : []);")] Not JSON response
2018-10-31 07:50:51 +01:00
Damien Arrachequesne
d848f0fc82 [refactor] Remove any reference to the global variable (#103)
Related #99
2018-10-31 06:23:32 +01:00
Damien Arrachequesne
3bc16f5938 [refactor] Remove custom exports from utf8.js file (#102)
AMD and browser exports are useless here.
2018-10-31 06:23:08 +01:00
Damien Arrachequesne
ecf0c1465c [test] Update travis configuration (#101) 2018-10-31 06:02:03 +01:00
Damien Arrachequesne
916e4bbc45 [chore] Bump dev dependencies (#100) 2018-10-31 06:01:29 +01:00
Damien Arrachequesne
7e35f901b8 [docs] fix this scope in the chat example
`user is typing` messages were not properly removed

Closes #3291
2018-08-28 09:05:44 +02:00
Damien Arrachequesne
2258c034fa [chore] Update issue template 2018-08-21 13:22:38 +02:00
Damien Arrachequesne
2dbec77a38 [chore] Update issue template 2018-08-21 13:21:14 +02:00
Andrew Stelmach
d97d873aee [docs] update README.md (#3309) 2018-08-18 23:32:07 +02:00
Damien Arrachequesne
8372591652 [chore] Release 2.1.1 2018-05-17 23:23:01 +02:00
Damien Arrachequesne
e0b2cb0c5a [chore] Release 2.1.1 2018-05-17 23:22:49 +02:00
Nicolas Ettlin
23000b7995 [docs] Add a link to the npm package in the README (#1195) 2018-05-17 22:54:49 +02:00
Damien Arrachequesne
0fe9439ff6 [fix] Fire an error event on middleware failure for non-root namespace (#1202)
In the following example:

```js
io.use((socket, next) => {
  next(new Error('Auth failed'));
});

// client-side
const socket = io('https://url/custom-namespace');

socket.on('error', (err) => {
  // ...
});
```

The 'error' event wasn't fired on the custom namespace.
2018-05-17 22:53:37 +02:00
JinHyuk Kim
6a16ea1192 [test] Remove unnecessary assertion in test case (#556) 2018-04-30 07:39:40 +02:00
Sleiman Sleiman
1decae341c [feat] Add local flag to the socket object (#3219)
To match the behaviour on the namespace (see #2628).
2018-04-27 13:03:25 +02:00
Donut
0279c47c8c [docs] Convert the chat example to ES6 (#3227) 2018-04-27 13:00:27 +02:00
Damien Arrachequesne
2917942b3e [docs] Clarify private messaging in the emit cheatsheet (#3232)
The previous version was confusing, as `socket.to(socket.id).emit()` does nothing.

Fixes #3220
2018-04-27 12:50:31 +02:00
Damien Arrachequesne
3eb047fcfd [chore] Release 2.1.0 2018-03-29 23:30:40 +02:00
Damien Arrachequesne
db831a3de4 [chore] Release 2.1.0 2018-03-29 23:30:03 +02:00
Damien Arrachequesne
afb952d854 [docs] Add a note about reconnecting after a server-side disconnection 2018-03-29 23:15:47 +02:00
Damien Arrachequesne
ac945d1eba [feat] Add support for dynamic namespaces (#3195)
This follows #3187, with a slightly different API.

A dynamic namespace can be created with:

```js
io.of(/^\/dynamic-\d+$/).on('connect', (socket) => { /* ... */ });
```
2018-03-29 23:08:08 +02:00
Scott Gress
ad0c052eff [docs] Add note in docs for origins(fn) about error needing to be a string. (#2895) 2018-03-10 09:03:28 +01:00
Damien Arrachequesne
1f1d64bab6 [fix] Include the protocol in the origins check (#3198)
Previously, the protocol was not taken in account, which caused the following behaviour:

```js
io.origins('https://foo.example.com:443'); // ok as a string
io.origins(['https://foo.example.com:443'); // not ok as an array
```

Fixes #3190
2018-03-10 08:56:42 +01:00
Damien Arrachequesne
f4fc517e0f [fix] Properly emit 'connect' when using a custom namespace (#3197)
When using a custom namespace with a middleware, the client did not receive the 'connect' event.

Fixes #3082
2018-03-10 08:51:22 +01:00
Damien Arrachequesne
74893d53ca [feat] Add a 'binary' flag (#1194)
So that the call to the `has-binary` method can be skipped. Usage:

```
// with binary data
socket.binary(true).emit("binary", obj);

// without binary data
socket.binary(false).emit("string", obj);

// call to hasBin
socket.emit("guess", obj);
```
2018-03-10 07:49:12 +01:00
Damien Arrachequesne
9701611427 [chore] Bump engine.io-client to version 3.2.0 (#1192) 2018-03-01 20:20:59 +01:00
Damien Arrachequesne
3d8f24e94f [test] Update travis configuration 2018-03-01 02:23:26 +01:00
Aaron Ogata
e27f38bb68 [chore] Restore unminified distribution files (#1191) 2018-03-01 01:08:11 +01:00
Julian Grinblat
bb743c42f6 [docs] Document connected and disconnected socket properties (#1155) 2018-03-01 00:29:26 +01:00
Jumper Chen
be61ba0a20 [docs] Add link to a Dart client implementation (#2940) 2018-03-01 00:23:45 +01:00
Damien Arrachequesne
c0c79f019e [feat] Add support for dynamic namespaces (#3187) 2018-03-01 00:22:16 +01:00
Damien Arrachequesne
dea5214f21 [chore] Bump superagent and supertest versions (#3186) 2018-02-28 23:19:19 +01:00
Damien Arrachequesne
b1941d5dfe [chore] Bump engine.io to version 3.2.0 2018-02-28 23:10:40 +01:00
Miguel Piedrafita
a23007a635 [docs] Update license year (#3153) 2018-02-28 23:03:02 +01:00
Damien Arrachequesne
f48a06c040 [feat] Add a 'binary' flag (#3185)
So that the call to the `has-binary` method can be skipped. Usage:

```
// with binary data
socket.binary(true).emit("binary", obj);

// without binary data
socket.binary(false).emit("string", obj);

// call to hasBin
socket.emit("guess", obj);
```
2018-02-28 23:00:16 +01:00
Damien Arrachequesne
0539a2c4fd [test] Update travis configuration 2018-02-28 22:56:28 +01:00
Damien Arrachequesne
6e400188be [chore] Release 3.2.0 2018-02-28 22:08:38 +01:00
Damien Arrachequesne
92c530da47 [fix] Properly handle JSON.stringify errors (#84)
JSON.stringify method throws when passed a circular object.
2018-02-28 22:07:33 +01:00
Damien Arrachequesne
dc4f475a45 [revert] Move binary detection to the parser
So that we can skip the binary check.
2018-02-28 21:55:26 +01:00
Damien Arrachequesne
f115039068 [test] Update travis configuration 2018-02-28 21:19:36 +01:00
Damien Arrachequesne
6b356eb4f0 [fix] Properly detect typed arrays (#85)
ArrayBuffer.isView method is not defined in IE10.
2018-02-28 21:18:16 +01:00
Damien Arrachequesne
d93ef6aeb9 [docs] Add some initialization examples in the README 2018-02-28 13:14:54 +01:00
Damien Arrachequesne
52ebe41832 [chore] Release 3.2.0 2018-02-28 01:31:24 +01:00
Damien Arrachequesne
c6247514e2 [revert] Make generateId method async (#535)
That is a breaking change, which mandates a major bump.
2018-02-27 22:03:49 +01:00
Damien Arrachequesne
be3833bddd [refactor] Use Buffer.concat([]) to construct an empty buffer (#555) 2018-02-27 22:03:31 +01:00
Damien Arrachequesne
65b1ad1b8a [chore] Update default values for pingTimeout (#551)
`pingTimeout` now defaults to 5 seconds instead of 60 seconds.
2018-02-27 22:03:16 +01:00
Damien Arrachequesne
25c4dd115d [test] Update travis configuration 2018-02-27 21:29:29 +01:00
Devlin Pajaron
c06ac071d0 [docs] Fix typo (#3157) 2018-02-25 09:26:24 +01:00
Damien Arrachequesne
f31837fdf2 [chore] Bump debug to version 3.1.0 2018-02-25 09:24:23 +01:00
Damien Arrachequesne
52b09609db [chore] Bump debug to version 3.1.0 2018-02-25 09:22:40 +01:00
Damien Arrachequesne
f9c06255de [chore] Release 3.1.3 2018-02-25 09:20:05 +01:00
Damien Arrachequesne
f0a7df1059 [fix] Ensure packet data is an array (#83)
Related: https://github.com/socketio/socket.io/pull/3140
2018-02-25 09:05:16 +01:00
Damien Arrachequesne
88225783f7 [fix] Use ArrayBuffer.isView to check for typed arrays (#82) 2018-02-25 09:04:02 +01:00
Damien Arrachequesne
dd164e6a5f [chore] Bump debug to version 3.1.0 2018-02-18 11:50:26 +01:00
Damien Arrachequesne
63e2528656 [chore] Release 3.1.5
Cherry-picked from 3.1.x branch.
2018-02-18 11:47:19 +01:00
Damien Arrachequesne
b1fa020675 [chore] Revert to ws as default wsEngine (#550)
Related:
- https://github.com/socketio/socket.io/issues/2956
- https://github.com/socketio/socket.io/issues/3100

Fixes #536
Fixes #516
Fixes #474
2017-12-29 22:39:34 +01:00
Damien Arrachequesne
d50bf873a6 [chore] Bump dependencies (#549)
- debug to version 3.1.0
- babel-eslint to version 8.0.2
- mocha to version 4.0.1
- superagent to version 3.8.1
2017-12-28 23:30:04 +01:00
Damien Arrachequesne
e867117708 [chore] Release 2.1.2 2017-12-28 23:05:40 +01:00
Damien Arrachequesne
eeb0653ebb [refactor] Remove useless entry point (#98) 2017-12-28 22:50:15 +01:00
Damien Arrachequesne
275a9cbdb7 [test] Cache node_modules directory (#97) 2017-12-28 22:49:58 +01:00
Damien Arrachequesne
4eb4c9d2e4 [chore] Bump arraybuffer.slice to version 0.0.7 (#96) 2017-12-28 22:49:29 +01:00
Andrew Nesbitt
3b0aef0c7b [chore] Bump accepts to version 1.3.4 (#548) 2017-12-27 22:52:58 +01:00
Andrew Nesbitt
7a3c267af2 [docs] Update test command in README (#547) 2017-12-27 22:51:35 +01:00
ven
092199bf0e Merge pull request #74 from bripkens/master
Avoid memory leaks by removing event arrays
2017-11-29 00:29:16 +01:00
Damien Arrachequesne
112c304d7a [chore] Bump uws to version 9.14.0 (#545) 2017-11-22 22:10:05 +01:00
Nick Tazelaar
73e579a501 [refactor] Add some checks to prevent usage of undefined properties (#540) 2017-11-22 22:04:54 +01:00
Damien Arrachequesne
5308f1c3a0 [chore] Release 3.1.4 2017-11-22 22:00:55 +01:00
Luigi Pinca
3c59bed613 [chore] Bump ws to version 3.3.1 (#543)
Related: https://nodesecurity.io/advisories/550
2017-11-12 21:55:00 +01:00
Damien Arrachequesne
ebb0596ab0 [chore] Release 2.0.4 2017-10-22 15:17:13 +02:00
Damien Arrachequesne
1c108a35e4 [chore] Release 2.0.4 2017-10-22 15:16:29 +02:00
Damien Arrachequesne
57cee214fb [test] Remove IE6 and IE7 tests (#1164)
Related: https://wiki.saucelabs.com/pages/viewpage.action?pageId=70074721
2017-10-22 15:08:16 +02:00
efkan
2abb217e26 [feat] Make generateId method async (#535)
That change will allow to retrieve the client id asynchronously, from a database for example.
2017-10-20 08:00:29 +02:00
Thiago Santos
f333479080 [test] Use npm scripts instead of gulp (#3078) 2017-10-16 07:46:42 +02:00
Damien Arrachequesne
3ee803af72 [chore] Release 3.1.3 2017-10-11 07:59:04 +02:00
Damien Arrachequesne
49362abcd0 [fix] Fix undefined remoteAddress when using uws (#533)
Fixes https://github.com/socketio/socket.io/issues/2982
2017-10-11 07:29:52 +02:00
Damien Arrachequesne
3c7778015b [chore] Bump debug to version 2.6.9 (#532)
Related: https://nodesecurity.io/advisories/debug_regular-expression-denial-of-service
2017-10-10 08:47:27 +02:00
Carson McKinstry
3f611654f2 [docs] Fix a grammar mistake in the API docs (#3076) 2017-10-07 15:08:14 +02:00
Vyacheslav Aristov
e26b71c78e [docs] Fix typo in API docs (#3066) 2017-10-07 14:36:02 +02:00
Damien Arrachequesne
bf24359ed5 [chore] Release 3.1.2 2017-09-27 23:35:42 +02:00
Damien Arrachequesne
a8ff89cd14 [chore] Release 3.1.1 2017-09-02 14:23:20 +02:00
Damien Arrachequesne
e0d720c7f7 [fix] Check whether 'Origin' header has invalid characters (#531)
Since the 'Origin' header is used as response header, a value with invalid characters would trigger
'The header content contains invalid characters' errors.

Closes #517
2017-09-02 14:16:14 +02:00
Mark Bjerke
38d639a5d0 [fix] Use explicit require of wsEngine (#523)
Because WebPack does not support variables in require statements.

Closes #522
2017-09-02 14:12:26 +02:00
st0ck53y
f9d3f06299 [docs] Fix wsEngine default value in README (#526)
Merge #459 (release 2.0.0) changed default wsEngine to uws. Updating README to reflect this change.
2017-09-02 13:35:12 +02:00
Damien Arrachequesne
fd20b91208 [test] Use npm scripts instead of gulp (#530) 2017-09-01 14:21:57 +02:00
Raúl Montes
7f63d38b2a [fix] Fix undeterministic error in polling buffer processing (#529)
Ensure all assignments for chunks are Buffer when they should, even when onData is supposed to not
be called again.
2017-09-01 13:03:48 +02:00
Harutyun Amirjanyan
3dcc2d5cbd [fix] Use workaround for setEncoding bug in node 0.10+ (#527)
The server often crashes with 'TypeError: "list" argument must be an Array of Buffers' errors,
which is caused by a bug in new versions of node, where setEncoding call does not work for messages
that are already in the queue.

This pull request makes sure that concat is never called in the non binary case, even if
setEncoding does not work properly.
2017-08-31 22:49:18 +02:00
Haku
3386e155a8 [docs] Actually prevent input from having injected markup in chat example (#2987) 2017-08-27 08:40:26 +02:00
Stanley288
3684d590f5 [docs] Use path.join instead of concatenating paths (#3014) 2017-08-26 07:44:25 +02:00
Damien Arrachequesne
dd69abbeee [fix] Reset rooms object before broadcasting from namespace (#3039) 2017-08-26 07:36:26 +02:00
Damien Arrachequesne
1f0e64a6da [fix] Do not throw when receiving an unhandled error packet (#3038) 2017-08-26 07:35:57 +02:00
Damien Arrachequesne
6874ea4952 [chore] release 1.1.1 2017-08-02 14:01:58 +02:00
Sam Roberts
bdb015a6c1 [chore] remove unused 'debug' dependency (#52) 2017-08-02 13:51:58 +02:00
Gabriel Hautclocq
9d170a75d0 [docs] Add io.emit in the cheat sheet (#2992) 2017-07-01 07:57:34 +02:00
Damien Arrachequesne
c58ecfc4a7 [docs] Add code examples for registered events (#1139) 2017-06-23 08:33:04 +02:00
Damien Arrachequesne
e9ebe36db7 [docs] Add an example with ES6 import in the README (#1138) 2017-06-23 08:17:17 +02:00
Nicolas Coden
7199d1b6ef [docs] Fix misnamed 'Object.keys' in API docs (#2979) 2017-06-19 12:16:26 +02:00
Damien Arrachequesne
bf7afb14cb [docs] Update Webpack server example (#2976) 2017-06-15 23:40:43 +02:00
Damien Arrachequesne
410f5bcb8e [docs] Update API documentation (#2973) 2017-06-13 23:05:26 +02:00
Damien Arrachequesne
19f2b19900 [chore] Release 2.0.3 2017-06-12 14:06:59 +02:00
Damien Arrachequesne
65ece01135 [chore] Release 2.0.3 2017-06-12 14:05:46 +02:00
Damien Arrachequesne
db0c69969e [fix] Reset rooms object before broadcasting (#2970)
It seems packets could be delivered to wrong room in some case, if the
_rooms array was not reset before the next emit.
2017-06-12 14:01:35 +02:00
Damien Arrachequesne
94df7bcdfd [fix] Fix middleware initialization (#2969)
Fix "TypeError: Cannot convert undefined or null to object" when a
middleware is added before the engine is properly attached.
2017-06-12 14:00:48 +02:00
Ra'Shaun Stovall
9a014e2df4 [docs] Update slack badge (#2961)
Update badge to https://slackin-socketio.now.sh/badge.svg
2017-06-08 12:28:56 +02:00
Eli Flanagan
83fedf598a [docs] Add explicit documentation for websocket transport (#1128) 2017-06-08 12:24:56 +02:00
Damien Arrachequesne
2b10f1b3a4 [docs] Update webpack example (#2960) 2017-06-03 13:53:03 +02:00
Damien Arrachequesne
c0da119e55 [docs] Update documentation (#1124) 2017-06-03 07:59:37 +02:00
Damien Arrachequesne
a10dc8d92d [chore] Release 2.0.2 2017-06-01 14:01:24 +02:00
Damien Arrachequesne
c3c027086c [chore] Release 2.0.2 2017-06-01 14:00:42 +02:00
Damien Arrachequesne
d8644869fe [chore] Bump debug to version 2.6.8 (#1123) 2017-06-01 13:48:54 +02:00
Damien Arrachequesne
214a57fc5b [test] Launch browser tests on localhost by default (#1122) 2017-06-01 13:48:36 +02:00
Damien Arrachequesne
8091591422 [fix] Do not update the opts.query reference (#1121) 2017-06-01 12:35:31 +02:00
Damien Arrachequesne
2b216902e1 [fix] Fix timing issues with middleware (#2948)
Using a middleware could previously lead to a connecting client
receiving a connect event from the server before the server triggers
its own connect event.
2017-05-22 13:01:59 +02:00
Damien Arrachequesne
832b8fc6d9 [chore] Release 2.0.1 2017-05-09 01:40:46 +02:00
Damien Arrachequesne
4f71bd23de [chore] Release 2.0.1 2017-05-09 01:40:32 +02:00
Damien Arrachequesne
a0056904c1 [fix] Update path of client file (#2934) 2017-05-09 01:36:40 +02:00
Damien Arrachequesne
d30914d11b [chore] Release 2.0.0 2017-05-09 01:15:10 +02:00
Damien Arrachequesne
3367eaa948 [chore] Release 2.0.0 2017-05-09 01:09:19 +02:00
Damien Arrachequesne
6c0705f733 [docs] Add an example of custom parser (#2929) 2017-05-09 00:46:01 +02:00
Damien Arrachequesne
1980fb4a03 [chore] Merge history of 1.7.x and 0.9.x branches (#2930) 2017-05-09 00:45:17 +02:00
Xavier Damman
0d07c47f81 [chore] Added backers and sponsors on the README (#2933) 2017-05-09 00:41:46 +02:00
Damien Arrachequesne
9e7b543e13 [chore] Bump engine.io to version 3.1.0 (#1109) 2017-04-28 23:21:15 +02:00
Damien Arrachequesne
a086588747 [chore] Bump dependencies (#2926) 2017-04-28 22:33:40 +02:00
Damien Arrachequesne
442587e91a [chore] Bump dev dependencies (#1108) 2017-04-28 22:05:01 +02:00
Damien Arrachequesne
e76e035873 [fix] Fix null payload when aborting connection (#503) 2017-04-28 13:46:50 +02:00
Damien Arrachequesne
935b155c21 [chore] Release 3.1.0 2017-04-28 00:53:24 +02:00
Damien Arrachequesne
f9c3549dd1 [chore] Release 3.1.2 2017-04-27 23:46:00 +02:00
Damien Arrachequesne
82ed65f7c4 [test] Add test for maxHttpBufferSize option with websocket (#499) 2017-04-27 23:40:38 +02:00
Damien Arrachequesne
519fb8d596 [chore] Bump uws to version 0.14.4 (#501) 2017-04-27 23:37:26 +02:00
Damien Arrachequesne
425391ace9 [chore] Bump has-binary2 to version 1.0.2 (#70) 2017-04-27 23:06:57 +02:00
Damien Arrachequesne
e2422c300e [chore] Release 2.1.1 2017-04-27 23:05:31 +02:00
Damien Arrachequesne
f5819ccf58 [chore] Bump has-binary2 to version 1.0.2 (#93) 2017-04-27 23:03:54 +02:00
Damien Arrachequesne
b4f849a6fe [fix] Fix Blob detection for iOS 8/9 (#69) 2017-04-26 21:43:22 +02:00
Damien Arrachequesne
87b06ad362 [feat] Move binary detection to the parser (#2923) 2017-04-25 00:38:07 +02:00
Damien Arrachequesne
ff4cb3eed0 [feat] Move binary detection to the parser (#1103) 2017-04-25 00:28:50 +02:00
Damien Arrachequesne
eaee5d58c4 [chore] Release 3.1.1 2017-04-25 00:22:17 +02:00
Damien Arrachequesne
2f31a4e8f7 [fix] Ensure globals are functions before running instanceof (#68)
Following https://github.com/socketio/has-binary/pull/4.
2017-04-25 00:21:17 +02:00
Lucian Buzzo
b4c7e49607 [chore] Bump debug to version 2.6.4 (#1101) 2017-04-24 23:48:08 +02:00
Damien Arrachequesne
8e5465de2f [chore] Release 3.1.0 2017-04-24 23:33:46 +02:00
Damien Arrachequesne
403b858a8d [chore] Bump debug to version 2.6.4 (#67) 2017-04-24 23:32:13 +02:00
Damien Arrachequesne
7edb34ed4e [chore] Bump dependencies (#500)
- debug to version 2.6.4
- engine.io-parser to version 2.1.0
- ws to version 2.3.1
2017-04-24 23:22:35 +02:00
Damien Arrachequesne
f44256c523 [feat] Move binary detection to the parser (#66) 2017-04-24 23:20:51 +02:00
Damien Arrachequesne
2c233681ef [chore] Release 2.1.0 2017-04-24 14:09:33 +02:00
Damien Arrachequesne
5d6ba84292 [chore] Drop support for old nodejs versions (0.10 & 0.12) (#92) 2017-04-24 13:57:00 +02:00
Damien Arrachequesne
bffb63ebfa [revert] "[fix] Enable to utf8-decode string payloads (#88)" (#91)
This reverts commit 278a7e45e7.
2017-04-24 13:53:17 +02:00
Caleb
199eec648e [docs] Replace non-breaking space with proper whitespace (#2913) 2017-04-19 22:19:57 +02:00
Guillermo Rauch
3f19445e37 Merge pull request #1096 from satya164/patch-1
Fix dependencies
2017-04-11 11:40:27 -07:00
Satyajit Sahoo
628eb3bcb0 Fix dependencies
Few dependencies were in devDependencies, which made it impossible to build with `yarn --production`
2017-04-11 17:53:22 +05:30
Damien Arrachequesne
07d57d553f [chore] Release 3.0.0 2017-04-06 00:00:19 +02:00
Damien Arrachequesne
fb7e2be552 [chore] Bump dependencies (#498) 2017-04-05 23:57:17 +02:00
Damien Arrachequesne
057f67f2ab [chore] Release 2.0.3 2017-04-05 23:25:16 +02:00
Damien Arrachequesne
528345470c [chore] Use has-binary2 (#90) 2017-04-05 23:17:20 +02:00
Damien Arrachequesne
817adca41d [chore] Release 3.0.0 2017-04-03 23:51:53 +02:00
Damien Arrachequesne
e295b9b1c2 [chore] Bump isarray to version 2.0.1 (#65) 2017-04-03 23:48:59 +02:00
Jimmy Karl Roland Wärting
e39f5a8c6a [chore] Use native JSON and drop support for older nodejs versions (#64) 2017-04-03 23:15:24 +02:00
Faraz Patankar
f1b39a6b1d [docs] Update emit cheatsheet (#2906) 2017-04-03 07:20:38 +02:00
minchao
ec321241a5 [docs] Fix the Engine.IO url format (#28)
The <query string> was not displayed.
2017-04-03 07:14:17 +02:00
Chua Kiem Fai
57b7e5be84 [chore] Bump uws to version 0.14.1 (#497)
As all older versions are now unpublished.
2017-03-30 07:28:31 +02:00
Damien Arrachequesne
240b154960 [docs] Explicitly document that Server extends EventEmitter (#2874) 2017-03-29 14:13:04 +02:00
efkan
c5b7738730 [docs] Add server.engine.generateId attribute (#2880) 2017-03-29 13:52:07 +02:00
Simen Bekkhus
03f3bc9ab3 [docs] Fix wrong space character in README (#2900) 2017-03-27 13:15:19 +02:00
Damien Arrachequesne
ec5d20897a [chore] Merge 2.1.x branch (#494) 2017-03-22 07:50:49 +01:00
Damien Arrachequesne
523dcd2003 [chore] Release 2.0.2 (#89) 2017-03-21 14:40:00 +01:00
Damien Arrachequesne
278a7e45e7 [fix] Enable to utf8-decode string payloads (#88)
That will allow clients receiving the xhr payload with
responseType = 'arraybuffer' to properly decode the message, which is
not sent as binary by the backend anymore since 292c00c (#85).
2017-03-21 14:35:00 +01:00
Dominik Palo
d32bc5bc5d [docs] Fix messed events documentation (#1089) 2017-03-19 00:38:37 +01:00
SwhGo_oN
2135ed8b85 [docs] Fix Manager constructor documentation (#1093) 2017-03-19 00:37:07 +01:00
SwhGo_oN
e40accf7a1 [docs] Fix documentation for 'connect' event (#2898) 2017-03-19 00:33:59 +01:00
Daniel J. O'Quinn
120611fbdb [chore] Bump ws to version 2.2.0 (#487) 2017-03-11 09:43:20 +01:00
Damien Arrachequesne
b436ca3887 [chore] Drop support for old nodejs versions (0.10 & 0.12) (#493) 2017-03-11 09:41:48 +01:00
Damien Arrachequesne
783e0591fa [chore] Release 2.1.0 (#492) 2017-03-11 09:18:22 +01:00
Damien Arrachequesne
81ef0bc939 [feat] Add an option to toggle handling of OPTIONS requests (#491)
By setting `handlePreflightRequest` to false, OPTIONS request are no
longer processed by engine.io. A function can also be provided.
2017-03-11 09:04:00 +01:00
Damien Arrachequesne
09465969a8 [chore] Bump engine.io-parser to version 2.0.1 (#490) 2017-03-11 07:23:06 +01:00
Damien Arrachequesne
b723caef4b [chore] Bump uws to version 0.13.0 (#489) 2017-03-11 07:22:50 +01:00
Esteban Lussich
25321d1dc6 [docs] Fix format in API.md (#1090) 2017-03-09 08:58:53 +01:00
Damien Arrachequesne
6c597956cb [chore] Release 2.0.1 (#86) 2017-03-06 12:28:04 +01:00
Damien Arrachequesne
292c00c183 [fix] Encode string payloads as strings even if binary supported (#85)
This reverts commit 44c7aa5, which caused string payloads to be encoded
as binary (so that huge string payloads were needlessly UTF-8-encoded).

Related: https://github.com/socketio/socket.io/issues/2872
2017-03-06 12:24:11 +01:00
Damien Arrachequesne
01a4623613 [feat] Allow to join several rooms at once (#2879) 2017-02-26 09:15:32 +01:00
Damien Arrachequesne
c6f7baec3b [chore] Release 1.1.0 (#50) 2017-02-26 08:38:04 +01:00
Damien Arrachequesne
f627cd2db1 [feat] Add addAll method (#49)
That will allow to efficiently join a list of rooms.
2017-02-26 08:22:54 +01:00
Damien Arrachequesne
9064608513 [docs] Add note regarding the Emitter class (#1079) 2017-02-22 13:07:43 +01:00
Damien Arrachequesne
2d5b0026c5 [docs] Add webpack build example (#2828) 2017-02-22 12:48:46 +01:00
Damien Arrachequesne
49fb3e035b [fix] Run tests on the minified files (#1042) 2017-02-22 12:30:16 +01:00
Rainmen-xia
4af8fd3f22 [docs] Add missing path option in the documentation (#1078) 2017-02-22 07:58:56 +01:00
Damien Arrachequesne
2dcc794b8f [feature] Allow the use of a custom parser (#1075)
See https://github.com/socketio/socket.io/pull/2829
2017-02-20 21:46:02 +01:00
Jianru Lin
4322cf200f [docs] Fix typo (#1076) 2017-02-20 13:44:20 +01:00
Damien Arrachequesne
5ae06e6285 [chore] Bump socket.io-adapter to version 1.0.0 (#2867) 2017-02-17 07:33:43 +01:00
Damien Arrachequesne
b983377969 [chore] Release 1.0.0 (#48) 2017-02-16 22:26:40 +01:00
Damien Arrachequesne
40764bb806 [feat] Remove the socket.io-parser dependency (#47)
That will allow to use a custom parser (see https://github.com/socketio/socket.io/pull/2829).
2017-02-16 22:16:21 +01:00
sgress454
4d8f68c7dc [chore] Bump engine.io to version 2.0.2 (#2864)
Includes the following (from engine.io changelog):

* [fix] Initialize the WebSocket server in the Server constructor (#476)
* [chore] Bump ws to version 1.1.2 (vulnerability fix) (#480)
2017-02-16 22:01:53 +01:00
sgress454
1ac8374d64 [chore] Bump engine.io-client to version 2.0.2 (#1074)
Includes the following (from engine.io-client changelog):

* [chore] Bump ws to version 1.1.2 (vulnerability fix) ([#539](https://github.com/socketio/engine.io-client/issues/539))
* [fix] Fix extraHeaders option in browser ([#536](https://github.com/socketio/engine.io-client/issues/536))
2017-02-16 21:59:57 +01:00
Christian Freitag
3d63875498 [chore] Bump socket.io-parser to version 2.3.2 (#1071) 2017-02-16 21:58:58 +01:00
Gatsbill
fd086d757e [refactor] Remove useless self var (#45) 2017-02-16 13:36:19 +01:00
Damien Arrachequesne
bd1e81ec3d [chore] Release 2.0.2 (#481) 2017-02-16 07:40:57 +01:00
Paul Robello
01e36b4dae [chore] Bump ws to version 1.1.2 (vulnerability fix) (#480) 2017-02-16 07:19:52 +01:00
Tim Tyrrell
8fc4b44a6c [docs] Fix typo (#1066) 2017-02-13 23:52:56 +01:00
Tim Ruffles
5b79ab1af1 [docs] Update the wording to match the code example (#2853) 2017-02-13 23:52:07 +01:00
Damien Arrachequesne
54ff591b07 [feature] Merge Engine.IO and Socket.IO handshake packets (#2833) 2017-02-01 15:28:14 +01:00
H3rby7
e1facd5155 [docs] Small addition to the Express Readme Part (#2846) 2017-02-01 15:23:56 +01:00
Damien Arrachequesne
0cbf3631f9 [chore] Release 2.0.1 (#477) 2017-01-30 16:21:35 +01:00
Luigi Pinca
cdb487dbdc [fix] Initialize the WebSocket server in the Server constructor (#476) 2017-01-30 15:52:00 +01:00
Damien Arrachequesne
3b92cc2b26 [feature] Allow the use of custom parsers (#2829) 2017-01-24 07:10:19 +01:00
Damien Arrachequesne
a98f94d1ae [chore] Bump engine.io-client to version 2.0.0 (#1062) 2017-01-23 23:17:20 +01:00
Damien Arrachequesne
3d695c60f1 [chore] Bump engine.io to version 2.0.0 (#2832) 2017-01-23 23:16:51 +01:00
Damien Arrachequesne
9b4e983a0a [chore] Release 2.0.0 (#472) 2017-01-22 22:47:41 +01:00
Damien Arrachequesne
274efa120e [feature] Add an initialPacket option (#471) 2017-01-22 07:51:27 +01:00
Antoine LUCAS
3b5f4339a7 [fix] Use path.resolve by default and require.resolve as a fallback (#2797)
Browserify doesn't support require.resolve, and as a consequence, makes nexe fail the compilation. This PR attempts to get the path of the socket.io-client file via path.resolve and falls back to the original require.resolve if this file cannot be found.
2017-01-22 07:21:45 +01:00
Damien Arrachequesne
23c9dd34d5 [docs] Add a 'Features' section in the README (#2824) 2017-01-16 23:16:46 +01:00
Damien Arrachequesne
e28b475428 [docs] Add httpd cluster example (#2819) 2017-01-16 08:33:22 +01:00
Damien Arrachequesne
f7eed6e397 [docs] Add haproxy cluster example (#2818) 2017-01-16 08:33:09 +01:00
Damien Arrachequesne
988852986a [docs] Add nginx cluster example (#2817) 2017-01-16 08:32:53 +01:00
Damien Arrachequesne
8eaba085de [docs] Implement whiteboard example (#2810) 2017-01-16 08:32:33 +01:00
Tom Atkinson
2258a6a6e3 [fix] Properly close the connection on error (#2681) 2017-01-16 08:29:11 +01:00
Tom Atkinson
ad658b8cc2 [perf] Use shared instance of the encoder (#2825) 2017-01-16 08:25:52 +01:00
Tom Atkinson
e24434a0a0 [perf] Reset properties instead of deleting them (#2826)
Deleting properties is a v8 'optimization killer'
2017-01-16 08:23:22 +01:00
Damien Arrachequesne
fcb5c43ffe [fix] Add nsp prefix to socket.id (#1058)
So the socket ids on the client and on the server are equals.
2017-01-13 16:53:44 +01:00
Damien Arrachequesne
ba5dca38eb [test] Update browsers matrix (#1059) 2017-01-13 16:51:47 +01:00
Damien Arrachequesne
fde5ad6c0e [docs] Remove deprecated flashsocket transport (#26) 2017-01-12 17:09:06 +01:00
Damien Arrachequesne
d90240b48f [docs] Add missing documentation for pingInterval (#25) 2017-01-12 17:08:31 +01:00
Damien Arrachequesne
b754cff2b4 [docs] Fix documentation for local flag (#2816) 2017-01-10 18:10:56 +01:00
Damien Arrachequesne
706ca2a0c1 [docs] Add emit cheatsheet (#2815) 2017-01-10 17:54:09 +01:00
Damien Arrachequesne
accd0bd64a [docs] Add pingInterval/pingTimeout/transports options in the API documentation (#2814) 2017-01-10 17:50:38 +01:00
Damien Arrachequesne
131a2befec [docs] Add an example for socket.join() method (#2813) 2017-01-10 17:46:54 +01:00
Damien Arrachequesne
0be865f614 [docs] Fix a typo on clients method in the API documentation (#2812) 2017-01-10 17:41:31 +01:00
Damien Arrachequesne
7a533cda5c [chore] Update issue template with fiddle (#1057) 2017-01-10 10:17:37 +01:00
Damien Arrachequesne
01b262fbe0 [chore] Update issue template with fiddle (#2811) 2017-01-10 10:16:27 +01:00
Bella
f260439933 [chore] Update copyright year LICENSE to 2017 (#2803) 2017-01-06 17:11:03 +01:00
Miguel Grinberg
f338f93732 [docs] Corrected description of ping and pong packets (#21)
Section "Anatomy of an Engine.IO session" incorrectly reverses the roles of client and server when it discusses 'ping' and 'pong' packets.
2017-01-06 07:29:44 +01:00
Konstantin Zolotarev
a3496ed6eb [fix] Discard packets when socket is closed (#469) 2017-01-05 21:01:37 +01:00
Matt90o
57ec952ff7 [docs] Fix spelling mistake (#466)
Edited a minor spelling mistake. 'Comparesses' -> 'Compresses'
2017-01-04 06:39:47 +01:00
Andrea Accardo
e04de3c2c8 [docs] Fix wrong argument name in API.md (#2802) 2017-01-04 06:37:12 +01:00
Damien Arrachequesne
55411dfd24 [docs] Add connect_error and connect_timeout events (#1051) 2017-01-03 08:03:37 +01:00
Damien Arrachequesne
9ce9a98dd0 [chore] Release 2.3.2 (#59) 2016-12-30 22:43:07 +01:00
Gatsbill
2314c10f4f [perf] Small optimisations (#57) 2016-12-30 22:25:49 +01:00
Damien Arrachequesne
5ac691e7e4 [chore] Update zuul config to speed up tests in browser (#58) 2016-12-30 17:54:42 +01:00
Damien Arrachequesne
bbffbd5db9 [chore] Bump engine.io-parser to version 2.0.0 (#463) 2016-12-30 16:23:59 +01:00
Ian Bro
a27802e19e [fix] Prevent null from being accepted as argument (#2606) 2016-12-30 16:22:16 +01:00
Gatsbill
c46d4481bd [perf] micro-optimisations (#2793) 2016-12-30 16:18:09 +01:00
bananaapple
d82190016f [docs] Add install script on Readme.md (#2780) 2016-12-30 16:11:26 +01:00
Damien Arrachequesne
255b845596 [docs] API documentation (#2784) 2016-12-30 16:10:54 +01:00
Damien Arrachequesne
36ba01da98 [chore] release 2.0.0 2016-12-23 11:06:36 +01:00
Gatsbill
89a465a4b8 [perf] Micro optimisations (#84) 2016-12-23 07:19:13 +01:00
Damien Arrachequesne
558163d766 [docs] API documentation (#1049) 2016-12-22 09:06:14 +01:00
Damien Arrachequesne
f72f6f3fa6 [fix] allowRequest failures now return 403 Forbidden (#452) 2016-12-22 08:41:51 +01:00
Damien Arrachequesne
d1c2680ca9 [fix] Sanitize strings by removing lone surrogates (#82) 2016-12-21 22:01:19 +01:00
Billouboq
2d83f9da17 [perf] Use strict equality where possible (#77) 2016-12-21 09:52:23 +01:00
Damien Arrachequesne
ebf92a5097 [style] Minor style changes (#83) 2016-12-21 09:31:14 +01:00
Damien Arrachequesne
181acef657 [fix] Fix double utf8 encoding for payloads (#81) 2016-12-21 09:15:07 +01:00
Damien Arrachequesne
339d367267 [chore] Update zuul config to speed up tests (#76) 2016-12-21 08:59:06 +01:00
Damien Arrachequesne
c2d0a08d7f [refactor] Remove useless variable (#55) 2016-12-17 03:34:00 +01:00
Damien Arrachequesne
aed82572ba [chore] Bump dependencies (#56)
- bump debug to version 2.3.3
- bump component-emitter to version 1.2.1
- bump benchmark to version 2.1.2
- bump expect.js to version 0.3.1
- bump mocha to version 3.2.0
- bump zuul to version 3.11.1
2016-12-17 03:33:44 +01:00
Gatsbill
9072faa1e1 [refactor] Remove unused var (#53) 2016-12-17 02:33:05 +01:00
Gatsbill
97721957b9 [refactor] Use strict equality when possible (#52) 2016-12-17 02:32:21 +01:00
Jérémy Lal
e144dc17ad [test] Fix test failure by increasing pingTimeout (#461) 2016-12-12 22:02:54 +01:00
Jérémy Lal
7e50871c41 [chore] Use uws as default wsEngine, and ws as fallback (#459) 2016-12-12 22:02:03 +01:00
Damien Arrachequesne
177a65fc4a [chore] Release 1.7.2 (#1045) 2016-12-11 02:04:31 +01:00
Damien Arrachequesne
1f59e4526a [chore] Release 1.7.2 (#2783) 2016-12-11 02:04:21 +01:00
Damien Arrachequesne
766cef48c1 [chore] Bump engine.io-client to version 1.8.2 (#1044) 2016-12-11 01:38:19 +01:00
Damien Arrachequesne
9dec44a326 [chore] Speed up lint by avoiding '**/*.js' matching pattern (#1043) 2016-12-11 01:38:08 +01:00
Damien Arrachequesne
0a7afa85ea [chore] Bump engine.io to version 1.8.2 (#2782) 2016-12-11 01:27:19 +01:00
Damien Arrachequesne
10e3802051 [chore] Release 1.8.2 (#460) 2016-12-11 00:25:28 +01:00
Damien Arrachequesne
79955091f5 [fix] Add proper response when handleUpgrade fails (#458)
When the `verify` method fails, the current implementation closes the
connection immediately, which is understood by some proxy (such as
nginx) as if the server was not available (resulting in "upstream
prematurely closed connection while reading response header from
upstream" error). That commit make sure a proper response is sent
before closing the connection.
2016-12-10 22:01:18 +01:00
Damien Arrachequesne
dd854a8803 [test] Use explicit versions for travis tests (#457) 2016-12-08 01:06:14 +01:00
Damien Arrachequesne
b5292c7826 [refactor] Remove deprecated code used for nodejs v0.8 (#456) 2016-12-08 01:01:10 +01:00
Damien Arrachequesne
7bbe456688 [chore] Bump engine.io-parser to version 1.3.2 (#455) 2016-12-08 00:55:15 +01:00
Damien Arrachequesne
77975d054a [chore] release 1.3.2 (#79) 2016-12-07 22:21:41 +01:00
Damien Arrachequesne
494eca0be0 [chore] Bump dependencies (#78)
- bump after to version 0.8.2
- bump has-binary to version 0.1.7
- bump mocha to version 3.2.0
- bump zuul to version 3.11.1
2016-12-07 22:15:59 +01:00
Gatsbill
01c6a12de5 [perf] websocket optimisation (#453) 2016-12-05 23:59:24 +01:00
Dominik Paľo
8450d03f06 [docs] Rename ServerRequest to IncomingMessage (#448)
`http.ServerRequest` did refer to the HTTP API of Nodejs prior to v0.10
2016-12-05 23:28:01 +01:00
Edgar Hipp
a1a0016512 [chore] Bump base64id to version 1.0.0 (#451) 2016-12-01 20:46:57 +01:00
Serhii Sol
1e31769062 [fix] Fixes socket.use error packet (#2772)
* fix(socket): Fixes socket.use error packet which drops nodejs due to nuances of Nodejs' EventEmitter

* fix(socket): Fixes missing error event on socket

* fix(socket): test fix, should listen for clientSocket instead of server socket

* minor update
2016-12-01 02:25:13 +01:00
Damien Arrachequesne
797c9a3498 [chore] Release 1.7.1 (#2768) 2016-11-28 00:06:18 +01:00
Damien Arrachequesne
8f18970aaf [chore] Release 1.7.1 (#1037) 2016-11-28 00:05:53 +01:00
Damien Arrachequesne
d47bbd802e [fix] Fix json import in slim build (#1036) 2016-11-27 23:37:42 +01:00
Damien Arrachequesne
1aa91eb4a0 [docs] Add saucelabs browser matrix in README (#1035) 2016-11-27 23:22:32 +01:00
Damien Arrachequesne
5ecf06afc9 [chore] Release 1.7.0 (#1033) 2016-11-27 08:27:59 +01:00
Damien Arrachequesne
4f93a0b429 [chore] Release 1.7.0 (#2767) 2016-11-27 08:27:39 +01:00
Damien Arrachequesne
3c98130f15 [chore] Update client location and serve minified file (#2766)
Following https://github.com/socketio/socket.io-client/pull/1025, the
output files are now generated in the dist directory.
2016-11-27 08:24:27 +01:00
Damien Arrachequesne
3d20b0f4c8 [chore] Bump engine.io-client to 1.8.1 (#1032) 2016-11-27 08:14:45 +01:00
Damien Arrachequesne
c1dd34c4eb [chore] Provide a slim build without JSON3 and debug (#1030)
The dist folder now contains both the default build and a slimmer one, generated without JSON3 (JSON polyfill for IE6/IE7) and debug modules.
2016-11-27 08:12:17 +01:00
Damien Arrachequesne
9c23308c6e [chore] Bump engine.io to version 1.8.1 (#2765) 2016-11-27 07:55:02 +01:00
Damien Arrachequesne
767e9aa081 [chore] Release 1.8.1 (#450) 2016-11-27 07:15:36 +01:00
Damien Arrachequesne
3ba3fe3034 [chore] Move generated files to dist folder (#1025) 2016-11-25 23:32:36 +01:00
Tal Beja
955e5e0d91 [feature] Add a local flag (#2628)
That new flag will prevent the adapter (redis) from publishing the emit to the pub/sub server.

When several instances of a server receive the same event from a third party (not from a client), each server instance broadcasts the event to all his clients. With the local flag, and the change in the redis adapter, each server instance send the event only to his client, so each client receive only one unique event.
2016-11-24 23:44:52 +01:00
Zhu Liang
0ef55b26d4 [feature] serve sourcemap for socket.io-client (#2482) 2016-11-24 23:39:43 +01:00
Robbie Ferguson
4d8e2d342c [docs] Fixed grammar issues in the README.md (#2159)
Added a few periods and commas which were missing. Pluralised the word
'parameter' where it was incorrectly specified to singular on line 281.
Very minor edit. No source code changed.
2016-11-23 15:05:15 +01:00
Jérémy Lal
d48f848bb4 [docs] Comment connected socket availability for adapters (#2081) 2016-11-23 15:00:07 +01:00
Damien Arrachequesne
cd2ff466fc [fix] Only add defined callbacks to the stack (#447)
Before that commit, undefined callbacks were also added to the array,
which could lead to 'Maximum call stack size exceeded' error when
flush() method was called.

Fixes #399
2016-11-21 22:41:47 +01:00
Damien Arrachequesne
57b386385e [chore] Release 1.6.0 (#2757) 2016-11-20 04:26:56 +01:00
Damien Arrachequesne
fa14f91dd8 [chore] Release 1.6.0 (#1027) 2016-11-20 04:25:46 +01:00
Damien Arrachequesne
ed63f96bcc [chore] Bump dependencies (#1026)
- component-emitter to version 1.2.1
- debug to version 2.3.3
- engine.io-client to version 1.8.0
- parseuri to version 0.0.5
2016-11-20 04:17:41 +01:00
Damien Arrachequesne
9e7567daee [chore] Bump socket.io-adapter to version 0.5.0 (#2756) 2016-11-20 03:51:57 +01:00
Damien Arrachequesne
2e36799b17 [chore] Bump engine.io to version 1.8.0 (#2755) 2016-11-20 03:50:32 +01:00
Damien Arrachequesne
9bb5e9de2f [chore] Bump debug to version 2.3.3 (#2754) 2016-11-20 03:42:09 +01:00
Damien Arrachequesne
c6503589ed [chore] Release 1.8.0 (#446) 2016-11-20 03:25:58 +01:00
Damien Arrachequesne
ab2ca22f8f [chore] Bump debug to version 2.3.3 (#445) 2016-11-20 03:07:11 +01:00
Damien Arrachequesne
9a621ec592 [chore] Release 0.5.0 (#44) 2016-11-20 01:57:13 +01:00
Damien Arrachequesne
ffadfa600f [feature] Add clientRooms method (#41)
That method returns the list of rooms a given socket has joined. It is
intended to be used by other adapters, without them needing to access
the innards of the adapter.
2016-11-20 01:52:21 +01:00
Damien Arrachequesne
915af31c2c [chore] Bump debug to version 2.3.3 (#42) 2016-11-20 01:51:03 +01:00
Damien Arrachequesne
35987a5c0f [chore] Bump socket.io-parser to version 2.3.1 (#43) 2016-11-20 01:48:52 +01:00
Luca Tabone
ff2c15de68 [perf] Minor code optimizations (#2219) 2016-11-18 02:03:06 +01:00
Damien Arrachequesne
a483658607 [example] Add disconnection/reconnection logs to the chat example (#2675) 2016-11-18 01:52:45 +01:00
Julian Grinblat
4c5dbd8824 [fix] Don't drop query variables on handshake (#2745)
Parameters passed during handshake, such as tokens, were being dropped.
2016-11-16 01:17:19 +01:00
Julian Grinblat
7f659a50d3 [fix] Don't delete ws when closing the server (#444) 2016-11-15 22:01:20 +01:00
mhmeadows63
e14a10b7ce [feature] add support for Server#close(callback) (#2748) 2016-11-15 21:52:56 +01:00
bananaapple
1f55bf247e [feature] Support minified socket.io.min.js (#1021)
After running `make socket.io.js`, minified socket.io.min.js is now generated.
2016-11-13 10:04:06 +01:00
Alex
5a123beea5 [feature] Add support for socket middleware (#2306) 2016-11-05 01:51:29 +01:00
Philip YoonShin
2ed5f0f5fb [chore] Update year to 2016 (#2456) 2016-11-05 01:19:15 +01:00
Julian Grinblat
e9f980c475 [feature] Add support for all event emitter methods (#2601) 2016-11-05 01:14:21 +01:00
Jamie Davis
6f44f3a8ef [test] Fix leaking clientSocket (#2721)
Test 'should be able to close sio sending a port' defined a clientSocket
but didn't set 'reconnection: false'.

Now, the default behavior of a clientSocket is 'reconnection: true'.
As a result, the clientSocket was "leaked" from the test case
and seemed to intermittently connect to the servers in subsequent
test cases. This would cause other tests to timeout unexpectedly.

It's not clear to me why this would happen, since the test case
assigns a unique port number to the socket.
However, if you go into socket.io-client and assign and log
unique IDs to each socket, then you'll see that this clientSocket
shows up in other test cases if the reconnectionDelay strikes
unluckily.
2016-11-05 01:06:04 +01:00
Zhu Liang
4d1c20dbd6 [feature] emit sourcemap for socket.io.js (#953) 2016-11-05 00:24:53 +01:00
dlimkin
60780e2fb7 [feature] Fix cookiePath empty bug and add cookieHttpOnly option (#423) 2016-11-03 01:29:40 +01:00
Damien Arrachequesne
7c33b42153 [test] fix tests for NodeJS v7 (#441) 2016-11-03 01:28:01 +01:00
Diga Widyaprana
7cbdd5e5d9 [style] Add ESlint (#385) 2016-10-31 02:40:58 +01:00
Atanas Palavrov
04fc0f3677 [feature] Loading client script on demand. (#2567)
Support for the serving of the client script mess with packagers like
browserify, webpack. Especcialy in projects where it is not used at all.
This patch is workaround to avoid that problem in the cases when client
script is not served.
2016-10-30 14:22:00 +01:00
Kenton Varda
d026c00d05 [fix] Make ETag header comply with standard. (#2603)
The standard says that an ETag must be surrounded in double quotes:

https://tools.ietf.org/html/rfc7232#section-2.3

Although browsers tend to be lenient, omitting the quotes can confuse/break some kinds of proxies and other tools that demand compliant formatting. For example, Sandstorm.io enforces strict HTTP usage for security reasons and will block responses with invalid ETags.
2016-10-30 14:19:00 +01:00
Kim Min-Ho
e008ffeba5 [style] Fix some typos (#439) 2016-10-25 00:58:01 +02:00
Damien Arrachequesne
fdf64cc38f [chore] Release 1.5.1 (#2735) 2016-10-24 03:31:32 +02:00
Damien Arrachequesne
3df7e09519 [chore] Release 1.5.1 (#1016) 2016-10-24 03:28:53 +02:00
Damien Arrachequesne
838c9c25d4 [chore] Bump engine.io-client to 1.7.2 and socket.io-parser to 2.3.1 (#1015) 2016-10-24 03:25:23 +02:00
Damien Arrachequesne
5badb6436e [chore] Bump socket.io-parser to 2.3.1 (#2734) 2016-10-24 03:23:03 +02:00
Damien Arrachequesne
c20e0b26c9 [chore] Bump engine.io to 1.7.2 (#2729) 2016-10-24 03:21:11 +02:00
bananaapple
5c10c5439b [test] Use client function to unify client in test script (#2731) 2016-10-24 02:35:01 +02:00
Damien Arrachequesne
64455b432c [chore] Release 2.3.1 (#51) 2016-10-24 02:31:53 +02:00
Damien Arrachequesne
0e2dcb7281 [chore] Revert "Remove deprecated isarray dependency" (#50)
The fallback is needed for IE6, IE7 and IE8.
2016-10-24 02:29:22 +02:00
Damien Arrachequesne
0c983bd085 [chore] Release 1.7.2 (#438) 2016-10-24 01:33:41 +02:00
Damien Arrachequesne
7188333fa7 [docs] Add missing upgradeTimeout option in the docs (#437) 2016-10-24 01:21:10 +02:00
Damien Arrachequesne
6ea49bdb12 [chore] Add Github issue and PR templates (#436) 2016-10-24 01:20:59 +02:00
Damien Arrachequesne
c2fb41c9fe [chore] Add Github issue and PR templates (#1013) 2016-10-22 09:30:36 +02:00
Damien Arrachequesne
8182ecc61c [chore] Add Github issue and PR templates (#2733) 2016-10-22 09:19:08 +02:00
Feram Bot
ccd3376627 [docs] Minor fixes (#2526) 2016-10-21 03:21:45 +02:00
Damien Arrachequesne
58a73d39e9 [chore] Bump socket.io-parser to 2.3.0 (#2730) 2016-10-21 03:18:49 +02:00
Tom Atkinson
e60bd5a4da [fix] Avoid swallowing exceptions thrown by user event handlers (#2682) 2016-10-21 03:16:36 +02:00
Paul Meinhardt
21dffa4b58 [docs] Link readme npm package badge to npm registry page (#2612) 2016-10-21 03:10:33 +02:00
Marcio Puga
94852e3d23 [docs] Fix typo (#2724) 2016-10-21 03:06:59 +02:00
davidlondono
b8c60506a6 [docs] Fix JSDoc of optional parameters (#2465)
Making proper optional Docs for socketIO
2016-10-21 03:02:59 +02:00
syuilo⭐️
ecc76f48bc [docs] Add link to LICENSE (#2221) 2016-10-21 03:00:38 +02:00
Damien Arrachequesne
298034f300 [chore] Update zuul browser settings (#1011) 2016-10-21 02:09:48 +02:00
Damien Arrachequesne
cbc3d67e01 [chore] Bump engine.io-client to 1.7.1 (#1010) 2016-10-21 02:09:13 +02:00
Damien Arrachequesne
d9e49319d4 [chore] Bump socket.io-parser to 2.3.0 (#1009) 2016-10-21 02:09:02 +02:00
David Matas Matas
5077f0a66b [chore] Disable AMD for json3 (#1005)
Saying to Webpack don't use the AMD style for json3 dependency
2016-10-21 02:08:29 +02:00
Damien Arrachequesne
baf384cd6c [chore] Release 2.3.0 (#49) 2016-10-21 01:32:51 +02:00
Damien Arrachequesne
972d0aa93c [chore] Move benchmark to dev dependencies (#48) 2016-10-21 01:10:04 +02:00
Tom Atkinson
9b479bcee6 [perf] Split try catch into separate function (#40) 2016-10-21 01:07:30 +02:00
Damien Arrachequesne
26699fa968 [chore] Make the build status badge point towards master (#47) 2016-10-21 01:03:53 +02:00
Damien Arrachequesne
e8f7c32a43 [chore] Remove deprecated isarray dependency (#46)
Closes #38
2016-10-21 01:03:33 +02:00
Damien Arrachequesne
123d30194a [chore] Update zuul browser settings (#44)
- Remove deprecated iOS 7.1
- Add Firefox and Microsoft Edge browsers
- Add latest stable Node.js release
2016-10-21 00:55:37 +02:00
Damien Arrachequesne
3fe95b6f67 [chore] Restrict files included in npm package (#45) 2016-10-21 00:54:52 +02:00
Damien Arrachequesne
f67c758e5d [chore] Release 1.7.1 (#435) 2016-10-20 18:53:52 +02:00
Jérémy Lal
724b3fd8e0 [fix] Close and free webSocketServer (#393) 2016-10-20 15:53:01 +02:00
Damien Arrachequesne
12ee4772ab [chore] Add latest nodejs release in travis settings (#434) 2016-10-20 15:52:28 +02:00
Damien Arrachequesne
200e05f2ac [chore] Bump engine.io-parser to 1.3.1 (#433) 2016-10-20 15:52:11 +02:00
Damien Arrachequesne
ada9dbe77b [chore] release 1.3.1 (#75) 2016-10-20 14:43:50 +02:00
Damien Arrachequesne
6741900f37 [fix] Handle undefined case properly when decoding packet (#74) 2016-10-20 14:39:04 +02:00
jm
5aecaa914d [fix] decodePacket now accepts both Buffer and ArrayBuffer as data
Closes #64, fixes #60
2016-10-20 14:17:02 +02:00
tatellos
97bdbab37c [docs] Fix typo in Readme.md (#37) 2016-10-18 03:58:00 +02:00
Damien Arrachequesne
1ae44c9d10 [chore] Update zuul browser settings (#73)
- Remove deprecated iOS 7.1
- Add Firefox and Microsoft Edge browsers
- Add latest stable Node.js release
2016-10-18 02:32:56 +02:00
Jack X
4a818a0ed7 [fix] Add safety check for global object
Closes #71
2016-10-18 01:40:29 +02:00
Damien Arrachequesne
85dd3fa1c3 [chore] Update zuul browser settings following EOL notices (#42) 2016-10-08 22:00:27 +02:00
Damien Arrachequesne
aa187cd075 [chore] Bump zuul to 3.11.0 & zuul-ngrok to 4.0.0 (#41) 2016-10-08 21:59:36 +02:00
Damien Arrachequesne
c94058f9b0 [chore] release 1.5.0 (#2711) 2016-10-07 00:13:33 +02:00
Damien Arrachequesne
1738fcde4f [chore] release 1.5.0 (#999) 2016-10-07 00:12:41 +02:00
Damien Arrachequesne
235f3a17b6 [chore] Restrict files included in npm package (#998) 2016-10-06 23:50:31 +02:00
Damien Arrachequesne
43d9a4b55d [feature] Add a 'disconnecting' event to access to socket.rooms upon disconnection (#2332) 2016-10-06 23:23:26 +02:00
Alejandro Oviedo
df916172dd [chore] Link build badge to master branch (#2549) 2016-10-06 23:12:15 +02:00
Damien Arrachequesne
271c625243 [chore] Restrict files included in npm package (#2709) 2016-10-06 23:11:33 +02:00
Damien Arrachequesne
628fe8f1b2 [chore] Point towards current master of socket.io-client (#2710) 2016-10-06 23:10:54 +02:00
Damien Arrachequesne
db62e1bf67 [chore] Remove unused zuul-ngrok dependency (#2708) 2016-10-06 23:10:33 +02:00
Damien Arrachequesne
a52d748562 [chore] Bump zuul to 3.11.0 & zuul-ngrok to 4.0.0 (#70) 2016-10-06 21:15:50 +02:00
YasharF
ba4c7921ef [chore] Bump engine.io to 1.7.0 (#2707) 2016-10-06 10:03:55 +02:00
YasharF
8d26aac512 [chore] Bump engine.io-client to 1.7.0 (#996) 2016-10-05 22:31:05 +02:00
Alejandro Oviedo
62459f9ee5 [chore] reference build badge to master branch (#967) 2016-10-05 22:29:22 +02:00
Damien Arrachequesne
0ceda2bf31 [chore] Bump zuul to 3.11.0 & zuul-ngrok to 4.0.0 (#997) 2016-10-05 22:28:37 +02:00
Damien Arrachequesne
45b2d2226f [chore] Update zuul browser settings following EOL notices (#985)
- EOL Notice for iOS 5.1, 6.0, 6.1, 8.0, and iWebDriver
- EOL Notice for Android 4.0, 4.1, 4.2
2016-10-05 22:27:54 +02:00
Damien Arrachequesne
4c318ce48b [chore] Bump engine.io-client to 1.7.0 (#429) 2016-10-05 15:56:05 +02:00
Damien Arrachequesne
330526a491 [chore] release 1.7.0 (#428) 2016-10-05 08:10:03 +02:00
Damien Arrachequesne
4e058b5ce8 [chore] Restrict files included in npm package (#427) 2016-10-05 00:54:36 +02:00
Damien Arrachequesne
58a916b593 [chore] Make the build status badge point towards master (#426) 2016-10-05 00:54:16 +02:00
Damien Arrachequesne
d941cd9c75 [chore] Bump engine.io-parser to 1.3.0 (#425) 2016-10-05 00:53:47 +02:00
Damien Arrachequesne
a37fa48a75 [chore] release 1.3.0 (#69) 2016-09-26 04:04:44 +02:00
Damien Arrachequesne
f5d966bd66 [chore] Use wtf-8 instead of utf8 to prevent lone surrogates from generating parsing error (#68) 2016-09-26 03:44:29 +02:00
Damien Arrachequesne
180028699e [chore] Restrict files included in npm package (#67) 2016-09-26 03:40:53 +02:00
Damien Arrachequesne
58dbe3b9e5 [chore] Update license and repository url (#66) 2016-09-26 03:40:33 +02:00
Tom Atkinson
26162afe01 [perf] Split try catch into separate function (#65) 2016-09-26 03:40:17 +02:00
Damien Arrachequesne
2c0ae2972b Merge pull request #387 from nkzawa/fix/ignore-dist
Ignore dist not to release for now
2016-08-07 23:31:34 +02:00
Damien Arrachequesne
fadeb7df5c Merge pull request #418 from darrachequesne/patch-2
Restoring require('ws') as separate expression for browserify.
2016-08-05 23:01:36 +02:00
Damien Arrachequesne
30ea0b8d7d Merge pull request #2599 from boazsegev/patch-1
Documentation update to help new programmers
2016-08-05 21:07:30 +02:00
Damien Arrachequesne
073df34c82 Merge pull request #58 from tjni/guard-base64-arraybuffer-require
Require base64-arraybuffer module conditionally.
2016-08-05 19:07:57 +02:00
Damien Arrachequesne
342f7d5dbe Merge pull request #62 from darrachequesne/patch-1
Update zuul browser settings following EOL notices
2016-08-05 18:34:00 +02:00
Damien Arrachequesne
236efa00c6 Update zuul browser settings following EOL notices
- EOL Notice for iOS 5.1, 6.0, 6.1, 8.0, and iWebDriver
- EOL Notice for Android 4.0, 4.1, 4.2
2016-08-05 01:38:49 +02:00
Atanas Palavrov
9bd84818fa Restoring require('ws') as separate expression for browserify. 2016-08-05 00:38:20 +02:00
Damien Arrachequesne
5301695c93 Merge pull request #411 from hairyhenderson/add-nsp-check-to-build 2016-08-05 00:23:04 +02:00
Dave Henderson
959c8be0cc Bumping ws to 1.1.1 to address https://nodesecurity.io/advisories/120
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2016-07-13 14:51:56 -04:00
Dave Henderson
7b343517ed Adding nsp check to the build process
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2016-07-13 14:38:01 -04:00
Bo
2d141aff7c Prevent mixup for new programmers
The documentation, inadvertently, causes confusion for newer programmers, hindering their learning curve and ability to learn `socket.io` faster.

This proposed change aims at preventing this confusion to allow new programmers easier access to resources, especially when searching the web for more information.

The name `socket` in the documentation refers to the API gateway, or abstraction layer, related to the `client` and other properties. However, in the rest of the programming world, `sockets` usually refer to Berklee sockets or the lower-level communication channel that is used to implement Protocols such as the Websocket Protocol and HTTP.

New programmers often search for more informations using the `sockets` keyword when they are grappling with learning the `socket.io` API.

A good example is the stack overflow site, where newer programmers incorrectly tag their questions `sockets` and in turn don't get a fast response to their questions.

By simply changing the name of the variable used to describe socket.io's "Socket" class instances from `socket` to `client`, this mixup should be mitigated considerably.
2016-06-26 14:32:37 -04:00
Theodore Ni
c0d166b861 Require base64-arraybuffer module conditionally.
Since base64-arraybuffer version 0.1.5 introduced a change that fails
at require time in a browser without ArrayBuffer support, the require
must be guarded.
2016-06-25 22:12:44 -07:00
Guillermo Rauch
40763d3962 1.4.8 2016-06-23 19:24:38 -07:00
Guillermo Rauch
13002fb444 Merge branch '1.4.7-pre' 2016-06-23 19:24:27 -07:00
Guillermo Rauch
2bed4f433d Release 1.4.8 2016-06-23 19:22:42 -07:00
Guillermo Rauch
2a092bd2fb Release 1.4.8 2016-06-23 19:22:41 -07:00
Guillermo Rauch
4137eb5c43 package: bump engine.io 2016-06-23 19:12:28 -07:00
Guillermo Rauch
8a0a69509b package: bump engine.io-client 2016-06-23 19:12:09 -07:00
Guillermo Rauch
966344219d Merge branch '1.6.10-pre' 2016-06-23 19:11:13 -07:00
Guillermo Rauch
10c4360bde Release 1.6.11 2016-06-23 19:10:07 -07:00
Guillermo Rauch
5457488561 package: bump ws to support maxPayload 2016-06-23 19:07:16 -07:00
Guillermo Rauch
ead9dfe206 package: bump ws to support maxPayload 2016-06-23 19:06:07 -07:00
Guillermo Rauch
e3207005da 1.4.7 2016-06-23 17:31:33 -07:00
Guillermo Rauch
1529d5acbe 1.6.10 2016-06-23 17:30:47 -07:00
Guillermo Rauch
3730328794 Merge branch '1.4.7-pre' 2016-06-23 17:30:04 -07:00
Guillermo Rauch
42aa77614e Release 1.4.7 2016-06-23 17:25:46 -07:00
Guillermo Rauch
aaabdd52dc Release 1.4.7 2016-06-23 17:25:44 -07:00
Guillermo Rauch
184dec31f7 Release 1.6.10 2016-06-23 17:21:40 -07:00
Guillermo Rauch
17ec2150c0 server: implement maxHttpBufferSize for ws 2016-06-23 17:15:46 -07:00
Guillermo Rauch
de903c7868 package: bump engine.io-client 2016-06-23 17:11:47 -07:00
Guillermo Rauch
1491a96c95 package: bump engine.io 2016-06-23 17:11:15 -07:00
Guillermo Rauch
298cb6fd6f upgrade accepts 2016-06-17 10:36:05 -07:00
Guillermo Rauch
d9dda2b60a Merge pull request #390 from kapouer/uws
Option wsEngine or EIO_WS_ENGINE env var
2016-05-09 11:46:49 -07:00
Jérémy Lal
91dd49d1c2 uws@04.0 2016-05-09 12:22:24 +02:00
Jérémy Lal
0d1f487696 Tests: disable SSL with uws tests on node < 4.4.3 2016-05-07 16:18:59 +02:00
Jérémy Lal
3e6addb49c doc: mention uws as an alternative addon 2016-05-07 16:03:33 +02:00
Jérémy Lal
b7be8ece79 Fix uws devDependency to a passing version 2016-05-07 16:03:33 +02:00
Jérémy Lal
b11607f34f Travis: test uws using latest nodejs 4 2016-05-07 16:03:05 +02:00
Jérémy Lal
6eba67603b Travis: allow compilation of Node.js 4 addons 2016-05-07 01:14:25 +02:00
Jérémy Lal
0b9d6dc496 Do not run tests with uws engine on Node < 4 2016-05-07 00:56:14 +02:00
Jérémy Lal
c50bff0ef6 Document wsEngine option
thanks to Alex Hultman
2016-05-07 00:50:49 +02:00
Jérémy Lal
41165e0f15 Test if wsEngine option loads uws instead of ws 2016-05-07 00:38:02 +02:00
Jérémy Lal
afb44ef138 Run tests using ws, then using uws 2016-05-07 00:38:02 +02:00
Jérémy Lal
aa1ee6ffab wsEngine option and env var, defaults to 'ws' 2016-05-07 00:02:01 +02:00
Guillermo Rauch
dcca01f5a4 Release 1.4.6 2016-05-02 20:57:44 -07:00
Guillermo Rauch
204498aa29 Release 1.4.6 2016-05-02 20:57:35 -07:00
Guillermo Rauch
3b58fa04d5 package: bump engine.io 2016-05-02 20:56:15 -07:00
Guillermo Rauch
1d7519c214 bump engine.io-client 2016-05-02 20:55:55 -07:00
vendethiel
187492ab80 update version & history file 2016-04-18 20:52:50 +02:00
Guillermo Rauch
2802463579 Merge pull request #943 from nus-fboa2016-si/queryStringFix
Fix for Issue #331
2016-04-12 11:19:41 -07:00
whattokingu
4fff66d4ac Merge pull request #12 from whattokingu/queryStringFix
Query string fix
2016-04-12 19:17:56 +08:00
Zheng Weihan
4578f7ed35 Merge branch 'orgmaster' into queryStringFix
* orgmaster: (44 commits)
  bump zuul
  Remove jspm browser config
  Run lint before test instead of before build
  ESlint manual fix
  Eslint autofix
  Add env to eslintrc
  Exclude generated files from linting
  updated babel-eslint dep to 4.1.7 (4.1.6 broken)
  refactor gulpfile
  Add eslint to gulpfile and create gulp task default
  fixed regex
  Rename gulp task webpack to build
  Remove commented make recipe
  removed babel react preset
  Makefile use gulp from node_modules instead of global
  Remove browserify stuff, add zuul-builder-webpack devDep
  Migrate zuul config from yml to js
  Refactor webpack config out to support/webpack.config.js
  removed ide-specific entries from gitignore
  updated makefile to use gulp commands
  ...

Conflicts:
	lib/manager.js
	lib/socket.js
2016-04-12 19:17:09 +08:00
Naoyuki Kanezawa
2f7c930f49 Merge pull request #957 from guybedford/patch-1
Remove jspm browser config
2016-04-12 04:44:10 +09:00
Naoyuki Kanezawa
0c6d50d9c0 Merge pull request #2416 from nus-fboa2016-si/chatexample
updated express version to express 4
2016-04-12 03:58:08 +09:00
Naoyuki Kanezawa
881f16553c Merge pull request #2508 from tw0517tw/quote-exec
add quote to exec paths, prevent error when spaces in path
2016-04-12 03:57:43 +09:00
Guillermo Rauch
9c91076e96 Merge pull request #56 from nkzawa/fix/bump-zuul
bump zuul
2016-04-11 08:45:26 -07:00
Guillermo Rauch
cec8d65e75 Merge pull request #37 from nkzawa/fix/bump-zuul
bump zuul
2016-04-11 08:45:22 -07:00
Guillermo Rauch
5eb1d67cd9 Merge pull request #958 from nkzawa/fix/bump-zuul
bump zuul
2016-04-11 08:45:18 -07:00
Guillermo Rauch
e5a8d4d2d9 Merge pull request #2520 from nkzawa/fix/ignore-dist
Ignore dist directory for now
2016-04-11 08:45:11 -07:00
Guillermo Rauch
fb0253edea Merge pull request #2422 from nus-fboa2016-si/queryStringFix
Fix for Issue #331 on socket.io-client
2016-04-11 08:44:59 -07:00
tw0517tw
3c5f5a0864 use a bigger timeout for slower machine 2016-04-11 22:31:47 +08:00
tw0517tw
a23d26a617 add quote to exec paths, prevent error when spaces in path 2016-04-11 22:21:34 +08:00
Zhu Liang
910b5d77a6 fixed version notation 2016-04-11 22:19:49 +08:00
Naoyuki Kanezawa
438ad63cdf Merge pull request #2420 from revington/test-node-v5-stable
[Travis] Add Node 5.x (Stable) to the test matrix
2016-04-11 23:09:41 +09:00
Naoyuki Kanezawa
7e9a67d8ee Merge pull request #2415 from nus-fboa2016-si/documentation
Documentation
2016-04-11 23:05:33 +09:00
Naoyuki Kanezawa
0ae070885d Merge pull request #2477 from callahad/chat-layout-fix
Fix chat display in Firefox
2016-04-11 23:00:07 +09:00
Naoyuki Kanezawa
36d99d8d84 Merge pull request #2492 from westy92/master
Update package.json
2016-04-11 22:20:46 +09:00
nkzawa
0e63b0910e ignore dist for now 2016-04-11 22:11:19 +09:00
nkzawa
827d0ce3f8 bump zuul 2016-04-11 18:20:24 +09:00
nkzawa
b3753c8d5e bump zuul 2016-04-11 18:10:40 +09:00
nkzawa
ebfeb4b609 bump zuul 2016-04-11 18:02:53 +09:00
nkzawa
3aab14f543 ignore dist not to release for now 2016-04-11 15:24:28 +09:00
Guillermo Rauch
3c7350fa58 Merge pull request #2509 from tw0517tw/patch-1
stop prepend /# before id when no namespace
2016-04-10 11:24:42 -07:00
Guy Bedford
7b8db005da Remove jspm browser config 2016-04-04 11:40:02 +02:00
Guillermo Rauch
aadd5da655 Merge pull request #2496 from nus-fboa2016-si/compat-test
Added test for compat version transformed by babel
2016-04-02 18:31:30 -07:00
Guillermo Rauch
149f340611 Merge pull request #55 from danawoodman/patch-1
Fix crashes in React Native "navigator is not defined"
2016-04-02 18:06:02 -07:00
吳東曄 Wu, Dung-Ie
6d4128750b stop append /# before id when no namespace 2016-04-02 01:55:53 +08:00
Zhu Liang
6edcd1c6ba styling fixes 2016-03-31 12:55:42 +08:00
Zhu Liang
6b2394e612 disable loading lib by default to avoid syntax error due to lib containing new es6 syntax 2016-03-31 03:54:32 +08:00
Zhu Liang
677af3fa11 changed env var name, added testing documentation to readme 2016-03-21 13:11:03 +08:00
Zhu Liang
a1ff739b36 babel transpile before test, print error 2016-03-19 20:19:08 +08:00
Zhu Liang
de5b588e17 explicit distinction between current and compat in test so we can serve either compat or current as default 2016-03-19 20:13:57 +08:00
Zhu Liang
5a20c1195b set env vars in travis 2016-03-19 19:49:41 +08:00
Zhu Liang
5253bc400b use multiple npm scripts 2016-03-19 19:41:14 +08:00
Zhu Liang
1245a5639e added compat test 2016-03-19 19:21:54 +08:00
Zhu Liang
88161539a1 implement compat test using env variable 2016-03-17 13:42:29 +08:00
Zhu Liang
d99d4d15ae add compat test for babel-transformed codes 2016-03-17 13:11:20 +08:00
Seth Westphal
06ecfe5444 Explicit local gulp is unnecesary 2016-03-16 13:01:49 -05:00
Seth Westphal
e90b4eba1e Update repository URL 2016-03-16 12:58:59 -05:00
ven
08d6393289 Merge pull request #75 from FlatIO/master
Expose Emitter if module exists
2016-03-15 11:45:06 +01:00
Guillermo Rauch
74b81d4d4e Merge pull request #384 from nus-fboa2016-si/gulp-rebased
Add gulp and babel
2016-03-12 20:05:21 -08:00
Guillermo Rauch
c7de1a1adf Merge pull request #2471 from nus-fboa2016-si/gulp-rebased
Add gulp and babel
2016-03-12 20:04:48 -08:00
Dana Woodman
748144b50a Ensure navigator is defined. 2016-03-09 12:34:38 -08:00
Dana Woodman
a10c487518 Fix crash in React Native
This change lets people use Socket.io in React Native

Related to an issue on socket.io-client repo: https://github.com/socketio/socket.io-client/issues/945

All credit for this goes to @stevecass
2016-03-09 12:28:48 -08:00
Dan Callahan
7bae6ac636 Fix chat display in Firefox 2016-03-08 19:50:55 -06:00
Diga Widyaprana
292e0588a6 Remove node 0.8 from travis 2016-03-09 09:38:21 +08:00
Diga Widyaprana
355b5156fe Remove node 0.8 from travis 2016-03-09 09:36:51 +08:00
Diga Widyaprana
7e0dbfe4f5 Rename babel to transpile for consistency with socket.io repo 2016-03-06 16:15:56 +08:00
Diga Widyaprana
25269cde8a Use local instead of global gulp in npm test 2016-03-06 16:12:49 +08:00
Diga Widyaprana
ec1b875f12 Redirect make test to gulp test 2016-03-06 16:11:31 +08:00
Diga Widyaprana
5a11818f3e Modify mocha option
- timeout:2000 => slow:500 to mirror makefile
- remove globals option as it is not used anymore
2016-03-06 16:09:32 +08:00
Diga Widyaprana
0dca4f3fd7 Don't use dynamic dependencies 2016-03-06 15:51:01 +08:00
Diga Widyaprana
f21a29bcda Inline babel configuration 2016-03-06 15:51:01 +08:00
Yijin
77d18e7ce5 changed npm test script to use gulp 2016-03-06 15:51:01 +08:00
Yijin
702e9d5acf added babel under default gulp build task 2016-03-06 15:51:01 +08:00
Diga Widyaprana
3e168ee0b8 Redirect make tasks to gulp 2016-03-06 11:40:57 +08:00
Diga Widyaprana
ed9ab77dcb Minor fixes to gulp tasks
- Only provide entry point as first argument of gulp.src
- {read:false} option for mocha tests
- change timeout:2000 to slow:200 to mirror makefile's mocha options
- replace var with const where appropriate
2016-03-06 11:40:57 +08:00
Diga Widyaprana
1104cd135e Use local instead of global gulp in npm test 2016-03-06 11:40:57 +08:00
Diga Widyaprana
0be915cd0f Add gulp task clean to clean transpile output
- Work done by @YijinL. Part of @05ad308
2016-03-06 11:40:57 +08:00
Diga Widyaprana
c6dd41b915 Minor refactoring to transpile task
- Transpiling is now gulp transpile
- Default redirects to transpile
- Refactor transpile output directory to a separate constant
- Work by @YijinL in @05ad308
2016-03-06 11:32:40 +08:00
Diga Widyaprana
0f14312d7b Add gulp help
Work was done by @YijinL in 2 separate commits (@9204125 and @05ad308)
2016-03-06 11:32:09 +08:00
Zhu Liang
ee544955bd added babel integration 2016-03-04 21:47:07 +08:00
Yijin
c27529ceed slight refactoring for better encapsulation 2016-03-04 21:46:22 +08:00
Zheng Weihan
d56e2e765e add gulp task runner
add test to task.
2016-03-04 21:46:22 +08:00
Diga Widyaprana
97bd95f036 Don't use dynamic dependencies 2016-03-04 18:06:00 +08:00
Diga Widyaprana
11e0f19272 Inline babel configuration 2016-03-04 18:06:00 +08:00
Yijin
e388a3319d npm test script to use gulp 2016-03-04 18:06:00 +08:00
Zheng Weihan
b551ce9835 added test-cov task. 2016-03-04 18:06:00 +08:00
Zhu Liang
0bac96a6b2 added comment for babel 2016-03-04 14:46:08 +08:00
Zhu Liang
1d07b10339 integrated babel into gulp 2016-03-04 14:46:08 +08:00
Zheng Weihan
398b5479f0 delete unused dependency 2016-03-04 14:45:55 +08:00
Zheng Weihan
d9eb729eab implement gulp build system for test. 2016-03-04 14:45:03 +08:00
Guillermo Rauch
78f61c3abc Merge pull request #951 from nus-fboa2016-si/eslint
Add ESLint
2016-03-01 19:05:59 -08:00
Diga Widyaprana
c5ee450638 Run lint before test instead of before build 2016-02-28 21:19:29 +08:00
Diga Widyaprana
c51a930a2c ESlint manual fix 2016-02-28 02:36:06 +08:00
Diga Widyaprana
d1cbc68ea7 Eslint autofix 2016-02-28 02:36:06 +08:00
Diga Widyaprana
51ad3c1ee0 Add env to eslintrc
- node env at root eslintrc
- mocha env at test/ eslintrc
2016-02-28 02:36:06 +08:00
Diga Widyaprana
c0d8e30b8a Exclude generated files from linting
- coverage/
- socket.io.js bundle
2016-02-28 02:26:15 +08:00
Yijin
537e4cd665 updated babel-eslint dep to 4.1.7 (4.1.6 broken) 2016-02-28 02:25:14 +08:00
Yijin
9e443a90e2 refactor gulpfile 2016-02-28 02:24:51 +08:00
Michael Limantara
280d803d46 Add eslint to gulpfile and create gulp task default 2016-02-27 14:47:41 +08:00
Guillermo Rauch
b370bea495 Merge pull request #940 from nus-fboa2016-si/webpack
Webpack
2016-02-23 19:13:27 -08:00
whattokingu
f01a349af8 add back changes made in previous commit
previous commit [here](3407f3f522).
2016-02-16 00:37:05 +08:00
Zhu Liang
8725d6e5cb fixed regex 2016-02-15 13:34:25 +08:00
whattokingu
f9db72997f Merge pull request #10 from whattokingu/queryStringFix
Query string fix
2016-02-14 13:57:06 +08:00
Zheng Weihan
1293505dc2 update tests. 2016-02-14 13:48:28 +08:00
Zheng Weihan
f4e9e71c56 Merge branch 'queryStringFix' of https://github.com/whattokingu/socket.io into queryStringFix
# By whattokingu
# Via whattokingu
* 'queryStringFix' of https://github.com/whattokingu/socket.io:
  conform to style guide

Conflicts:
	lib/client.js
2016-02-14 13:47:59 +08:00
Zheng Weihan
045674de97 remove unnecessary decoder. url.parse already decodes string.
add test to test decoding function.
2016-02-14 13:46:26 +08:00
whattokingu
7091acf24c Merge pull request #9 from whattokingu/queryStringFix
Query string fix
2016-02-13 14:41:15 +08:00
whattokingu
19341051e8 conform to style guide 2016-02-13 14:35:12 +08:00
Zheng Weihan
e141e09aaf change decodeUriComponents calls 2016-02-13 14:28:21 +08:00
Zheng Weihan
5fabe4e780 call decodeURIComponent on query received from client.
update package.son to point to latest commit in socket.o-client package (with URI encoder)
2016-02-13 14:10:20 +08:00
whattokingu
bfa458941c fix error with test. 2016-02-13 13:50:43 +08:00
whattokingu
e0580ef475 Merge pull request #10 from whattokingu/queryStringFix
Query string fix
2016-02-13 13:47:53 +08:00
Zheng Weihan
e3c0f6a41e encodes queries using encodeURIComponent 2016-02-13 13:27:04 +08:00
Zheng Weihan
05250b0f5b code modification to conform to style guide. 2016-02-13 11:25:28 +08:00
Diga Widyaprana
c7deec13cb Rename gulp task webpack to build 2016-02-12 20:59:00 +08:00
Diga Widyaprana
49619d9965 Remove commented make recipe 2016-02-12 20:13:27 +08:00
Zhu Liang
60fa83c345 removed babel react preset 2016-02-12 13:40:52 +08:00
Diga Widyaprana
18d6873c64 Makefile use gulp from node_modules instead of global 2016-02-11 00:10:00 +08:00
Diga Widyaprana
422f29ebf6 Remove browserify stuff, add zuul-builder-webpack devDep 2016-02-10 23:44:08 +08:00
Diga Widyaprana
c4b7820cf1 Migrate zuul config from yml to js 2016-02-10 23:43:05 +08:00
Diga Widyaprana
ec06f7a6c3 Refactor webpack config out to support/webpack.config.js 2016-02-10 23:41:27 +08:00
Yijin
b7eeee7e7d removed ide-specific entries from gitignore 2016-02-10 12:05:24 +08:00
Julien Fouilhé
61fdd20c70 Expose Emitter if module exists 2016-02-09 17:32:07 +01:00
Yijin
2b18f9fbf1 updated makefile to use gulp commands 2016-02-09 17:49:49 +08:00
Yijin
8e55f02c3f trigger travis rebuild 2016-02-04 20:56:07 +08:00
Yijin
97f8391f2d fix typo 2016-02-04 19:31:49 +08:00
Yijin
6c2e1c121e added error code capturing for zuul child process 2016-02-04 19:21:03 +08:00
whattokingu
7760a71d90 Merge pull request #8 from whattokingu/queryStringFix
add comments to code
2016-02-04 13:28:29 +08:00
Zheng Weihan
c077357eff add comments to code 2016-02-04 13:27:36 +08:00
Yijin
8c86b10e0c removed babelify dep 2016-02-03 18:42:47 +08:00
Yijin
eb50b6c3d1 standardise gulpfile formatting and conventions 2016-02-03 17:58:11 +08:00
Yijin
d5467efcad removed dynamic dependencies 2016-02-03 17:05:35 +08:00
Zhu Liang
3407f3f522 update test 2016-02-01 13:50:11 +08:00
Zhu Liang
b14018eed6 fixed test case 2016-02-01 13:00:13 +08:00
Zhu Liang
1c1ee454f5 move babel from standalone to webpack loader 2016-01-31 16:57:31 +08:00
Michael Limantara
911c24505c Merge branch 'webpack' of https://github.com/nus-fboa2016-si/socket.io-client into webpack 2016-01-31 16:33:10 +08:00
Michael Limantara
468200ed8c Expose io variable to global when bundling with webpack 2016-01-31 16:33:00 +08:00
whattokingu
6564a0c519 Merge pull request #9 from whattokingu/queryStringFix
remove console statement.
2016-01-31 16:11:10 +08:00
Zheng Weihan
1657971d8c remove console statement. 2016-01-31 16:07:21 +08:00
whattokingu
2f26a2bdb4 Merge pull request #7 from whattokingu/queryStringFix
add test for issue #331 on socket.io-client.
2016-01-31 15:45:35 +08:00
Zheng Weihan
13af610f6d add test for issue #331 on socket.io-client. 2016-01-31 15:44:39 +08:00
whattokingu
34f79d303c Merge pull request #8 from whattokingu/queryStringFix
Complete functionality. Add Test.
2016-01-31 15:34:58 +08:00
Zheng Weihan
9fa6b1c6d2 update tests 2016-01-31 15:33:16 +08:00
Zheng Weihan
3290bb43f1 move encoding of query string to lookup function.
handles passing of query via query strings
add tests for functionality
2016-01-31 15:29:49 +08:00
Zheng Weihan
b878cdbed2 Revert "rebuild client."
This reverts commit 74aff2647e.
2016-01-31 14:45:44 +08:00
Zheng Weihan
08e44f3ae4 fix bug and passes tests 2016-01-31 14:45:20 +08:00
whattokingu
526329995c Merge pull request #7 from whattokingu/queryStringFix
pass query as socket property.
2016-01-31 14:25:24 +08:00
Zheng Weihan
8d44b7a938 pass query as Socket property rather than as function params to simplify flow and handle complex event flow. 2016-01-31 14:24:38 +08:00
whattokingu
6d3e85fb2a Merge pull request #6 from whattokingu/queryStringFix
rebuild client
2016-01-31 13:07:59 +08:00
Zhu Liang
a8903672c9 removed babel task from gulp 2016-01-31 13:05:15 +08:00
Zheng Weihan
74aff2647e rebuild client. 2016-01-31 13:05:10 +08:00
Michael Limantara
b31f21741e Remove babelrc file and move the settings inline to gulpfile.js 2016-01-31 11:24:53 +08:00
whattokingu
abcedf53ec Merge pull request #6 from whattokingu/queryStringFix
sync to master branch
2016-01-31 11:23:02 +08:00
Zheng Weihan
24456fdcbe Merge branch 'master' into queryStringFix
* master:
  Release 1.4.5
  package: bump `engine.io`
  add a test for graceful shutdown
2016-01-31 11:21:30 +08:00
whattokingu
017d04cf24 Merge pull request #5 from whattokingu/queryStringFix
sync to master branch
2016-01-31 11:18:38 +08:00
Zheng Weihan
fcb176b1d5 Merge commit '5fe7373610ef92de0d34b44d503c22cab5712c8d' into queryStringFix
* commit '5fe7373610ef92de0d34b44d503c22cab5712c8d':
  Release 1.4.5
  package: bump `engine.io-client`
2016-01-31 11:15:47 +08:00
whattokingu
eb2c3fca5e Merge pull request #4 from whattokingu/gulp-build
Remove Dynamic Dependencies
2016-01-31 10:20:30 +08:00
Zheng Weihan
ee72188f6d remove dynamic dependencies. 2016-01-31 10:18:14 +08:00
Pedro Narciso García Revington
25116ab179 test node 5 (stable) 2016-01-30 21:53:04 +01:00
whattokingu
d0c56ccea5 Merge pull request #3 from whattokingu/gulp-build
Added gulp task to run zuul.
2016-01-30 13:38:22 +08:00
Zheng Weihan
fe3837c9f6 change npm test in package to use gulp instead of make 2016-01-30 13:37:44 +08:00
Zheng Weihan
fdef60a24e added new task to run zuul.
added a test function to replicate the same task in makefile.
2016-01-30 13:29:34 +08:00
Zhu Liang
a116d52e30 updated express version to express 4 2016-01-30 11:57:31 +08:00
whattokingu
cecf5f127e Merge pull request #5 from whattokingu/documentation
Added Documentation
2016-01-30 11:31:11 +08:00
Zheng Weihan
1c467e15e6 Issue #2400, added documentation 2016-01-30 11:28:40 +08:00
whattokingu
a110542563 Merge pull request #4 from whattokingu/queryStringFix
Fix for Issue #331 on socket.io-client
2016-01-30 10:16:19 +08:00
whattokingu
35ad21f785 Merge pull request #2 from whattokingu/queryStringFix
Fix for Issue #331
2016-01-30 10:12:08 +08:00
Zhu Liang
aad48e7c49 disable compact by default, enabled browserify 2016-01-30 10:03:36 +08:00
Michael Limantara
3ddacd9fc1 Swap the order of babel and webpack 2016-01-30 09:58:33 +08:00
Zheng Weihan
7d55724468 refactor parsing of URL in CONNECT packet to use 'url' library. 2016-01-30 09:47:28 +08:00
Ben Ripkens
aa2e57acc7 Avoid memory leaks by remove event arrays
When subscribing and then unsubscribing from many different types of events,
it can be observed that the `Emitter._callbacks` object starts to grow.
This happens because, when unsubscribing, the event specific event array
is not removed when the last subscriber unsubscribes.
2016-01-29 11:18:01 +01:00
Zheng Weihan
1d84c55743 fix to issue #331 on socket.o-client.
Parses CONNECT packet for query string and replaces query in socket.handshake.
2016-01-28 14:40:05 +08:00
Zheng Weihan
75467cd069 Issue #331, attach query string to CONNECT packets for secondary namespaces. 2016-01-28 14:34:00 +08:00
Michael Limantara
0fc23f175c Integrate webpack and babel in gulpfile.js and change gulp task to build-webpack 2016-01-28 13:23:50 +08:00
Michael Limantara
01b5279c4a Merge branch 'babel' into webpack 2016-01-28 13:09:08 +08:00
Guillermo Rauch
b3fc530abe Release 1.4.5 2016-01-26 13:26:17 -08:00
Guillermo Rauch
5fe7373610 Release 1.4.5 2016-01-26 13:26:17 -08:00
Guillermo Rauch
d0dfa54dcb package: bump engine.io 2016-01-26 10:42:41 -08:00
Guillermo Rauch
4ccc34bce7 package: bump engine.io-client 2016-01-26 10:42:20 -08:00
Zhu Liang
94127a3465 added babel integration 2016-01-26 16:16:50 +08:00
Zhu Liang
b3d5f434aa Merge branch 'babel' of github.com:nus-fboa2016-si/socket.io-client into babel 2016-01-26 16:11:27 +08:00
Zhu Liang
3799b60d5b added babel integration using browserify API 2016-01-26 16:10:20 +08:00
Guillermo Rauch
83bee03bbb Release 1.6.8 2016-01-25 11:14:40 -08:00
Michael Limantara
97591f6d6e Add gulp task for webpack 2016-01-25 18:59:36 +08:00
Michael Limantara
d6492d234e Add webpack stream to package.json 2016-01-25 18:49:25 +08:00
whattokingu
aa87907675 Merge pull request #1 from whattokingu/gulp-build
Gulp build
2016-01-25 11:44:49 +08:00
Zheng Weihan
1abf879d01 add test-cov task to gulp 2016-01-25 00:04:22 +08:00
Zheng Weihan
c9c93441f2 gulp build system. Implemented gulp for build and test-node. 2016-01-24 16:47:07 +08:00
Guillermo Rauch
198b836759 Merge pull request #2399 from nkzawa/graceful-close
Add a test for graceful shutdown
2016-01-21 09:15:36 -08:00
Guillermo Rauch
87060b546c Merge pull request #378 from nkzawa/graceful-close
Graceful server closing
2016-01-21 09:14:53 -08:00
nkzawa
a75f46f06f add a test for graceful shutdown 2016-01-21 20:50:44 +09:00
nkzawa
1a98563898 add tests for graceful close 2016-01-21 20:35:11 +09:00
nkzawa
941a6ebf52 discard transport on server close 2016-01-21 20:02:54 +09:00
Zhu Liang
27062f5663 added babel integration using browserify API 2016-01-21 17:50:57 +08:00
Guillermo Rauch
7a64e67bdf Merge pull request #377 from lpinca/gh-376
polling: don't set the `closeTimeoutTimer` if the transport is upgraded
2016-01-18 10:08:51 -08:00
Luigi Pinca
cd97c7f412 polling: don't set the closeTimeoutTimer if the transport is upgraded 2016-01-17 20:19:03 +01:00
Naoyuki Kanezawa
2a91fd57c7 Merge pull request #2344 from denghongcai/patch-2
fix wrong jsdoc
2016-01-17 15:25:32 +09:00
Naoyuki Kanezawa
fe891293b2 Merge pull request #2353 from faizalpribadi/patch-1
fix typo word :)
2016-01-17 15:23:35 +09:00
Naoyuki Kanezawa
6e450f75b4 Merge pull request #2374 from darrachequesne/patch-4
Add badges showing dependency status
2016-01-17 15:22:52 +09:00
Naoyuki Kanezawa
22c985cae6 Merge pull request #2380 from darrachequesne/patch-5
Document type change of Socket#rooms
2016-01-17 15:22:05 +09:00
Naoyuki Kanezawa
7dd672f05d Merge pull request #934 from darrachequesne/patch-2
Add badges showing dependency status
2016-01-17 12:06:11 +09:00
Damien Arrachequesne
e97f9048a8 Bump dependencies 2016-01-16 22:04:02 +01:00
Damien Arrachequesne
8f8642dedc Add badges showing dependency status 2016-01-16 21:56:41 +01:00
Guillermo Rauch
fea3d79a2c Release 1.4.4 2016-01-10 22:36:31 -08:00
Guillermo Rauch
e504aa101a Release 1.4.4 2016-01-10 22:36:31 -08:00
Guillermo Rauch
d3dde130b7 package: bump engine.io 2016-01-10 22:27:44 -08:00
Guillermo Rauch
70193a7899 package: bump engine.io-client 2016-01-10 22:27:33 -08:00
Guillermo Rauch
a31551e141 Release 1.6.7 2016-01-10 20:23:24 -08:00
Damien Arrachequesne
899de7f873 Document type change of Socket#rooms 2016-01-09 22:08:30 +01:00
Guillermo Rauch
f1a3e8db2a Release 1.4.3 2016-01-08 08:17:50 -08:00
Guillermo Rauch
260c1f85c8 Release 1.4.3 2016-01-08 08:17:47 -08:00
Guillermo Rauch
dad82c3343 Release 1.4.2 2016-01-07 18:58:05 -08:00
Guillermo Rauch
00c0196cc7 Release 1.4.2 2016-01-07 18:58:04 -08:00
Guillermo Rauch
a6cbf6b205 package: bump engine.io 2016-01-07 18:14:39 -08:00
Guillermo Rauch
635f1d9180 package: bump engine.io-client 2016-01-07 18:14:25 -08:00
Guillermo Rauch
619d579c76 Release 1.6.6 2016-01-07 18:05:31 -08:00
Guillermo Rauch
df5df9aad1 exclude ws instead of ignoreing it from build [@lpinca] 2016-01-07 17:25:23 -08:00
Guillermo Rauch
de17842926 Merge pull request #932 from NativeScript/browserify-add-global
Add global object as another fallback.
2016-01-07 17:20:39 -08:00
Damien Arrachequesne
580100d491 Bump dev dependencies 2016-01-07 22:59:28 +01:00
Damien Arrachequesne
acb9cb421d Add badges showing dependency status 2016-01-07 22:58:59 +01:00
Guillermo Rauch
6d5d7e4411 Release 1.4.1 2016-01-07 12:52:27 -08:00
Guillermo Rauch
4b6320aba6 Release 1.4.1 2016-01-07 12:52:27 -08:00
Guillermo Rauch
898f7d68c5 zuul: set browserify options 2016-01-07 12:27:14 -08:00
Guillermo Rauch
49e60a7cb9 build 2016-01-07 10:45:26 -08:00
Guillermo Rauch
1fc8b80e53 support: update browserify instructions 2016-01-07 10:31:57 -08:00
Guillermo Rauch
4320167c4f update build tools 2016-01-07 10:31:41 -08:00
Guillermo Rauch
4f59a68f56 package: bump engine.io-client 2016-01-07 10:15:43 -08:00
Stefan Dobrev
cde911c10b Add global object as another fallback.
In some JavaScript runtimes like NativeScript the `window` or `self` objects are not present, but the `global` is.

NativeScript is using Karma as it its unit test runner and thus relies on socket.io for communication. The socket.io client file is served by Karma and loaded in NativeScript. Up until version 1.4.0 this problem was not visible because the root object was not accessed. However this is not the case anymore with latest json3 changes: https://github.com/NativeScript/socket.io-client/blob/master/socket.io.js#L5220
2016-01-07 18:47:40 +02:00
Guillermo Rauch
9c44eaa3e7 Release 1.4.0 2016-01-05 15:44:49 -08:00
Guillermo Rauch
ddb3445f3d Release 1.4.0 2016-01-05 15:44:48 -08:00
Guillermo Rauch
6eb9807f17 package: bump engine.io for sec advisory 2016-01-05 13:40:54 -08:00
Guillermo Rauch
847136e7fb Release 1.6.5 2016-01-05 12:35:51 -08:00
Guillermo Rauch
c891dd5446 Merge pull request #374 from Dignifiedquire/ws-1.0.0
Upgrade ws to 1.0.1
2016-01-05 12:03:04 -08:00
dignifiedquire
f685cfd3fd Upgrade ws to 1.0.1
Closes #373
2016-01-05 18:10:04 +01:00
Guillermo Rauch
391ce0dc8b server: catch websocket errors before upgrade 2015-12-28 16:07:42 -03:00
Faizal Pribadi
abe2394a24 fix typo word :)
update docs source code
2015-12-20 16:16:42 +07:00
Hongcai Deng
7012ba6c64 fix wrong jsdoc 2015-12-14 15:31:42 +08:00
Guillermo Rauch
7b0073c00f Merge pull request #2335 from nkzawa/patch-7
Improve the chat demo
2015-12-04 17:10:23 -08:00
nkzawa
0313ad0ea3 improve the chat demo 2015-12-05 10:07:08 +09:00
Guillermo Rauch
6580a7f9b5 package: bump engine.io-client 2015-12-04 10:57:23 -08:00
Guillermo Rauch
d310d42472 package: bump engine.io 2015-12-04 10:56:08 -08:00
Guillermo Rauch
7f83f59652 Release 1.6.4 2015-12-04 10:55:49 -08:00
Guillermo Rauch
fee048d59e package: bump parser for arraybuffer base64 fix 2015-12-04 10:20:04 -08:00
Guillermo Rauch
ca248c5238 Release 1.2.4 2015-12-04 09:58:57 -08:00
Guillermo Rauch
d434ce528a Merge pull request #925 from nkzawa/patch-26
Run tests on Android 5 instead of 4.4
2015-12-04 08:44:40 -08:00
nkzawa
e0cd41e2d3 update .travis.yml 2015-12-04 14:56:42 +09:00
Guillermo Rauch
b90008770f Merge pull request #372 from socketio/revert-371-use/yeast
Revert "server: use `yeast` to generate the socket id"
2015-12-03 11:46:45 -08:00
Guillermo Rauch
e77118af61 Revert "server: use yeast to generate the socket id" 2015-12-03 11:46:38 -08:00
Guillermo Rauch
0b7f1b53fc Merge pull request #371 from lpinca/use/yeast
server: use `yeast` to generate the socket id
2015-12-03 11:46:00 -08:00
Luigi Pinca
08e8d67fe6 server: use yeast to generate the socket id 2015-12-03 19:29:18 +01:00
Guillermo Rauch
709ceba00a package: bump socket.io-adapter for release 2015-12-03 10:28:33 -08:00
Luigi Pinca
daeddf1f83 server: remove unused dependencies and fix indentation 2015-12-03 19:23:27 +01:00
Guillermo Rauch
efd6141dbd Release 0.4.0 2015-12-03 10:12:35 -08:00
Guillermo Rauch
d16e46df36 Merge pull request #30 from manubb/master-patched
Use a Room class to efficiently track room size.
2015-12-03 09:41:32 -08:00
Guillermo Rauch
5ccf58873b Merge pull request #924 from nkzawa/patch-25
Enable to run all tests on nodejs
2015-12-03 09:06:49 -08:00
Guillermo Rauch
5721682e13 Merge pull request #923 from nkzawa/patch-24
Fix a socket can't connect while disconnecting a different one
2015-12-03 09:00:46 -08:00
nkzawa
6ee4283da0 enable to run all tests on nodejs 2015-12-03 19:37:30 +09:00
nkzawa
41956806a7 fix a socket can't connect while disconnecting a different one 2015-12-03 17:44:47 +09:00
Guillermo Rauch
d3ec23c6dd Merge pull request #34 from nkzawa/patch-2
Remove browsers setting from .zuul.yml
2015-12-02 11:20:05 -08:00
Guillermo Rauch
62f6db6516 Merge pull request #53 from nkzawa/patch-7
Remove browsers setting from .zuul.yml
2015-12-02 11:19:51 -08:00
Guillermo Rauch
af4d504cd8 Merge pull request #841 from capaj/master
added a main for JSPM
2015-12-02 09:56:29 -08:00
Guillermo Rauch
29eeddcfaa Merge pull request #919 from nkzawa/patch-19
Remove browsers setting from .zuul.yml
2015-12-02 09:55:43 -08:00
Guillermo Rauch
a64a1a3142 Merge pull request #920 from nkzawa/patch-20
Fix travis settings
2015-12-02 09:55:35 -08:00
Guillermo Rauch
64e65aae7e Merge pull request #921 from nkzawa/patch-21
Fix an unstable test
2015-12-02 09:55:22 -08:00
Guillermo Rauch
2561eb8fbf Merge pull request #922 from nkzawa/patch-22
IPv6 support
2015-12-02 09:55:14 -08:00
nkzawa
18be967adb ipv6 support 2015-12-03 00:09:31 +09:00
Naoyuki Kanezawa
0d3eaca617 Merge pull request #52 from darrachequesne/patch-1
Fix ArrayBuffer encoding in base64 string
2015-12-02 22:24:49 +09:00
Damien Arrachequesne
96fa4f907a Fix ArrayBuffer encoding in base64 string 2015-12-02 10:49:33 +01:00
nkzawa
3313401082 fix an unstable test 2015-12-02 13:13:07 +09:00
nkzawa
444f9eb7d5 disable tests on microsoftedge for now 2015-12-02 12:45:56 +09:00
nkzawa
ac8bf8d86d fix travis settings 2015-12-02 11:59:24 +09:00
nkzawa
71a1f5f80a remove browsers setting from .zuul.yml 2015-12-02 11:03:13 +09:00
nkzawa
ed826922d8 remove browsers setting from .zuul.yml 2015-12-02 11:01:44 +09:00
nkzawa
8c5a124b17 remove browsers setting from .zuul.yml 2015-12-02 10:56:45 +09:00
Guillermo Rauch
fc6451c3ac package: bump engine.io-client 2015-12-01 12:16:08 -08:00
Guillermo Rauch
b29312bc61 package: bump engine.io for node 0.8 fix 2015-12-01 12:15:36 -08:00
Guillermo Rauch
ec673d11f1 Release 1.6.3 2015-12-01 12:15:07 -08:00
Guillermo Rauch
22ebac4860 fix tests for 0.8 2015-12-01 11:41:49 -08:00
Guillermo Rauch
5a1b36e9bd restore testing on 0.8 2015-12-01 11:36:29 -08:00
Guillermo Rauch
98d9fe3f59 fix tests on node 0.8 2015-12-01 11:35:54 -08:00
Guillermo Rauch
51901160df package: temporarily revert version for tests 2015-12-01 11:24:06 -08:00
Guillermo Rauch
81bf3ebc5c Merge pull request #908 from paladox/patch-3
Update .travis.yml
2015-12-01 11:12:30 -08:00
Guillermo Rauch
86a599948c Merge pull request #918 from nkzawa/patch-18
Remove compress option from packets
2015-12-01 11:11:19 -08:00
Guillermo Rauch
4fd450d530 Merge pull request #370 from nkzawa/patch-11
Improve X-XSS-Protection header definition
2015-12-01 10:51:42 -08:00
nkzawa
78b287742d improve X-XSS-Protection header definition 2015-12-01 23:03:44 +09:00
nkzawa
ba45dd5211 remove compress option from packets 2015-12-01 20:47:28 +09:00
Guillermo Rauch
b54cb5b555 Merge pull request #369 from nkzawa/permessage-deflate-threshold
Threshold for permessage-deflate
2015-11-30 22:49:54 -08:00
nkzawa
1472a79884 remove the compress option from control packets 2015-12-01 14:28:33 +09:00
nkzawa
b56603169a add threshold for permessage-deflate 2015-12-01 14:21:53 +09:00
Guillermo Rauch
1a05ee1de7 pacakage: bump engine.io-client for ws memory fix 2015-11-30 08:16:45 -08:00
Guillermo Rauch
ab1b36e13f package: bump engine.io for ws memory fix 2015-11-30 08:16:21 -08:00
Guillermo Rauch
dc79cdd824 Release 1.6.2 2015-11-30 08:15:53 -08:00
Guillermo Rauch
de702fed1e package: bump engine.io-client 2015-11-30 08:13:18 -08:00
Guillermo Rauch
6786ad7233 package: bump ws for memory fix with compression 2015-11-30 08:09:40 -08:00
Guillermo Rauch
f3a0dc7b74 Merge pull request #368 from nkzawa/patch-10
Don't compress control packets
2015-11-29 09:39:41 -08:00
nkzawa
5092c4fc95 don't compress control packets 2015-11-29 23:27:08 +09:00
Guillermo Rauch
e4f5632a4c package: bump engine.io-client 2015-11-28 16:35:01 -08:00
Guillermo Rauch
f7a2f35590 package: bump engine.io 2015-11-28 16:34:44 -08:00
Guillermo Rauch
afda51a648 Release 1.6.1 2015-11-28 16:33:54 -08:00
Guillermo Rauch
41e7a468a9 package: bump engine.io-client for ws options fix 2015-11-28 16:33:04 -08:00
Guillermo Rauch
3aee0c7ec0 Release 1.2.3 2015-11-28 16:31:29 -08:00
Guillermo Rauch
c348737fe6 socket.io: increase large binary data test timeout 2015-11-28 15:13:13 -08:00
Guillermo Rauch
5bafc69222 package: bump engine.io-client for release 2015-11-28 12:07:29 -08:00
Guillermo Rauch
dde3737165 package: bump engine.io for release 2015-11-28 12:07:08 -08:00
Guillermo Rauch
9a2c73fc4d update deps and fix example 2015-11-28 12:00:39 -08:00
Guillermo Rauch
705fec3d1c Release 1.6.0 2015-11-28 11:53:37 -08:00
Guillermo Rauch
8df4c7931b Merge pull request #2325 from darrachequesne/patch-2
Trigger callback even when joining an already joined room
2015-11-28 10:56:46 -08:00
Damien Arrachequesne
1dfacc6647 Trigger callback even when joining an already joined room 2015-11-27 22:08:18 +01:00
Guillermo Rauch
35a0fe0377 package: bump parser 2015-11-25 10:14:56 -08:00
Guillermo Rauch
032350c569 Merge branch 'master' of github.com:socketio/socket.io-parser 2015-11-25 10:13:04 -08:00
Guillermo Rauch
b5f7c7573a Release 2.2.6 2015-11-25 10:12:58 -08:00
Guillermo Rauch
d1dde2c9b5 Merge branch 'master' of github.com:socketio/socket.io-client 2015-11-25 09:55:58 -08:00
Guillermo Rauch
ef01b22ad9 manager: fix Object.prototype extensions 2015-11-25 09:55:43 -08:00
Guillermo Rauch
67094a2e85 Merge pull request #33 from nkzawa/patch-1
Build on Node 4 and 0.12, remove env settings
2015-11-25 08:39:20 -08:00
nkzawa
1a762375ac build on Node 4 and 0.12, remove env settings 2015-11-26 01:08:51 +09:00
Guillermo Rauch
9deffc255e container infra 2015-11-24 12:58:07 -08:00
Guillermo Rauch
e1d85d47d5 container infra 2015-11-24 12:57:42 -08:00
Guillermo Rauch
f439b2a6b9 Merge pull request #914 from nkzawa/patch-17
ngrok v2 setup
2015-11-24 11:36:38 -08:00
Guillermo Rauch
5b89b78d3c Merge pull request #51 from nkzawa/patch-6
ngrok v2 setup
2015-11-24 11:36:25 -08:00
Guillermo Rauch
4e1061eefe Merge pull request #32 from nkzawa/patch-0
Build matrix and ngrok v2 setup
2015-11-24 11:36:17 -08:00
nkzawa
3b26ac037d build matrix and ngrok v2 setup 2015-11-25 03:20:41 +09:00
nkzawa
7ee96e97fb ngrok v2 setup 2015-11-25 03:05:17 +09:00
nkzawa
713e5e3468 set a new ngrok authtoken 2015-11-25 00:31:31 +09:00
nkzawa
410224d2cd bump zuul and zuul-ngrok 2015-11-25 00:31:09 +09:00
Guillermo Rauch
b9ba0ec0fc Merge pull request #367 from darrachequesne/patch-1
Add hasOwnProperty checks
2015-11-23 10:05:46 -08:00
Guillermo Rauch
e787cb2669 Merge pull request #912 from nkzawa/patch-16
Bump debug module
2015-11-23 10:02:15 -08:00
Guillermo Rauch
3b00312fa7 namespace: clear rooms flag after a clients call (fixes #1978) 2015-11-23 09:40:57 -08:00
Guillermo Rauch
7b420295ef Merge pull request #2249 from pmq20/minqi-another
[Travis] Add Node 4.x to the test matrix
2015-11-23 09:31:48 -08:00
Guillermo Rauch
c504315982 Merge pull request #2322 from darrachequesne/issue-2199-clean
Add hasOwnProperty checks
2015-11-23 09:19:35 -08:00
Guillermo Rauch
520b5c37d5 Merge pull request #2321 from nkzawa/patch-6
Update redirects in README
2015-11-23 09:19:03 -08:00
Damien Arrachequesne
cf9b0298a1 Add hasOwnProperty checks 2015-11-23 15:13:19 +01:00
Damien Arrachequesne
09f446eca0 Add hasOwnProperty checks 2015-11-23 15:12:21 +01:00
Naoyuki Kanezawa
aecf3bf71c Merge pull request #2218 from futbalguy/master
Clarified documentation of Socket.in
2015-11-23 17:37:07 +09:00
nkzawa
6c0a79e2b9 update redirects in README 2015-11-23 17:28:11 +09:00
nkzawa
8c1e3bade9 bump debug module 2015-11-23 16:56:37 +09:00
Guillermo Rauch
44b7d3e57b Merge pull request #50 from nkzawa/patch-5
Fix encoding blob as base64
2015-11-22 10:36:06 -08:00
Guillermo Rauch
8683206e31 Merge pull request #2239 from darrachequesne/issue-2199
converted arrays to objects
2015-11-22 10:34:57 -08:00
Guillermo Rauch
988d9d2346 Merge pull request #1999 from nkzawa/patch-3
Fix a few assertions are not executed properly
2015-11-22 10:17:02 -08:00
Guillermo Rauch
aaec7f5880 Merge pull request #876 from nkzawa/patch-15
Add a test for the case reconnection doesn't work
2015-11-22 10:16:52 -08:00
Naoyuki Kanezawa
f2a825557c Merge pull request #23 from chylli/fix-event-order
fix the order of events
2015-11-23 00:33:00 +09:00
Damien Arrachequesne
b73d9bea4e converted arrays to objects 2015-11-22 11:12:40 +01:00
nkzawa
685cb719e8 fix encoding blob as base64 2015-11-22 16:05:26 +09:00
Naoyuki Kanezawa
d4fb6a5904 Merge pull request #2316 from tripu/master
Update “debug” to avoid vulnerability in “ms”
2015-11-22 10:39:23 +09:00
tripu
0517c609ba Avoid ^ in "debug" dependency (fixes #2314) 2015-11-21 23:59:16 +01:00
tripu
aa9438fee2 Update package "debug" to avoid "ms" vulnerability 2015-11-21 23:55:00 +01:00
Guillermo Rauch
aee466cc71 Update Readme.md 2015-11-21 10:54:19 -08:00
Guillermo Rauch
057f32d195 Merge pull request #318 from amiuhle/cookie-path
Cookie path
2015-11-21 10:47:26 -08:00
Guillermo Rauch
65f75d7732 Merge branch 'master' of github.com:socketio/socket.io 2015-11-21 10:46:26 -08:00
Guillermo Rauch
af13a5f2cd package: bump socket.io-parser 2015-11-21 10:46:05 -08:00
Guillermo Rauch
279c52a4c5 package: bump socket.io-parser 2015-11-21 10:45:43 -08:00
Guillermo Rauch
913ddb8c6e Release 2.2.5 2015-11-21 10:45:33 -08:00
Guillermo Rauch
9e7652ee2d package: bump debug 2015-11-21 10:42:42 -08:00
Guillermo Rauch
ab90f185ca package: bump debug 2015-11-21 10:36:02 -08:00
Naoyuki Kanezawa
67d1a67b1c Merge pull request #2319 from darrachequesne/patch-3
Minor fix
2015-11-21 23:21:39 +09:00
Damien Arrachequesne
aae68d74b1 Minor performance optimization 2015-11-20 22:03:03 +01:00
Damien Arrachequesne
bf5897cedc Fixed tests with large data 2015-11-20 22:01:16 +01:00
Damien Arrachequesne
a1a1c6657a Removed unused variable 2015-11-20 22:00:42 +01:00
Guillermo Rauch
2a4f7ae161 Merge pull request #2136 from nkzawa/patch-5
Don't set request property
2015-11-20 12:59:05 -08:00
Naoyuki Kanezawa
dba0576ca9 Merge pull request #2317 from ChaofengZhou/master
fixed a typo in the example code
2015-11-20 13:13:10 +09:00
Chaofeng
ba90f0991b fixed a typo in the example code 2015-11-19 21:09:34 -07:00
Naoyuki Kanezawa
6387bb003c Merge pull request #31 from gibson042/client-gh-898
update JSON3 to 3.3.2
2015-11-20 12:01:31 +09:00
Richard Gibson
009188fe98 update JSON3 to 3.3.2
Also updates zuul so `npm update` completes.

Fixes https://github.com/socketio/socket.io-client/issues/898
2015-11-19 21:37:02 -05:00
paladox
713934b28e Update .travis.yml 2015-11-19 18:57:44 +00:00
paladox
0f0d99efa6 Update .travis.yml 2015-11-19 18:56:25 +00:00
Naoyuki Kanezawa
c45e198ffe Merge pull request #882 from sanemat/chore/travis
test against nodejs v0.12 and v4
2015-11-20 03:52:57 +09:00
Naoyuki Kanezawa
08a04b5f22 Merge pull request #833 from bfontaine/patch-1
Missing backquote in README
2015-11-20 03:19:36 +09:00
Guillermo Rauch
6e0ecb4d3a package: bump debug 2015-11-19 09:44:13 -08:00
Guillermo Rauch
015d04c699 package: bump mocha 2015-11-18 19:54:11 -08:00
Guillermo Rauch
9a54e9cace package: bump mocha 2015-11-18 19:53:25 -08:00
Guillermo Rauch
9df4cb64b8 bump zuul-ngrok 2015-11-18 19:51:47 -08:00
Guillermo Rauch
5b4dc50166 Update .zuul.yml 2015-11-18 19:03:20 -08:00
Guillermo Rauch
09e9b4f1ca Update README.md 2015-11-18 17:49:08 -08:00
Guillermo Rauch
e8c786a5ae Fix badge 2015-11-18 17:31:05 -08:00
Guillermo Rauch
ee3e44110c package: bump has-binary 2015-11-18 16:56:36 -08:00
Guillermo Rauch
c8f525868a package: bump has-binary 2015-11-18 16:56:06 -08:00
Guillermo Rauch
a39d7c2ae4 Merge pull request #2171 from KevinMartin/patch-1
Actually prevent double callbacks...
2015-11-18 12:56:01 -08:00
Guillermo Rauch
b79830edd7 Merge pull request #348 from nkzawa/patch-7
Fix polling transports and add tests for closing transports
2015-11-18 10:41:15 -08:00
Guillermo Rauch
8163660cda Merge pull request #338 from nkzawa/patch-2
Call res.end() when polling error
2015-11-18 10:40:50 -08:00
Guillermo Rauch
1b9254c962 Merge pull request #354 from CantemoInternal/master
Add LICENSE file
2015-11-18 10:40:34 -08:00
Guillermo Rauch
12aeeb394a Merge pull request #364 from nkzawa/patch-cert-expiration
Renew certs for tests to extend expiration date
2015-11-18 10:39:48 -08:00
Naoyuki Kanezawa
410d1086a9 Merge pull request #49 from sanemat/chore/travis-ci-node-v4
test on nodejs v4.0
2015-11-19 03:13:32 +09:00
Guillermo Rauch
1754a3ca34 Fix badges 2015-11-18 10:08:28 -08:00
nkzawa
ce835c3b22 renew certs to extend expiration date 2015-11-19 02:46:44 +09:00
Naoyuki Kanezawa
3c9c544d9f Merge pull request #347 from lpinca/fix/repository-url
package: fix repository url
2015-11-18 23:28:33 +09:00
Naoyuki Kanezawa
6a85f8e31a Merge pull request #353 from DavidCai1993/patch-1
Fix a small typo
2015-11-18 23:23:14 +09:00
Guillermo Rauch
4ba266d404 Merge pull request #2307 from darrachequesne/patch-1
Upgrade npm version in order to fix node v0.8 build
2015-11-16 15:55:20 -08:00
Damien Arrachequesne
6b49779420 Upgrade npm version in order to fix node v0.8 build 2015-11-17 00:44:42 +01:00
Guillermo Rauch
f1f5b621f0 Merge pull request #326 from shinnn/container-based-build
Use container-based infrastructure for faster build
2015-11-16 13:50:44 -08:00
Guillermo Rauch
fb811bf200 Merge pull request #305 from lbdremy/fix/set-encoding-before-listening-on-data
Set encoding of the request to utf8 before listening on data events
2015-11-16 13:27:28 -08:00
Guillermo Rauch
b1775b1cb8 Merge pull request #2051 from tobalsgithub/master
Allowing a custom function for opts.allowRequest
2015-11-16 13:15:08 -08:00
Guillermo Rauch
ef52967301 Merge pull request #2271 from dazorni/master
Working travis build status
2015-11-16 13:12:26 -08:00
Guillermo Rauch
fde38b1bd7 Merge pull request #2208 from odeke-em/fix-legacy-repo-info
README: fixed up legacy repo links
2015-11-16 13:10:24 -08:00
Baptiste Fontaine
00b611c5f1 Missing backquote in README 2015-10-30 16:38:14 +01:00
Sebastian Zorn
75da57abb2 Working travis build status 2015-10-06 21:42:33 +02:00
nkzawa
02f9ed8173 remove listeners upon clearTransport 2015-09-30 05:26:51 +09:00
nkzawa
d74b3c7277 Merge branch 'master' into patch-7 2015-09-30 02:36:25 +09:00
Sergey Nuzdhin
b166d99b64 Add LICENSE file 2015-09-28 14:18:29 +02:00
DavidCai
829c4b5ec1 Fix a small typo
Fix a small typo
2015-09-24 15:03:57 +08:00
Samuel Reed
d29511f991 Prevent v8 deopt when using [].slice.call(arguments) 2015-09-22 17:17:11 -05:00
Guillermo Rauch
d125da3c0f Merge branch '1.3.7-patch' 2015-09-21 04:31:17 +04:00
Guillermo Rauch
21ea31a34e Merge branch '1.3.7-patch' 2015-09-21 04:30:59 +04:00
Guillermo Rauch
e2ebd4349b Release 1.3.7 2015-09-21 04:21:11 +04:00
Guillermo Rauch
3fe5c2a26c Release 1.3.7 2015-09-21 04:21:04 +04:00
Guillermo Rauch
1196876a55 package: bump socket.io for node4 support 2015-09-21 04:19:06 +04:00
Guillermo Rauch
b771f74a22 package: bump socket.io-client for node4 compatibility 2015-09-21 04:16:59 +04:00
Guillermo Rauch
8744007dc7 package: bump engine.io for node4 compatibility 2015-09-21 04:10:19 +04:00
Guillermo Rauch
fc4e4d9a56 package: bump engine.io-client for node4 compatibility 2015-09-21 04:09:49 +04:00
P.S.V.R
3658928ee7 [Travis] Add Node 4.x to the test matrix 2015-09-16 17:39:26 +08:00
Luigi Pinca
f70799c845 package: fix repository url 2015-09-12 08:09:24 +02:00
sanemat
3310cf25b5 test against nodejs v0.12 and v4 2015-09-12 04:36:59 +09:00
sanemat
117b6bda4c test on nodejs v4.0 2015-09-12 04:19:52 +09:00
Naoyuki Kanezawa
3df49bb86e Merge pull request #351 from sanemat/chore/base64id-is-dep
base64id is not devDependency but dependency
2015-09-12 03:40:35 +09:00
sanemat
e1addf75f9 base64id is not devDependency but dependency
lib/server.js uses base64id
0e70cf26d0/lib/server.js (L10)
v1.5.4 has base64id as dependency
6032a13cbe/package.json (L27)

https://github.com/socketio/engine.io/pull/350
2015-09-12 03:28:02 +09:00
Guillermo Rauch
0e70cf26d0 Merge pull request #350 from nkzawa/patch-8
Fix dependencies and tests
2015-09-11 10:19:29 -07:00
nkzawa
bb286d810f fix tests fail on node 4.0 2015-09-11 05:19:42 +09:00
nkzawa
41bf79134c fix dependencies 2015-09-11 04:46:14 +09:00
Guillermo Rauch
210e688732 package: bump engine.io 2015-09-09 15:47:14 -07:00
Guillermo Rauch
4c22f33c0b package: bump engine.io-client 2015-09-09 15:46:48 -07:00
Guillermo Rauch
7e77dd511e Merge branch '1.5.4-patch' 2015-09-09 15:42:23 -07:00
Guillermo Rauch
6032a13cbe Release 1.5.4 2015-09-09 15:32:18 -07:00
Guillermo Rauch
df67ed6699 package: bump engine.io-parser 2015-09-09 15:08:38 -07:00
Guillermo Rauch
f4cd4afa8e Release 1.2.2 2015-09-09 15:06:06 -07:00
Guillermo Rauch
4c48338962 remove iphone 4.3 from testing 2015-09-09 14:50:11 -07:00
Guillermo Rauch
b8179dc6f7 Merge pull request #46 from Nibbler999/iojs-3.0
Fix iojs 3.0 Buffer.buffer issue
2015-09-09 14:40:29 -07:00
Guillermo Rauch
8705870ed7 Merge branch '1.5.3-patch' 2015-09-09 09:09:00 -07:00
Guillermo Rauch
5ccbcf3106 Release 1.5.3 2015-09-09 09:06:55 -07:00
Guillermo Rauch
1a115d3493 package: bump ws 2015-09-09 08:56:14 -07:00
nkzawa
66d85e4a5c add tests for closing transports 2015-09-09 03:55:32 +09:00
nkzawa
4bce72c160 call onClose and add close timeout on polling transport 2015-09-09 03:55:10 +09:00
nkzawa
bc764aeaac add a test for the case reconnection doesn't work 2015-09-03 02:21:12 +09:00
Naoyuki Kanezawa
caaad3e5eb Merge pull request #853 from Xubor/master
Fix of reconnection stopping during disconnect
2015-09-03 02:08:46 +09:00
Naoyuki Kanezawa
79a001d2e0 Merge pull request #337 from fmm/patch-1
Update server.js
2015-09-02 01:52:11 +09:00
Guillermo Rauch
ae5420b727 package: bump engine.io and socket.io-client 2015-08-30 10:51:25 -07:00
Guillermo Rauch
bf981531ed package: bump engine.io-client 2015-08-30 10:50:15 -07:00
Guillermo Rauch
f3fd4bb7eb Merge pull request #344 from nkzawa/patch-6
Fix sockets can stay open when upgrade failed
2015-08-29 13:45:04 -07:00
Guillermo Rauch
7b1d4cb838 Merge pull request #343 from nkzawa/patch-5
Fix extraHeaders option and ping timeout tests
2015-08-29 13:44:32 -07:00
nkzawa
ba7226f377 fix unstable tests 2015-08-30 04:00:44 +09:00
nkzawa
bd4833d4ab bump engine.io-client 2015-08-30 04:00:27 +09:00
nkzawa
deb7ae40a4 fix sockets can stay open when upgrade failed 2015-08-29 03:48:05 +09:00
Naoyuki Kanezawa
7ebcdea38d Merge pull request #303 from lpinca/fix/attributions
CHANGELOG: fix attributions
2015-08-29 01:23:47 +09:00
Guillermo Rauch
90d3286dad Merge pull request #336 from apeace/bug/socketio-1910
Fixes socket.io#1910 by calling transport.close() on ping timeout
2015-08-27 13:20:50 -07:00
Guillermo Rauch
dafce5d36e Merge pull request #340 from nkzawa/patch-4
Ensure sockets are closed on error
2015-08-27 13:19:18 -07:00
Guillermo Rauch
4f6e3cfc09 Merge pull request #339 from nkzawa/patch-3
Fix transport readyState and leaking sockets
2015-08-27 13:19:07 -07:00
futbalguy
d5b3bb46f8 Clarified documentation of Socket.in 2015-08-23 10:12:23 -07:00
Tom Atkinson
664f2af8e7 Fix some additional test failures found in main engine.io test suite 2015-08-22 04:07:37 +02:00
Tom Atkinson
32980f8f63 Fix iojs 3.0 Buffer.buffer issue 2015-08-20 23:46:46 +02:00
nkzawa
5efbf46626 ensure sockets are closed on error 2015-08-21 03:37:49 +09:00
nkzawa
54617e994a fix transport readyState 2015-08-21 02:15:26 +09:00
nkzawa
8c018befe3 call res.end when polling error 2015-08-20 03:10:50 +09:00
Emmanuel Odeke
575d35a371 README: fixed up legacy repo links 2015-08-16 20:36:39 -06:00
Filipe Martins
fd89de6232 Update server.js
Fixes index iteration on Int32Array type.
2015-08-10 16:48:22 -03:00
Andrew Peace
8e1f063c54 Fixes socket.io#1910 by calling transport.close() on ping timeout 2015-08-06 15:43:00 -04:00
Guillermo Rauch
e41483be9e Merge branch '1.3.6-patch' 2015-07-14 20:04:44 -07:00
Guillermo Rauch
c79e787671 test: better timeout for stress test 2015-07-14 19:58:42 -07:00
Guillermo Rauch
a2f6bb99d6 Merge branch '1.3.6-patch' 2015-07-14 18:02:56 -07:00
Guillermo Rauch
1659122142 Merge branch '1.3.6-patch' 2015-07-14 18:00:35 -07:00
Guillermo Rauch
1c96b3aeab Release 1.3.6 2015-07-14 17:59:51 -07:00
Guillermo Rauch
3e4061bfef Release 1.3.6 2015-07-14 17:59:50 -07:00
Guillermo Rauch
1ee39a4dd7 fix travis badge 2015-07-14 17:21:52 -07:00
Guillermo Rauch
4895258cae fix travis badge 2015-07-14 17:21:00 -07:00
Guillermo Rauch
a4dcf1958b Merge commit '9e5dd3e5126f1e3a9929bea201c500d0f47bad5d' 2015-07-14 17:19:29 -07:00
Guillermo Rauch
9e5dd3e512 README: fix travis badge 2015-07-14 17:19:02 -07:00
Guillermo Rauch
3d2e903788 package: bump engine.io-client to fix build on windows 2015-07-09 09:29:06 -07:00
Guillermo Rauch
4c1d691fe5 package: bump engine.io to fix build on windows 2015-07-09 09:28:43 -07:00
Guillermo Rauch
c7f265b515 Merge branch '1.5.2-patch' 2015-07-09 09:25:42 -07:00
Guillermo Rauch
8e6139bf12 Release 1.5.2 2015-07-09 09:24:36 -07:00
Guillermo Rauch
f3226b1ddf Merge branch '1.5.2-patch' 2015-07-09 09:16:12 -07:00
Guillermo Rauch
f002d5b4db server: fix test 2015-07-09 09:14:48 -07:00
Guillermo Rauch
788b50e651 package: bump engine.io-client (for tests) 2015-07-08 10:28:01 -07:00
Guillermo Rauch
2807a2c34d server: make error test pass consistently 2015-07-08 10:24:37 -07:00
Guillermo Rauch
fa75b47e1f package: bump ws to fix build issues 2015-07-08 10:24:21 -07:00
Kevin Jose Martin
514aeb4fcd Actually prevent double callbacks...
We declare `sent = false` and even check `if (sent)` is truthy, but we never set it to truthy, therefore it never really *prevents double callbacks*...
2015-07-06 11:36:00 -04:00
Xubor
627dda0ff6 Fix of reconnection stopping during disconnect 2015-06-18 22:30:44 +02:00
Guillermo Rauch
b54c255b9b Merge pull request #333 from nkzawa/patch-1
Fix a test failure
2015-06-16 09:49:48 -07:00
Naoyuki Kanezawa
c78c6d82f3 fix a test failure 2015-06-17 01:10:22 +09:00
Guillermo Rauch
7df5c61dd8 package: bump client 2015-06-15 13:00:12 -07:00
Manuel Baclet
bac5b0ec32 Simplify and clarify. 2015-06-11 11:37:24 +02:00
Manuel Baclet
55274af45a Small fix. 2015-06-11 11:36:06 +02:00
Manuel Baclet
1a5b6d4485 Comments on Room methods. 2015-06-11 10:58:40 +02:00
Manuel Baclet
f7e7c07fae Remove some spaces. 2015-06-11 10:58:20 +02:00
Manuel Baclet
89bd58129d Merge pull request #1 from kapouer/patch-1
Add missing closing curly brace
2015-06-11 10:37:30 +02:00
Jérémy Lal
930741ffa5 Add missing closing curly brace 2015-06-11 01:01:49 +02:00
Guillermo Rauch
337c601dc2 Merge pull request #332 from nkzawa/patch-0
Fix wrong packet referring
2015-06-06 16:55:17 -07:00
Nathan Rajlich
876833198d Merge pull request #2111 from kemitchell/spdx-license
Use a Standard-Compliant License Identifier
2015-06-05 11:51:30 -07:00
Manuel Baclet
8e5bae4ad9 Add a newline at end of file. 2015-06-03 10:49:09 +02:00
Manuel Baclet
5c79d6ec27 Use a Room class to efficiently track room size. 2015-06-03 10:36:27 +02:00
Naoyuki Kanezawa
30d9d7fa6a fix wrong packet referring 2015-05-31 16:05:25 +09:00
Naoyuki Kanezawa
4d36d6c01a don't set request property 2015-05-30 03:34:05 +09:00
Guillermo Rauch
e76a671b76 bump server 2015-05-27 22:56:36 -07:00
Guillermo Rauch
43fa075ec4 bump client 2015-05-27 22:56:15 -07:00
Guillermo Rauch
91c7bde34b Merge commit '342faf219793fc5c1f130fc33e3fb5422dab516d' 2015-05-27 22:55:15 -07:00
Guillermo Rauch
ba3181785f Merge commit '6527a4bfc97720f91549038f8a2b2a24ccf3e1cb' 2015-05-27 22:55:03 -07:00
Guillermo Rauch
86c31f6e13 package: bump deps 2015-05-27 13:44:27 -07:00
Guillermo Rauch
1ecf02e32f package: bump engine.io-client 2015-05-27 13:08:57 -07:00
Guillermo Rauch
c40039360b test/server: remove callbackBuffer assertions 2015-05-27 12:55:53 -07:00
Guillermo Rauch
e7633370f3 server: remove assertion founded solely on a race condition (╯°□°)╯︵ ┻━┻ 2015-05-27 12:45:31 -07:00
Guillermo Rauch
e3b5097f9e package: bump server 2015-05-27 08:19:35 -07:00
Guillermo Rauch
874a4a8535 package: bump client 2015-05-27 08:19:15 -07:00
Roman Shtylman
611d2a2b24 Merge pull request #44 from nkzawa/patch-4
Bump dependencies, update package.json and travis settings
2015-05-26 13:36:23 -04:00
Naoyuki Kanezawa
d8717c127f bump dependencies, update package.json 2015-05-27 02:21:08 +09:00
Naoyuki Kanezawa
7802662bdc update travis settings 2015-05-27 02:13:14 +09:00
Guillermo Rauch
93b571406e package: bump engine.io to fix build issues 2015-05-25 14:34:10 -07:00
Nathan Rajlich
ab2bd0b7e9 Merge pull request #330 from johanneswuerbach/patch-2
ws v0.7.2
2015-05-25 12:45:45 -07:00
Guillermo Rauch
860af4dc0b Merge pull request #325 from teambition/teambition
support custom socket id
2015-05-21 10:25:23 -07:00
Jiri Spac
2546b3e9d9 added a main for JSPM
jspm people like me would love it, if we could have our main defined such as this.
that wouls allow us to do:
```
jspm install socket.io-client
```
and it would work without us overriding anything in jspm registry.
2015-05-20 16:14:25 +02:00
Johannes Würbach
212f289252 ws v0.7.2
iojs 2.x support
2015-05-16 19:52:43 +02:00
zensh
df4331dd1a support custom socket id 2015-05-08 10:24:32 +08:00
Kyle Mitchell
98af793f07 use a valid SPDX license identifier 2015-05-05 00:08:44 +00:00
Guillermo Rauch
d0e03b6826 Merge pull request #327 from shinnn/svg-badges
Use SVG badges instead of PNG badges
2015-04-29 16:39:13 -07:00
Shinnosuke Watanabe
affbfc59b2 Use SVG badges instead of PNG badges
SVG badges look beautiful on retina displays.
2015-04-30 08:14:07 +09:00
Shinnosuke Watanabe
85e288098e Use container-based infrastructure for faster build
http://docs.travis-ci.com/user/workers/container-based-infrastructure/
2015-04-30 08:07:53 +09:00
Guillermo Rauch
e76a544f2e Merge pull request #28 from nevir/patch-1
Add a LICENSE file
2015-04-27 20:09:11 -07:00
Naoyuki Kanezawa
9adacd9875 Merge pull request #323 from yujiosaka/fix_package_json
fix package.json wrongly referrering to self
2015-04-23 18:59:26 +09:00
yujiosaka
50604b8660 fix package.json wrongly referrering to self 2015-04-23 17:43:08 +09:00
Guillermo Rauch
3f72dd3322 Merge pull request #2063 from kapouer/patch-1
Let adapter.add find connected socket
2015-04-10 21:38:41 -07:00
Guillermo Rauch
c9659791bb Merge pull request #319 from adrai/master
added test case for extraHeaders (client)
2015-04-10 14:32:31 -07:00
Adriano Raiano
299ec66d0b fixing test 2015-04-10 21:40:51 +02:00
Adriano Raiano
85a87c3d51 added test case for https://github.com/Automattic/engine.io-client/pull/379 2015-04-10 21:40:51 +02:00
Guillermo Rauch
e898166382 Update README.md 2015-04-08 16:53:25 -07:00
Guillermo Rauch
d0d38220fb Update Readme.md 2015-04-08 16:53:04 -07:00
Guillermo Rauch
e566be74bc package: bump engine.io-client 2015-04-08 10:29:39 -07:00
Guillermo Rauch
2a7219018e Merge pull request #817 from nkzawa/patch-14
Bump component-emitter
2015-04-06 11:03:09 -07:00
Guillermo Rauch
e29f668caa Merge pull request #832 from lattmann/fix/apply_not_defined
Use the same onack logic on client side what server uses.
2015-04-06 11:02:44 -07:00
Zsolt Lattmann
4d059c858c Two space indents for the code changes. 2015-04-06 10:11:45 -05:00
Zsolt Lattmann
8d878364e5 Revert socket.io.js changes back to c4102a6 2015-04-06 09:49:07 -05:00
Guillermo Rauch
309ec47c6d Merge pull request #827 from amitport/patch-1
there is no 'connect' event in manager
2015-04-05 17:23:22 -07:00
Guillermo Rauch
7d0eaa57b3 remove unnecessary index.js 2015-04-05 17:20:42 -07:00
Guillermo Rauch
f8aa157d5d remove proxy index file 2015-04-05 16:53:28 -07:00
Guillermo Rauch
0e13e9a268 bumped adapter 2015-04-05 15:52:59 -07:00
Guillermo Rauch
de5cba46ce Merge pull request #26 from nkzawa/patch-0
Fix to apply volatile and compress flags when bloadcasting
2015-04-05 15:52:02 -07:00
Guillermo Rauch
916872587f Merge pull request #2013 from nkzawa/namespace-flags
Supports flags on namespace
2015-04-05 15:51:54 -07:00
Guillermo Rauch
a7072845ea Merge pull request #2006 from nkzawa/patch-4
improve Socket#packet and Client#packet and enable volatile and compress when broadcast
2015-04-05 15:51:49 -07:00
Guillermo Rauch
4a1a66ac70 Merge pull request #27 from mikaturunen/patch-1
Update package.json license
2015-04-05 15:50:32 -07:00
Guillermo Rauch
ce4048d9cf Merge pull request #28 from nevir/patch-1
Add a LICENSE file
2015-04-05 15:50:24 -07:00
Guillermo Rauch
7bd785b84b package: bump engine.io-client to support ping and pong 2015-04-05 15:46:50 -07:00
Guillermo Rauch
adbd0e3e36 added support for ping and pong events
https://github.com/Automattic/socket.io/issues/1951
2015-04-05 15:45:17 -07:00
Guillermo Rauch
2a2866b049 proper handling of disconnection while in opening state 2015-04-05 12:20:13 -07:00
Guillermo Rauch
1e8e125d13 instrumentation / style tweaks 2015-04-05 12:19:51 -07:00
Guillermo Rauch
ffc12af647 added tests for same-namespace new connection handling (https://github.com/Automattic/socket.io/issues/1956) 2015-04-05 12:18:50 -07:00
Guillermo Rauch
61cb92a6fb style 2015-04-05 10:08:28 -07:00
Timo Uhlmann
0c28be9ba5 Test & doc for cookiePath 2015-04-03 15:05:56 +02:00
Timo Uhlmann
d227719cf9 Allow overriding the cookiePath 2015-04-03 14:50:29 +02:00
Ian MacLeod
25ebaab56c Add a LICENSE file
To appease the lawyery folk.
2015-04-02 14:57:05 -07:00
Ian MacLeod
53073e6a8c Add a LICENSE file
To appease the lawyery folk
2015-04-02 14:55:54 -07:00
Zsolt Lattmann
9115a5fd7a Use same onack function like it is in the server code. 2015-04-02 16:22:20 -05:00
Zsolt Lattmann
63cf9e76f6 Do not call apply if packet id is not in acks 2015-04-02 15:32:23 -05:00
Jérémy Lal
425409945b Let adapter.add find connected socket
When a socket connects, it joins its own room, resulting in a call to adapter.add.
The adapter in turn should be able to find the socket by id.
2015-03-24 14:54:52 +01:00
Nathan Rajlich
257bb31888 Merge pull request #317 from mikaturunen/patch-1
Update package.json license
2015-03-20 08:40:24 -07:00
Mika Turunen
17a2097f6d Update package.json license 2015-03-20 11:33:00 +02:00
Mika Turunen
4c7b1b1948 Update package.json license 2015-03-20 11:26:54 +02:00
Guillermo Rauch
5826ef0bb5 Merge pull request #2059 from rase-/update/debug
Bump debug to 2.1.3
2015-03-17 16:42:00 -07:00
Tony Kovanen
14e32a9bad Bump debug to 2.1.3 2015-03-18 01:40:19 +02:00
Guillermo Rauch
6ff9e4685c Merge pull request #316 from rase-/update/debug
Bump debug to 2.1.3
2015-03-17 16:25:22 -07:00
Guillermo Rauch
c4102a6034 Merge pull request #829 from rase-/update/debug
Bump debug to 2.1.3
2015-03-17 16:25:05 -07:00
Tony Kovanen
6a3521b297 Bump debug to 2.1.3 2015-03-18 00:45:07 +02:00
Tony Kovanen
c118be9d22 Bump debug to 2.1.3 2015-03-18 00:03:08 +02:00
Amit Portnoy
b5a2e21b60 there is no 'connect' event in manager
(as far as I can tell)
2015-03-15 20:52:57 +02:00
TC
1dde0f3947 Allowing a custom function for opts.allowRequest 2015-03-12 15:50:31 -06:00
Guillermo Rauch
6527a4bfc9 Release 1.3.5 2015-03-03 10:50:16 -08:00
Guillermo Rauch
342faf2197 Release 1.3.5 2015-03-03 10:50:10 -08:00
Guillermo Rauch
9474d8133a package: bump parser 2015-03-03 10:37:30 -08:00
Guillermo Rauch
5946685404 package: bump socket.io 2015-03-03 10:37:20 -08:00
Guillermo Rauch
12c6ee132d improve test 2015-03-03 10:34:56 -08:00
Guillermo Rauch
c9d909c993 package: bump socket.io-parser 2015-03-03 10:34:40 -08:00
Guillermo Rauch
6455fb2761 Release 2.2.4 2015-03-03 10:34:16 -08:00
Guillermo Rauch
7363746e8a added test 2015-03-03 10:33:51 -08:00
Guillermo Rauch
59d2329731 index: fix off-by-one bound checks 2015-03-03 10:22:09 -08:00
Guillermo Rauch
125ab51338 test: added test for parser breakage 2015-03-03 10:08:26 -08:00
Guillermo Rauch
600ed08b69 package: bump ws 2015-03-02 10:47:56 -08:00
Guillermo Rauch
663c85b9fe test with 0.12 2015-02-19 15:38:51 -08:00
Guillermo Rauch
b31ac18554 test with 0.12 2015-02-19 15:38:35 -08:00
Naoyuki Kanezawa
53cdd8f1fc support flags on namespace 2015-02-20 03:34:09 +09:00
Naoyuki Kanezawa
81aea995ed improve Socket#packet and Client#packet 2015-02-15 04:33:20 +09:00
Guillermo Rauch
1b2d902f33 Release 1.3.4 2015-02-14 10:57:50 -08:00
Guillermo Rauch
3309c1516e Release 1.3.4 2015-02-14 10:57:41 -08:00
Guillermo Rauch
9536437907 package: bump socket.io-client 2015-02-14 10:55:15 -08:00
Naoyuki Kanezawa
bd48c2f292 set flags as an option object 2015-02-15 03:08:45 +09:00
Guillermo Rauch
49fa6fc4ab Merge pull request #42 from rase-/update/bump-zuul-and-add-ngrok
Bump zuul and use ngrok
2015-02-13 15:45:47 -08:00
Guillermo Rauch
5576811ce3 Merge pull request #814 from rase-/update/bump-zuul-and-use-ngrok
Bump zuul and use ngrok
2015-02-13 15:45:30 -08:00
Naoyuki Kanezawa
659f43c304 bump component-emitter 2015-02-13 04:22:34 +09:00
Jonathan Ong
4d18307a2c 1.2.0 2015-02-12 10:33:32 -08:00
Naoyuki Kanezawa
b34d74c7ae fix adding events which have same names with methods of Object 2015-02-12 10:31:39 -08:00
Remy Loubradou
98e5890591 Set encoding of the request to utf8 before listening on data events 2015-02-12 18:46:06 +01:00
Naoyuki Kanezawa
56fe26661d fix a few assertions 2015-02-12 06:09:30 +09:00
Guillermo Rauch
64bd486ea5 semicolon 2015-02-11 08:24:36 -08:00
Tony Kovanen
2a4e985ecc Bump zuul and use ngrok 2015-02-10 11:47:59 +02:00
Tony Kovanen
2fceba70aa Bump zuul and use ngrok 2015-02-10 11:10:05 +02:00
Guillermo Rauch
3c00f970b5 Release 1.3.3 2015-02-03 17:27:52 -08:00
Guillermo Rauch
29974ac777 Release 1.3.3 2015-02-03 17:27:51 -08:00
Guillermo Rauch
ef23c74bea remove compression tests 2015-02-03 17:07:43 -08:00
Guillermo Rauch
49423d70bc added failing tests 2015-02-03 17:04:33 -08:00
Guillermo Rauch
715c7f99b4 socket: warn node_redis-style about missing error 2015-02-03 17:04:06 -08:00
Guillermo Rauch
f2ea965c6b package: bump parser 2015-02-03 16:32:48 -08:00
Guillermo Rauch
a93d05a9f3 package: bump parser 2015-02-03 16:30:49 -08:00
Guillermo Rauch
ed67684773 package: bump parser 2015-02-03 16:29:40 -08:00
Guillermo Rauch
52b80047ba package: bump parser 2015-02-03 16:28:48 -08:00
Guillermo Rauch
c4bfb06a72 Release 2.2.3 2015-02-03 16:28:11 -08:00
Guillermo Rauch
e77fc4c32b index: fix potential infinite loop with malicious binary packet 2015-02-03 16:26:53 -08:00
Guillermo Rauch
5ce06d3088 socket: warn node_redis-style about missing error 2015-02-03 16:26:21 -08:00
Guillermo Rauch
816bfec783 added failing tests 2015-02-03 16:26:08 -08:00
Guillermo Rauch
0a17c90d7a test: added failing test 2015-02-03 15:10:46 -08:00
Guillermo Rauch
d7961dd189 remove legacy travis env vars 2015-02-02 17:03:29 -08:00
Guillermo Rauch
3645741b86 test: increase timeout for large binary data test 2015-01-31 09:35:37 -08:00
Guillermo Rauch
1aead07c63 fix 2015-01-31 09:07:39 -08:00
Guillermo Rauch
e7c76a2c1a update deps 2015-01-31 08:48:14 -08:00
Guillermo Rauch
f2a7322b5a update deps 2015-01-31 08:46:32 -08:00
Guillermo Rauch
ae79d87274 allow clients(fn) 2015-01-31 08:41:21 -08:00
Guillermo Rauch
cb6e0d8b45 Merge pull request #24 from cha0s/clients
Suggestion for implementation of clients API
2015-01-31 08:40:16 -08:00
Guillermo Rauch
97c6568f65 Merge pull request #1966 from cha0s/clients
Suggestion for implementation of clients API
2015-01-31 08:34:43 -08:00
Ruben Rodriguez II
8814825a35 Suggestion for implementation of clients API 2015-01-31 02:17:49 -06:00
Guillermo Rauch
210d65d9dd Merge pull request #803 from masakij/fix-port-hint
Fix port hint
2015-01-30 09:54:15 -08:00
Guillermo Rauch
fe49e1c780 Merge pull request #805 from nkzawa/compression
Support compression
2015-01-30 09:43:46 -08:00
Guillermo Rauch
b17e0fa1a1 Merge branch 'master' of github.com:Automattic/socket.io-client 2015-01-30 08:15:38 -08:00
Guillermo Rauch
58eaecad27 Merge branch 'master' of github.com:Automattic/socket.io 2015-01-29 20:39:00 -08:00
Guillermo Rauch
94157e650e point to master 2015-01-29 20:38:36 -08:00
Guillermo Rauch
3a25cb5a98 poitn to master 2015-01-29 20:38:09 -08:00
Guillermo Rauch
435920512c Merge pull request #808 from michael-luo/bugfix/1956
Fix Socket.IO Issue #1956
2015-01-29 20:34:56 -08:00
Guillermo Rauch
0935b81da2 Merge pull request #1963 from michael-luo/bugfix/1956
bugfix/1956 test for don't reuse same-namespace connections
2015-01-29 20:34:38 -08:00
Luigi Pinca
51afe50720 CHANGELOG: fix attributions 2015-01-27 09:25:02 +01:00
Ruben Rodriguez II
cba037ffa2 Suggestion for implementation of clients API 2015-01-25 18:59:07 -06:00
Michael Luo
f7d9c285e9 build sio client with make to autogenerate new socket.io.js 2015-01-25 00:15:33 -08:00
Michael Luo
afa871bb8a bugfix/1956 test for don't reuse same-namspace connections 2015-01-24 20:19:16 -08:00
Michael Luo
7d237cc91f bugfix/1956 don't reuse same-namespace connections #2 2015-01-24 20:14:49 -08:00
Guillermo Rauch
1b01e16a6c fix broken previous commit 2015-01-24 08:02:05 -08:00
Guillermo Rauch
6aa425dd3f fix has-binary to work with all objects [gunta] 2015-01-24 07:06:56 -08:00
Guillermo Rauch
bd6f638c8f package: bump to work with all objects (fixes #1955) 2015-01-24 07:06:30 -08:00
Michael Luo
2079467f5b bugfix/1956 don't reuse same-namespace connections 2015-01-23 14:05:06 -08:00
Guillermo Rauch
83b36e54ac Merge pull request #1958 from nkzawa/compress
Support compression
2015-01-23 10:04:43 -08:00
Guillermo Rauch
2f0d9d05af fix origin verification default https port [evanlucas]
for PR #1693
2015-01-22 21:41:59 +00:00
Naoyuki Kanezawa
b15404e218 support compression 2015-01-22 06:51:49 +09:00
Naoyuki Kanezawa
429eb0cb7c point to the specific commit 2015-01-22 05:26:37 +09:00
Naoyuki Kanezawa
ac8e8598d7 support compression 2015-01-22 05:01:45 +09:00
Guillermo Rauch
ddc64a2d12 Merge pull request #299 from nkzawa/compression
Support compression
2015-01-21 19:37:47 +00:00
Naoyuki Kanezawa
99b709cadc Merge branch 'master' into compression
Conflicts:
	package.json
2015-01-22 03:52:22 +09:00
masakij
5abd97b231 FIX: location.port was ignored
change location.hostname to location.host
2015-01-20 16:25:57 +09:00
masakij
ecf6c4e139 ADD: location.port test
1 failing
1. Error: expected '443' to equal '3000'
2015-01-20 16:13:31 +09:00
Guillermo Rauch
9ba6d47ec7 Release 1.3.2 2015-01-19 15:14:18 +00:00
Guillermo Rauch
ea9b2b72ad Release 1.3.2 2015-01-19 15:14:18 +00:00
Guillermo Rauch
9de1a7a5eb Release 1.3.1 2015-01-19 11:37:15 +00:00
Guillermo Rauch
3d49cafd03 Release 1.3.1 2015-01-19 11:37:14 +00:00
Guillermo Rauch
d9682cc503 package: bump engine.io-client (noop) 2015-01-19 11:11:53 +00:00
Guillermo Rauch
77ca2dcbda package: bump engine.io (noop) 2015-01-19 11:11:12 +00:00
Guillermo Rauch
ba530a4762 Release 1.5.1 2015-01-19 10:44:21 +00:00
Guillermo Rauch
8e413d72de Release 1.3.0 2015-01-19 10:25:50 +00:00
Guillermo Rauch
7e4aa4fa64 Release 1.3.0 2015-01-19 10:25:49 +00:00
Guillermo Rauch
b46e480f65 Update Readme.md 2015-01-19 09:26:12 +00:00
Guillermo Rauch
d2065cf0f3 Update README.md 2015-01-19 09:25:43 +00:00
Guillermo Rauch
6a3fdf26f5 package: bump socket.io 2015-01-18 19:42:55 +00:00
Guillermo Rauch
5e92dd8663 package: bump socket.io-client 2015-01-18 19:42:43 +00:00
Guillermo Rauch
f981d3f050 package: bump engine.io 2015-01-18 19:41:45 +00:00
Guillermo Rauch
ce90a3cb1b package: bump engine.io-client 2015-01-18 19:41:29 +00:00
Guillermo Rauch
e536f7aa40 Release 1.5.0 2015-01-18 19:24:22 +00:00
Guillermo Rauch
5b31a081e4 Release 1.5.0 2015-01-18 19:23:02 +00:00
Guillermo Rauch
a332193235 package: bump socket.io 2015-01-18 18:53:39 +00:00
Guillermo Rauch
f57505fee7 Merge branch 'master' of github.com:Automattic/socket.io 2015-01-18 18:53:17 +00:00
Guillermo Rauch
b74138b52b package: bump socket.io 2015-01-18 18:52:32 +00:00
Guillermo Rauch
f8f1b132a1 package: bump socket.io-client 2015-01-18 18:52:06 +00:00
Guillermo Rauch
f7f83bc09f package: bump engine.io 2015-01-18 18:51:27 +00:00
Guillermo Rauch
6b97ece0c6 package: bump engine.io-client for tests 2015-01-18 18:46:57 +00:00
Guillermo Rauch
f603dbbeaa package: bump zuul 2015-01-18 18:33:18 +00:00
Guillermo Rauch
1496769411 package: boo-yah 2015-01-18 17:30:59 +00:00
Guillermo Rauch
f6f72316fe package: use ngrok zuul 2015-01-17 17:16:18 +00:00
Guillermo Rauch
b57a5acc48 package: bump engine.io-parser 2015-01-17 12:31:17 +00:00
Guillermo Rauch
62f4298a88 Release 1.2.1 2015-01-17 12:30:53 +00:00
Guillermo Rauch
636c530d9e Merge pull request #799 from rase-/add/socket-id-property
Added `socket.id` property
2015-01-17 12:29:31 +00:00
Tony Kovanen
5d96f92940 Make sure socket.id is defined 2015-01-17 22:20:00 +02:00
Tony Kovanen
2663d3510a Added socket.id docs 2015-01-17 22:19:58 +02:00
Guillermo Rauch
304a93d68f Merge pull request #21 from marcooliveira/master
Fix confusing comment in `add`
2015-01-17 12:28:41 +00:00
Guillermo Rauch
ddf8e61cd6 Merge pull request #20 from marcooliveira/patch-1
Call the callback on `delAll`
2015-01-17 12:27:47 +00:00
Guillermo Rauch
3f7dde9e61 Merge pull request #41 from rase-/fix/parse-error
Fix parse error
2015-01-17 12:25:24 +00:00
Guillermo Rauch
b8ded0d725 Merge pull request #1903 from rase-/add/volatile-tests
Added tests for volatile
2015-01-17 12:23:06 +00:00
Guillermo Rauch
086ccd2708 Merge pull request #1938 from fay-jai/license
update license with up-to-date year range
2015-01-17 12:22:11 +00:00
Guillermo Rauch
864857cb6f Merge pull request #1939 from rase-/add/test-for-emit-after-server-restart
Add test for reconnection after server restarts
2015-01-17 12:21:53 +00:00
Guillermo Rauch
e5a7e422f9 Merge pull request #1943 from eychu/patch-1
Add space in error message
2015-01-17 12:21:38 +00:00
Tony Kovanen
b21717b66d Pass has-binary result to encodePacket
Needs to be done so thet individual packets don't get encoded as binary.
2015-01-16 21:28:01 +02:00
Tony Kovanen
44c7aa5ab9 Fix parse error
We always need to send binary when encoding payloads when sending from
server to client, because the polling transport has to know the response
type ahead of time.
2015-01-16 21:19:27 +02:00
Alexey Chuvashov
f5b75151bd Add space in error message 2015-01-15 01:24:19 +03:00
Tony Kovanen
b0c4c2edd0 Added socket.id property
- Make sure `socket.id` is defined on connect
- Make sure `socket.id` is cleared on disconnect
- Make sure `socket.id` is updated on reconnect
2015-01-14 18:18:02 +02:00
Tony Kovanen
0523b655da Add test for reconnection after server restarts 2015-01-14 17:22:50 +02:00
Guillermo Rauch
f9276e9674 Merge pull request #797 from Automattic/fix-default-url
fix url parsing when uri string is undefined
2015-01-11 15:13:17 -08:00
Guillermo Rauch
ec6ef0cf17 Merge branch 'master' of github.com:Automattic/socket.io-client 2015-01-11 15:12:58 -08:00
Guillermo Rauch
cb97a20538 remove duplicate dep 2015-01-11 15:12:48 -08:00
Guillermo Rauch
e0feeca3bf package: bump client 2015-01-11 15:09:42 -08:00
Guillermo Rauch
1923fdc0c8 package: bump parser 2015-01-11 15:09:11 -08:00
Guillermo Rauch
b8ec539b30 Release 1.2.0 2015-01-11 15:08:45 -08:00
Roman Shtylman
3f139c8863 test: make url tests run on the browser 2015-01-11 15:05:12 -08:00
Guillermo Rauch
145df37d17 remove env 2015-01-11 14:54:01 -08:00
Roman Shtylman
1e899abd45 fix url parsing when uri string is undefined
The url parser was ignoring port hints from window.location when the uri
string was undefined. This commit changes the parser to use
window.location.host (not hostname) so that the port is preserved.
2015-01-11 13:10:36 -08:00
Willson Mock
d9415a38e4 update license with up-to-date year range 2015-01-11 00:11:55 -05:00
Roman Shtylman
ca82c09bf2 fix leaving unknown rooms
close #1670
2015-01-10 14:58:50 -08:00
Roman Shtylman
b9aaa1607c Merge pull request #1922 from smart--petea/patch-1
Update Readme.md
2015-01-10 14:48:59 -08:00
Roman Shtylman
d1304c5d82 Merge pull request #1926 from coderaiser/patch-1
package: debug v2.1.0
2015-01-10 14:33:21 -08:00
Guillermo Rauch
c8fd8177bc re-set env vars 2015-01-10 14:10:19 -08:00
Roman Shtylman
b477f2b7ef README: fix ping/pong packet documentation
close #18
2015-01-10 10:27:23 -08:00
Guillermo Rauch
bd479a9cd6 Merge pull request #1936 from drewblaisdell/master
Allow null or undefined origins when allowed origins is a function
2015-01-09 16:36:38 -08:00
Drew Blaisdell
a116d7765a Allow null or undefined origins when allowed origins is a function
Requests without an Origin header previously caused an exception to be thrown if the allowed origins passed to the constructor was set to a dynamic function. Omitted origins are now set to an asterisk and passed properly to the origins function.

A test for this case is included in this commit.
2015-01-09 16:30:08 -08:00
Guillermo Rauch
1c6620d564 everything is fixed 2015-01-09 16:25:42 -08:00
Guillermo Rauch
dba462e6da fix tests on 0.11 2015-01-09 16:24:24 -08:00
Guillermo Rauch
19c4422361 package: fix npm test to run on windows 2015-01-09 13:57:45 -08:00
Grant Timmerman
2338755762 Fix return type for decodePacket 2015-01-09 10:54:28 -08:00
Grant Timmerman
81642975f0 Clarify README API 2015-01-09 10:54:28 -08:00
Grant Timmerman
2fe91aa98e Cleaned up README explanations/code 2015-01-09 10:54:28 -08:00
Grant Timmerman
f2ab8d4ec5 Fixed spelling and formatting of README 2015-01-09 10:54:28 -08:00
Grant Timmerman
c54a46117e Added API document 2015-01-09 10:54:28 -08:00
Roman Shtylman
2cbcd1eb11 Merge pull request #17 from pkyeck/master
fixed the payload format
2015-01-09 10:33:06 -08:00
Naoyuki Kanezawa
d11e17c8d7 support compression 2015-01-06 02:11:39 +09:00
Guillermo Rauch
6699cd26cc Merge pull request #297 from lpinca/close/data-request
polling: correctly abort the ongoing data request when closing transport
2015-01-03 14:17:34 -08:00
Luigi Pinca
9526e0d27f polling: correctly abort the ongoing data request when closing transport 2015-01-03 21:13:43 +01:00
Pavel Kornilov
7abd6b0d62 refactor .once 2014-12-26 14:07:16 -08:00
coderaiser
8242dd01ef package: debug v2.1.0 2014-12-26 14:16:27 +02:00
Chylli
e8f660f77f fix the order of events 2014-12-26 16:30:52 +08:00
Badarau Petru
17960ed038 Update Readme.md
underylings to underlyings
2014-12-22 07:17:01 +02:00
Naoyuki Kanezawa
1e36bfee82 Merge pull request #296 from rase-/fix/build
Fix commit reference to client
2014-12-13 00:37:13 +09:00
Tony Kovanen
8fd8c71898 Fix commit reference to client 2014-12-12 17:25:08 +02:00
Guillermo Rauch
e53e9f5931 Merge pull request #36 from cvlchinet/patch
Allow sending binary data without ArrayBuffer (e. g. IE8)
2014-12-10 17:57:26 -03:00
Tony Kovanen
d9996f0470 Added tests for volatile 2014-12-08 11:19:49 +02:00
Guillermo Rauch
4cc7936688 Merge pull request #290 from rase-/add/cert-tests
Add ssl tests
2014-12-04 13:28:42 -03:00
Tony Kovanen
d0642f0a92 Merge pull request #38 from rase-/add/travis-matrix-support
Use travis matrix for better test runs
2014-12-03 22:19:24 +02:00
Tony Kovanen
aa865b921a Use travis matrix for better test runs 2014-12-03 21:37:15 +02:00
Guillermo Rauch
384980074f Merge pull request #37 from rase-/fix/binary-only-if-needed
Encode into binary only if needed
2014-12-03 00:39:56 -03:00
Tony Kovanen
68d89ab7a9 encode into binary only if needed 2014-12-03 02:07:10 +02:00
Tony Kovanen
cf9aa5dd34 Bump engine.io-client. 2014-11-24 05:00:11 -03:00
Tony Kovanen
0a100b0054 Additional SSL tests. 2014-11-24 04:56:44 -03:00
Tony Kovanen
86e1e6f01e Bump engine.io-client. 2014-11-24 04:56:44 -03:00
Tony Kovanen
b55a0e71b5 Add cert tests. 2014-11-24 04:56:08 -03:00
Guillermo Rauch
db45b05b12 Merge pull request #788 from mokesmokes/exponentialBackoff
fixes #784 and #786
2014-11-23 15:50:50 -03:00
Mark Mokryn
e8c5779af6 improve fix for GH-786 plus test it and also backoff 2014-11-23 16:50:21 +02:00
Mark Mokryn
42f51126ff fixes GH-784 and GH-786 2014-11-23 01:56:58 +02:00
Roman Shtylman
fb657ae6df Merge pull request #785 from joshk/patch-1
Use the new build env on Travis
2014-11-20 21:14:27 -08:00
Josh Kalderimis
c51216169a Use the new build env on Travis
faster vms, more cpu, more ram, better network, better vm start time

docs coming soon
2014-11-20 23:26:41 -05:00
Guillermo Rauch
24d06d76dd Release 1.2.1 2014-11-21 04:59:14 +01:00
Guillermo Rauch
98e3c135b4 Release 1.2.1 2014-11-21 04:59:13 +01:00
Guillermo Rauch
4e4bbf918e fix protocol violations and improve error handling (fixes #1880) 2014-11-21 04:16:37 +01:00
Guillermo Rauch
b49f5c82f2 syntax 2014-11-21 04:15:42 +01:00
Guillermo Rauch
01a699e76a Merge branch 'master' of github.com:Automattic/socket.io-client 2014-11-21 02:58:15 +01:00
Guillermo Rauch
5bd67195de Merge branch 'master' of github.com:Automattic/socket.io 2014-11-21 02:57:35 +01:00
Guillermo Rauch
f51dee5a01 package: bump engine.io-client 2014-11-21 02:56:50 +01:00
Guillermo Rauch
73fe547956 package: bump engine.io for websocket leak fix 2014-11-21 02:56:28 +01:00
Guillermo Rauch
d95ba537f8 Release 1.4.3 2014-11-21 01:31:03 +01:00
Guillermo Rauch
5255647e99 package: bump ws to fix fd leaks 2014-11-21 00:49:24 +01:00
Chi Vinh Le
2c1beccbb1 Add line space. 2014-11-20 23:49:46 +01:00
Chi Vinh Le
1e337d3f65 Add test cases for base64 object encoding. 2014-11-20 23:38:49 +01:00
Chi Vinh Le
7112b97908 Add encodeBase64Object to encoder for browser 2014-11-20 13:49:46 +01:00
Guillermo Rauch
6debb04359 Merge pull request #758 from superlukas/bump-uglify
package: bump `uglify-js`
2014-11-15 15:13:15 +09:00
Guillermo Rauch
bc06e919d8 Merge pull request #759 from superlukas/npmignore
Update .npmignore to only include the necessary
2014-11-15 15:12:58 +09:00
Guillermo Rauch
8006f28952 Merge pull request #764 from thexeos/master
Prevent undefined callback error
2014-11-15 15:12:42 +09:00
Guillermo Rauch
965e600324 Merge pull request #736 from pedrorw/master
License added
2014-11-15 15:12:17 +09:00
Guillermo Rauch
7d9476706c Merge pull request #769 from nkzawa/patch-13
Don't listen events on connect
2014-11-15 15:11:04 +09:00
Guillermo Rauch
80aa1aaa49 Merge pull request #291 from lpinca/close/pending-request
polling: close the pending poll request when closing transport
2014-11-15 15:06:55 +09:00
Guillermo Rauch
b310fcba59 Merge pull request #294 from lpinca/fix/gh-293
socket: flush the write buffer before closing the socket (fixes #293)
2014-11-15 15:06:36 +09:00
Guillermo Rauch
973e6cc982 Merge pull request #1813 from ogwiz2/patch-1
Made comments more consistent
2014-11-12 10:04:09 +01:00
Jonathan Ong
5890152d82 Merge pull request #55 from michaelsanford/master
Add MIT license to package.json
2014-11-03 08:55:49 -08:00
Michael Sanford
9d163a5144 Add MIT license to package.json
Allows license to be read programatically.
2014-11-03 11:53:08 -05:00
Marco Oliveira
73a1ae89de Fix confusing comment in add 2014-11-01 15:05:52 +00:00
Marco Oliveira
29d2e46900 Call the callback on delAll 2014-11-01 14:52:27 +00:00
Guillermo Rauch
e66ea47c80 Merge pull request #19 from rase-/remove/keys-dependency
Remove unnecessary dependency
2014-10-27 19:15:16 -07:00
Tony Kovanen
e0220b7ce5 remove unnecessary dependency 2014-10-28 02:08:56 +02:00
Guillermo Rauch
295be0bda9 Release 1.2.0 2014-10-27 15:54:58 -07:00
Guillermo Rauch
4a0091b25a Release 1.2.0 2014-10-27 15:54:57 -07:00
Tony Kovanen
bb659965ee package: bump socket.io for tests 2014-10-27 22:41:24 +02:00
Guillermo Rauch
a1bf85b57f package: bump socket.io-parser 2014-10-27 11:52:09 -07:00
Guillermo Rauch
62ad812ee5 package: use latest socket.io-client 2014-10-27 11:51:03 -07:00
Guillermo Rauch
e8e6dad5d4 package: test latest socket.io 2014-10-27 11:50:33 -07:00
Guillermo Rauch
9ae8ed6929 package: bump adapter 2014-10-27 11:46:44 -07:00
Guillermo Rauch
c22e10f635 Release 0.3.1 2014-10-27 11:46:21 -07:00
Guillermo Rauch
4a11c16cc2 package: bump socket.io-client 2014-10-27 11:09:44 -07:00
Guillermo Rauch
b88a758857 package: bump engine.io 2014-10-27 07:47:51 -07:00
Guillermo Rauch
7bb2b80b4b package: bump engine.io-client 2014-10-27 07:47:35 -07:00
Guillermo Rauch
7de96249b0 Release 1.4.2 2014-10-27 07:47:15 -07:00
Luigi Pinca
e754f7eb23 socket: flush the write buffer before closing the socket (fixes #293) 2014-10-25 22:04:16 +02:00
Luigi Pinca
1d8e074398 polling: close the pending poll request when closing transport 2014-10-24 17:23:32 +02:00
Naoyuki Kanezawa
0770af87c3 README: clarify connect evnet 2014-10-21 00:52:28 +09:00
Guillermo Rauch
0b34836741 Merge pull request #768 from rase-/fix/tests
Fix failing tests
2014-10-19 12:13:45 -07:00
Tony Kovanen
361acede8e Increase timeout.
Increased timeout in tests before closing the manager engine so
reconnects will take place with more certainty.
2014-10-19 22:10:49 +03:00
Tony Kovanen
5be8d414bf Bump engine.io-client. 2014-10-19 22:10:49 +03:00
Tony Kovanen
512eb3a8a4 Set readyState before engine.io close event.
This way we don't need to possibly wait for a drain event before we
actually change the readyState and don't miss reconnects, which
currently happens when linked against the current engine.io-client
master.
2014-10-19 22:10:39 +03:00
Tony Kovanen
b5d808e0d6 Merge pull request #767 from nkzawa/patch-12
fix reconnection after reconnecting manually
2014-10-19 13:52:43 +03:00
Tony Kovanen
d34d7e7c1f Merge pull request #766 from nkzawa/patch-11
enable to stop reconnecting
2014-10-19 13:51:32 +03:00
Naoyuki Kanezawa
bf1fb628df fix reconnection after reconnecting manually 2014-10-19 12:14:18 +09:00
Naoyuki Kanezawa
a8b3fbea55 enable to stop reconnecting 2014-10-19 12:11:30 +09:00
Tony Kovanen
591cfb3cfe Merge pull request #16 from rase-/fix/bump-parser
Bump parser version.
2014-10-18 21:25:01 +03:00
Tony Kovanen
7789a22eee Bump parser version. 2014-10-18 21:22:35 +03:00
Guillermo Rauch
3352d1d726 Merge branch 'master' of github.com:Automattic/socket.io 2014-10-13 08:52:46 -07:00
Guillermo Rauch
e68557fab6 downloads badge 2014-10-13 08:52:36 -07:00
Guillermo Rauch
2db4bac5c5 Merge branch 'master' of github.com:Automattic/socket.io-client 2014-10-13 08:51:34 -07:00
Guillermo Rauch
1cbc6e2a60 downloads badge 2014-10-13 08:51:16 -07:00
thexeos
c1246c6fe8 Prevent undefined callback error
If the same callback() is called multiple times from the server, then the client ends up with "TypeError: fn is undefined", due to the fact that the acks object is updated (client callback is removed) after the first call.
2014-10-08 20:50:21 +01:00
Tony Kovanen
b72c7f1530 Merge pull request #34 from divdavem/phantomJS
Avoid sending Blobs on PhantomJS (as on Android)
2014-10-06 12:40:17 +03:00
ddivernois
d2e1e94ef5 Avoid sending Blobs on PhantomJS (as on Android)
Uploading a Blob with PhantomJS does not work correctly, as reported here:
https://github.com/ariya/phantomjs/issues/11395
2014-10-06 11:13:11 +02:00
Alex Jeng
136fe960b7 Made comments more consistent 2014-10-05 22:10:13 -07:00
Guillermo Rauch
0cc7cdfe6c Merge pull request #289 from rase-/fix/jsonp-test
Add iframe onload handling to jsonp tests.
2014-10-04 16:13:00 -07:00
Tony Kovanen
c89b085556 Add iframe onload handling to jsonp tests.
`onload` handling required for the `drain` event to fire. We need this
for some tests that look at socket closing.
2014-10-05 02:11:23 +03:00
Guillermo Rauch
3eb5b8929d Release 1.4.1 2014-10-03 10:17:39 -07:00
Guillermo Rauch
aac04dfc98 Merge pull request #285 from lpinca/fix/gh-284
socket: allow upgrades if the socket is still in closing state (courtesy of @3rd-Eden)
2014-10-03 08:22:27 -07:00
Tony Kovanen
eafcf0b323 Merge pull request #762 from haqii/master
Update repository url
2014-10-03 17:11:54 +03:00
haqii
76850bef1b Update repository url 2014-10-03 22:08:12 +08:00
Luigi Pinca
00caf543b8 socket: allow upgrades if the socket is still in closing state
Fixes #284, courtesy of @3rd-Eden
2014-09-26 16:01:11 +02:00
Tony Kovanen
da358084f0 Merge pull request #1773 from AjayMT/master
Fix usage example for Server#close.
2014-09-26 01:13:18 +03:00
Tony Kovanen
f9efb1eae6 Merge pull request #254 from pawelatomic/master
added missing support for XSS filters on IE
2014-09-25 23:51:48 +03:00
Tony Kovanen
522215951b Merge pull request #280 from reem/patch-1
README: Fix typo http_server.
2014-09-25 23:39:41 +03:00
Guillermo Rauch
d4b4051290 Merge pull request #7 from keskival/master
Updated the dependency version to be compatible with a current stack.
2014-09-25 10:20:50 -07:00
Tero Keski-Valkama
f2cdb95985 Merged. 2014-09-25 19:50:29 +03:00
Tony Kovanen
1b4f6a5324 Merge pull request #1777 from akamensky/dynamic-cors
Dynamic cors
2014-09-22 13:38:14 -06:00
Tony Kovanen
99346eddc5 Merge pull request #1788 from jamesanthonyferguson/patch-1
Change grammar issues in the chat/README.md
2014-09-22 12:42:59 -06:00
Tony Kovanen
051ffa0440 Merge pull request #1626 from thanpolas/patch-1
http.Server is a constructor
2014-09-22 12:42:10 -06:00
Tony Kovanen
fa4fa3365a Merge pull request #1690 from rase-/fix/resource-option-bc
Fix resource option BC with the set function
2014-09-22 12:27:35 -06:00
Tony Kovanen
bafa184c6b Merge pull request #1792 from rase-/add/autopruning-test
Add room autopruning test
2014-09-22 12:25:23 -06:00
Tony Kovanen
baf60c1502 Merge pull request #732 from nkzawa/patch-10
Enable to reconnect manually
2014-09-21 14:18:50 -06:00
Tony Kovanen
e3149d5833 Bump adapter version. 2014-09-20 11:12:58 -06:00
Tony Kovanen
ae9d5277a9 Add test to check that empty rooms are autopruned. 2014-09-20 11:12:26 -06:00
Guillermo Rauch
006f19a225 Merge pull request #12 from rase-/fix/room-autopruning
Fix room autopruning
2014-09-19 23:25:17 -06:00
Tony Kovanen
3e6489bf71 Make the room exists when autopruning. 2014-09-19 18:07:08 -06:00
Tony Kovanen
2e061ee733 Fix room autopruning 2014-09-19 18:02:44 -06:00
James Ferguson
2e440722a6 Change grammar issues in the chat/README.md
Added a few periods and commas which were missing. Also added the word each to clarify how multiple users each enter a unique username.
Very minor edit. No source code changed.
2014-09-18 21:41:28 -07:00
Tony Kovanen
3fe6d4e8ec Merge pull request #1784 from matthewcanty/patch-1
Change "there're" to "there are"
2014-09-17 07:41:46 -06:00
Matthew Canty
3b93c1c562 Change "there're" to "there are"
Not a commonly used contraction and looks a bit odd.
2014-09-17 14:01:01 +01:00
akamensky
e89f82a9b0 Added Server#origins(v:Function) description for dynamic CORS 2014-09-12 11:32:20 +08:00
akamensky
1b90ae2587 Added test coverage for Server#origins(function) for dynamic CORS 2014-09-12 11:13:51 +08:00
akamensky
9658e32e7a Added optional Server#origins(function) for dynamic CORS 2014-09-12 10:53:14 +08:00
Tony Kovanen
99d76664aa Merge pull request #1766 from BrianGeppert/master
package: fix main file for example application 'chat'.
2014-09-11 18:05:58 +03:00
Guillermo Rauch
7912f14c94 Merge pull request #754 from toshipon/patch-1
Support no schema relative url
2014-09-11 17:56:17 +03:00
Tony Kovanen
7793a33e04 Merge pull request #10 from rase-/patch-1
Add autoprunning of empty rooms - rebased
2014-09-11 16:52:38 +03:00
Tony Kovanen
b49b781f12 Style 2014-09-11 16:47:07 +03:00
hallucynogenyc
a9142147f7 Add autoprunning of empty rooms 2014-09-11 16:44:43 +03:00
Jonathan Reem
aa132cba67 README: Fix typo http_server. 2014-09-11 01:23:21 -07:00
Ajay MT
23eefa527a Fix usage example for Server#close. 2014-09-10 18:11:56 +05:30
Lukas Böcker
56e517e069 Update .npmignore 2014-09-08 01:29:54 +02:00
Lukas Böcker
2ff2f0f765 package: bump uglify-js 2014-09-08 01:26:32 +02:00
Brian Geppert
b49b35b26f package: fix main file for example application 'chat'. 2014-09-04 12:10:43 -05:00
Guillermo Rauch
fca25797a3 register other nsps 2014-09-04 12:28:29 +02:00
Guillermo Rauch
ae7c5ac007 fix tests 2014-09-04 12:20:45 +02:00
Guillermo Rauch
09c8781c8f Release 1.1.0 2014-09-04 12:06:07 +02:00
Guillermo Rauch
16483375a7 Release 1.1.0 2014-09-04 12:06:06 +02:00
Guillermo Rauch
1a9b168451 socket: fix in has-binary 2014-09-04 11:44:24 +02:00
Guillermo Rauch
ec305bd8df examples: minor fix of escaping 2014-09-04 11:44:02 +02:00
Guillermo Rauch
607cb0b35a package: bump socket.io-parser 2014-09-04 10:17:32 +02:00
Guillermo Rauch
83c68c7a71 Release 2.2.2 2014-09-04 10:14:58 +02:00
Guillermo Rauch
0ae9a4fba6 prevent direct Buffer reference that breaks browserify 2014-09-04 10:14:23 +02:00
Guillermo Rauch
af07a1c649 package: bump engine.io 2014-09-04 01:57:58 +02:00
Guillermo Rauch
90f5bf0669 package: bump engine.io-client 2014-09-04 01:57:31 +02:00
Guillermo Rauch
f31a24e8db Release 1.4.0 2014-09-04 00:05:17 +02:00
toshipon
6a9144c226 Support no schema relative url 2014-08-30 18:43:32 +09:00
Jonathan Ong
ac9b89663a use .files instead of .npmignore 2014-08-28 20:43:32 -07:00
Tony Kovanen
4e2edde13b Further increase test timeout. 2014-08-26 00:59:47 +03:00
Tony Kovanen
c732927f8e Double to singly quotes in tests. 2014-08-25 23:40:06 +03:00
Tony Kovanen
e5198c8a37 Merge pull request #750 from rase-/fix/android-tests
Extend timeout and remember to close everything in each test case.
2014-08-25 23:23:58 +03:00
Tony Kovanen
f501053c64 Extend timeout and remember to close everything in each test case. 2014-08-25 23:22:04 +03:00
Guillermo Rauch
b9e69cbf79 fix travis 2014-08-25 12:45:05 -03:00
Guillermo Rauch
be7e37a2fa add travis + zuul matrix 2014-08-25 12:23:10 -03:00
Tony Kovanen
5863903d44 Merge pull request #1729 from anupbishnoi/patch-1
Take "" and "/" as equivalent namespaces on server
2014-08-20 11:27:46 +03:00
Anup Bishnoi
f56d4acce6 testing for equivalence of namespaces starting with / or without 2014-08-19 22:19:50 +00:00
Anup Bishnoi
8ea37b7351 Update index.js 2014-08-19 16:17:45 -04:00
Anup Bishnoi
b3cb18d910 Added relevant tests
"" and "/" namespaces are checked for equivalence on server and client
2014-08-18 22:47:06 -04:00
Anup Bishnoi
0e41561d56 Take "" and "/" as equivalent namespaces on server
On server, `.of(name)` should use the same key in `.nsps` object for "" and "/"

Important to use `String(name)` and `===` to keep out keys that don't cast to ""
2014-08-18 22:38:47 -04:00
Guillermo Rauch
1b83549bde Merge pull request #741 from PeterDaveHello/patch-2
Use svg instead of png to get better image quality
2014-08-12 15:47:16 -07:00
Guillermo Rauch
83709e9487 Merge pull request #1714 from PeterDaveHello/patch-2
Use svg instead of png to get better image quality
2014-08-12 15:47:12 -07:00
Guillermo Rauch
d7c0eda35a Merge pull request #19 from PeterDaveHello/patch-2
Use svg instead of png to get better image quality
2014-08-12 15:46:38 -07:00
Guillermo Rauch
a8b3f52048 Merge pull request #740 from PeterDaveHello/patch-1
make CI build faster
2014-08-12 15:46:28 -07:00
Guillermo Rauch
4069d16fc8 Merge pull request #18 from PeterDaveHello/patch-1
make CI build faster
2014-08-12 15:46:17 -07:00
Guillermo Rauch
6f4051aaa7 Merge pull request #1713 from PeterDaveHello/patch-1
make CI build faster
2014-08-12 15:45:58 -07:00
Peter Dave Hello
87bf6910b5 Use svg instead of png to get better image quality 2014-08-12 10:56:04 +08:00
Peter Dave Hello
545cfc958a Use svg instead of png to get better image quality 2014-08-12 10:55:25 +08:00
Peter Dave Hello
97ebfcb836 Use svg instead of png to get better image quality 2014-08-12 10:54:49 +08:00
Peter Dave Hello
e02ead25b8 make CI build faster 2014-08-12 10:52:14 +08:00
Peter Dave Hello
be4a5868ed make CI build faster 2014-08-12 10:51:52 +08:00
Peter Dave Hello
8946b4ed4c make CI build faster 2014-08-12 10:51:01 +08:00
Guillermo Rauch
3cef88bc88 binary: reuse isBuf helper 2014-08-10 10:43:45 -07:00
Guillermo Rauch
0c755f93e4 clean up syntax 2014-08-10 10:43:00 -07:00
Guillermo Rauch
fc5930c5d1 Merge pull request #8 from tencircles/master
Do not set key/value pairs on arrays
2014-08-06 10:05:52 -07:00
chris_coniglio
ce93e2adaa A new room should be created as an object instead of an array since the id/true is set as a key value pair. Not an array element. 2014-08-06 09:40:18 -07:00
Roman Shtylman
661e78b1a1 readme: fix formatting for goals numbering 2014-08-05 12:03:30 -07:00
Guillermo Rauch
a40068b5f3 Merge pull request #1688 from fdellabetta/server_side_namespace
client cannot connect to non-existing namespaces
2014-08-01 13:45:32 +01:00
Guillermo Rauch
9e29ec9b2b Merge pull request #1700 from rase-/fix/rooms
Fix splice arguments and `socket.rooms` value update in `socket.leaveAll`
2014-08-01 13:45:01 +01:00
Tony Kovanen
624e7cb14f Fix splice arguments and socket.rooms value update in socket.leaveAll.
Hat tip @Marreck
2014-08-01 13:20:18 +02:00
Guillermo Rauch
681b4fc27b server: ref fix by @nicokaiser 2014-07-30 01:42:01 -07:00
Guillermo Rauch
01e173c8d5 server: fix ws memory leak (fixes #268) 2014-07-29 17:35:32 -07:00
pedro
16604c6983 Merge branch 'master' of https://github.com/pedrorw/socket.io-client 2014-07-25 08:02:41 -06:00
pedro
f4168674e2 license added
license added

Update README.md

link to license added

Update README.md
2014-07-25 08:02:12 -06:00
pedrorw
24ccdd7325 Update README.md 2014-07-24 08:01:27 -06:00
pedrorw
7aa5526940 Update README.md
link to license added
2014-07-24 08:00:17 -06:00
pedro
af9419eb0c license added 2014-07-24 07:55:13 -06:00
Guillermo Rauch
6eee84bcfa Merge pull request #734 from adelura/master
Removed unnecessary code from try block. Only decode packet is needed.
2014-07-23 18:09:45 -07:00
Artur Delura
b537b8edf9 Removed unnecessary code from try block. Only decode packet is needed. 2014-07-23 20:28:48 +02:00
Tony Kovanen
b4954d767a Take the instance stored path value into account when attaching to eio if no option specified to attach directly 2014-07-23 19:58:44 +03:00
Filippo Della Betta
f6eb53f5e1 client cannot connect to non-existing namespaces 2014-07-22 13:58:13 +02:00
Naoyuki Kanezawa
a0f63d7408 enable to reconnect manually 2014-07-21 02:20:22 +09:00
Stephen Mathieson
27f3d7cd66 bower.json: update version to 1.1.3
Closes #50
2014-07-19 00:43:04 -04:00
Guillermo Rauch
9c80317574 Merge pull request #1685 from rase-/fix/remote-address-in-handshake-obj
Fix remote address in handshake obj
2014-07-18 19:47:26 -07:00
Guillermo Rauch
f00ef8b284 Merge pull request #270 from rase-/cache-ip-in-handshake
Cache remote address in handshake since it might be lost later.
2014-07-18 18:55:35 -07:00
Tony Kovanen
d163d891ef Bump engine.io version to get the cached IP address 2014-07-19 04:49:51 +03:00
Tony Kovanen
15afd3e2c3 Cache remote address in handshake since it might be lost later. 2014-07-19 04:47:38 +03:00
Tony Kovanen
54726105cb Fixed handshake object address property and made the test case more strict. 2014-07-19 04:43:03 +03:00
Guillermo Rauch
3832d67e01 package: bump browserify 2014-07-18 11:54:09 -07:00
Guillermo Rauch
7999c46520 Merge branch 'master' of github.com:Automattic/socket.io-client 2014-07-17 12:20:17 -07:00
Guillermo Rauch
3d9e52cf93 Merge branch 'master' of github.com:Automattic/socket.io 2014-07-17 12:20:17 -07:00
Guillermo Rauch
ad74f2ff88 package: bump engine.io 2014-07-17 12:17:46 -07:00
Guillermo Rauch
4d5e591268 package: bump engine.io-client 2014-07-17 12:17:19 -07:00
Guillermo Rauch
588af6437c correct git ref 2014-07-17 11:18:01 -07:00
Guillermo Rauch
c3478fe494 Merge pull request #267 from rase-/bump/parser
Bump parser 1.1.0
2014-07-16 15:45:26 -07:00
Tony Kovanen
08afdc4692 Update client to commit with bumped parser 2014-07-17 01:34:10 +03:00
Tony Kovanen
d9b188a58a Bump parser 1.1.0 2014-07-17 01:29:20 +03:00
Tony Kovanen
b10666cf94 Test that utf8 encoding is not on by default but can be switched on manually. 2014-07-17 01:21:41 +03:00
Guillermo Rauch
859338a4ae Release 1.1.0 2014-07-16 15:17:49 -07:00
Guillermo Rauch
e390624a39 Merge pull request #31 from rase-/fix/double-encode
Don't UTF-8 encode packets unless asked.
2014-07-16 15:16:59 -07:00
Tony Kovanen
95840ca6b6 Don't UTF-8 encode packets unless asked.
Still done in payload encoding for polling, but no need with WebSockets since it deals with UTF-8 itself.
2014-07-17 00:54:00 +03:00
Guillermo Rauch
6ad719e521 Merge pull request #728 from nkzawa/patch-8
Fix autoConnect option
2014-07-16 14:37:06 -07:00
Guillermo Rauch
7a2fe46b57 package: bump parser 2014-07-16 11:44:07 -07:00
Guillermo Rauch
952b466993 Release 1.0.8 2014-07-16 11:14:19 -07:00
Guillermo Rauch
cf1c1273b3 Merge pull request #1682 from kevin-roark/fix/disconnect-connectbuffer-crash
Fixed the failing test where server crashes on disconnect involving connectBuffer
2014-07-16 10:58:54 -07:00
Kevin Roark
1f43c4abb5 Fixed the failing test where server crashes on disconnect involving connectBuffer
Source of bug: after connection to nsp '/', the socket's connectBuffer
was being deleted. On attempt to reconnect to a different namespace,
the connect buffer was deleted and we attempted to push to it. Instead
of the deleting the connect buffer, it is now emptied.
2014-07-16 08:35:16 -07:00
Guillermo Rauch
d6e6e8a2f8 Merge pull request #1673 from bryanburgers/patch-1
Fix repo in package.json
2014-07-15 18:25:59 -07:00
Naoyuki Kanezawa
8cc2f57451 fix autoConnect option 2014-07-16 03:59:43 +09:00
Guillermo Rauch
c506603874 npmignore: ignore .gitignore 2014-07-15 10:56:25 -07:00
Guillermo Rauch
3760f19436 npmignore: ignore .gitignore 2014-07-15 10:56:05 -07:00
Guillermo Rauch
fbd36b613d npmignore: ignore .gitignore (fixes #1607) 2014-07-15 10:55:34 -07:00
Guillermo Rauch
480b1a05bd test: added failing case for socket.disconnect and nsps 2014-07-15 10:52:23 -07:00
Nathan Rajlich
674e375eb6 History: whitespace 2014-07-14 14:21:24 -07:00
Guillermo Rauch
1e26a69e4f adjust protocol revision. fixes #30 2014-07-12 21:01:22 -07:00
Guillermo Rauch
56720ac9ca package: bump debug 2014-07-11 16:21:43 -07:00
Bryan Burgers
ef729b72b4 Fix repo in package.json 2014-07-09 07:28:45 -05:00
Tero Keski-Valkama
435a759d9b Added the repository field.
...to fix the npm warnings like:
npm WARN package.json socket.io-adapter@0.3.0 No repository field.
2014-07-01 11:32:51 +03:00
Tero Keski-Valkama
16d7767088 Updated the debug dependency.
... to be compatible with express and connect.
2014-07-01 11:12:05 +03:00
Thanasis Polychronakis
63e197083b update README http ctor to createServer() 2014-07-01 10:41:53 +03:00
Guillermo Rauch
70087e8abf Merge pull request #713 from Automattic/update/browserify-v4
Update "browserify" to v4.1.11
2014-07-01 00:15:27 -07:00
Guillermo Rauch
968e94e42b Merge pull request #1655 from ysmood/fix_etag_header
We should use the standard http protocol to handler the etag header
2014-06-30 23:32:23 -07:00
Guillermo Rauch
c18ed5fd4d Merge pull request #1646 from narcisoguillen/close_sio
Close sio
2014-06-30 19:10:26 -07:00
Narciso Guillen
1f7da938bd Improve Close documentation 2014-06-30 15:57:21 -05:00
Narciso Guillen
4b89bce182 use ephemeral ports 2014-06-30 15:49:08 -05:00
Guillermo Rauch
ff9cafb5fb Merge pull request #29 from nkzawa/patch-2
Handle invalid utf8 errors gracefully
2014-06-29 11:07:22 -07:00
Yad Smood
8c19eef07a fix: We should use the standard http protocol to handler the etag
header.
2014-06-29 21:42:57 +08:00
Naoyuki Kanezawa
4dc1a13750 handle invalid utf8 errors gracefully 2014-06-29 18:22:53 +09:00
Guillermo Rauch
662b30669b Merge pull request #1653 from acusti/patch-1
Override default browser font-family for inputs
2014-06-28 10:55:22 -07:00
Andrew Patton
001373ee17 Override default browser font-family for inputs
For consistent typography, explicitly declare font-family stack for `input` in addition to `html` (in Chrome and Safari on mac, the input will otherwise use default font for such elements, like Lucida Grande)
2014-06-28 13:14:33 -04:00
Nathan Rajlich
66ef715ee8 build 2014-06-26 10:20:06 -07:00
Nathan Rajlich
36754ef8e5 package: update "browserify" to v4.1.11 2014-06-26 10:19:44 -07:00
Tony Kovanen
b9e3d19987 Merge pull request #28 from rase-/fix/memory-leak-on-browser
Fix memory leak on browser as well
2014-06-25 23:28:04 +03:00
Tony Kovanen
4ff516b94a Adjust test to use proper data types and to only run for supporting browsers when testing the memory leak fix 2014-06-25 10:17:56 +03:00
Tony Kovanen
0cec2433b2 Fix memory leak on browser
Will exit with an error packet if the packet length string doesn't contain the value 255 in binary packets.
2014-06-25 06:32:05 +03:00
Guillermo Rauch
0b6a00cbec Merge pull request #6 from poldridge/patch-1
Patch 1
2014-06-24 16:08:21 -07:00
poldridge
1dd2bad757 Update index.js
Added missing hasOwnProperty check to for .. in loop.
2014-06-24 15:38:51 -07:00
poldridge
19d41920d9 Update index.js
Added missing hasOwnProperty checks to two for .. in loops.
2014-06-24 15:36:34 -07:00
Guillermo Rauch
816fd2e5a3 package: bump engine.io-parser for memleak fix 2014-06-24 15:23:03 -07:00
Guillermo Rauch
7e6da5461b Release 1.0.7 2014-06-24 15:21:18 -07:00
Guillermo Rauch
ca02f2bfad add comment per @christophwitzko 2014-06-24 15:20:18 -07:00
Guillermo Rauch
4f8dc74ff5 remove .DS_Store 2014-06-24 15:19:36 -07:00
Guillermo Rauch
93a415b38c Merge pull request #27 from christophwitzko/patch-memory-leak
fix decodePayloadAsBinary memory leak
2014-06-24 15:18:09 -07:00
Christoph Witzko
d41f8e06da fix decodePayloadAsBinary memory leak 2014-06-24 23:49:57 +02:00
Guillermo Rauch
a3d653855c Merge pull request #711 from kevin-roark/update/has-binary-data
update has-binary-data -> 1.0.3
2014-06-24 11:08:06 -07:00
Kevin Roark
837aae2048 update has-binary-data -> 1.0.3 2014-06-23 20:27:41 -07:00
Guillermo Rauch
246f3bb5c3 Merge pull request #1648 from kevin-roark/update/has-binary-data
update has-binary-data to 1.0.3
2014-06-23 20:20:39 -07:00
Kevin Roark
68d06ec94c update has-binary-data to 1.0.3 2014-06-23 20:19:26 -07:00
Narciso Guillen
a1feca1bd3 Add close specs 2014-06-23 21:03:31 -05:00
Narciso Guillen
968105a239 Add ability to stop the http server even if not created inside socket.io 2014-06-23 21:03:12 -05:00
Narciso Guillen
2e8e26613a Update README 2014-06-23 20:02:39 -05:00
Narciso Guillen
fbdb94d146 make sure server gets close 2014-06-23 19:55:02 -05:00
Guillermo Rauch
66503b5ad5 fix readme (fixes #26) 2014-06-22 10:47:13 -07:00
Guillermo Rauch
f8afcce007 Merge pull request #680 from FredyC/add-auto-connect
Add autoConnect option
2014-06-21 18:12:41 -07:00
Tony Kovanen
55572122f3 Merge pull request #1642 from rase-/add/test
Duplicate events test for `reconnect_failed`
2014-06-21 17:28:37 +03:00
Tony Kovanen
3340d6ed35 Merge pull request #708 from rase-/fix/reconnect_failed-double-fire
Fix duplicate `reconnect_failed` event
2014-06-21 17:28:30 +03:00
Tony Kovanen
a1170a3aa6 Bump client 2014-06-21 17:26:55 +03:00
Tony Kovanen
05c96325fe Don't fire an extra reconnect when we're not reconnecting after a failed initial connect attempt 2014-06-21 17:22:34 +03:00
Tony Kovanen
0954301d7e Add test case for checking that reconnect_failed is fired only once upon failure 2014-06-21 17:14:15 +03:00
Guillermo Rauch
328a9df8eb package: bump socket.io-parser for component-emitter dep fix
cc @davglass @reid
2014-06-20 16:57:54 -07:00
Guillermo Rauch
4f71fb04bd package: bump socket.io-parser for component-emitter dep fix
cc @davglass @reid
2014-06-20 16:57:15 -07:00
Guillermo Rauch
5c551f0f52 Release 2.2.1 2014-06-20 16:56:24 -07:00
Julian Gruber
1bd7d81f84 Release 1.1.3 2014-06-20 08:25:56 +02:00
Guillermo Rauch
d99e30fca7 Release 1.0.6 2014-06-19 14:57:50 -07:00
Guillermo Rauch
191b342e55 Release 1.0.6 2014-06-19 14:57:45 -07:00
Guillermo Rauch
561dd6fd79 package: bump engine.io for utf8 fix (fixes #1622) 2014-06-19 14:51:37 -07:00
Guillermo Rauch
7f363153cc package: bump engine.io-client 2014-06-19 14:51:20 -07:00
Guillermo Rauch
f3ada3c723 Release 1.3.1 2014-06-19 14:50:37 -07:00
Guillermo Rauch
2f63cf1452 package: bump engine.io-client 2014-06-19 14:48:09 -07:00
Guillermo Rauch
bb2455389f use latest engine.io-client 2014-06-19 14:08:04 -07:00
Guillermo Rauch
e9e2a91cea package: bump socket.io-client 2014-06-19 08:05:38 -07:00
Tony Kovanen
b09370f895 Merge pull request #704 from rase-/fix/tests-on-ie
Fix IE tests
2014-06-19 03:21:34 +03:00
Tony Kovanen
f952b09e36 Fix possible security error on IE by closing all sockets 2014-06-19 03:20:18 +03:00
Tony Kovanen
c3d3b0b588 Fix error propagation test for old IE 2014-06-19 03:07:58 +03:00
Tony Kovanen
1bd6d6c309 Merge pull request #703 from rase-/event-propagation
Added tests and enhanced event propagation
2014-06-19 03:00:14 +03:00
Tony Kovanen
041c95e40a Added tests and enhanced event propagation 2014-06-19 02:58:22 +03:00
Guillermo Rauch
8a3a111a7f Merge pull request #1635 from rase-/add/test
Test for duplicate events on manual reconnect
2014-06-18 15:54:23 -07:00
Tony Kovanen
bd87e4dc35 Bump socket.io-client to latest commit so that duplicate events test passes 2014-06-19 01:52:34 +03:00
Tony Kovanen
71c253e992 Added test for duplicate events after manual reconnects 2014-06-19 01:49:00 +03:00
Guillermo Rauch
3f4ae6316d Merge pull request #702 from rase-/fix/duplicate-events-on-manual-reconnect
Don't readd subs when reconnecting
2014-06-18 13:21:58 -07:00
Tony Kovanen
ecc7ba8bda Only add subs once to begin with, so no need for an if for every .connect() call 2014-06-18 23:16:45 +03:00
Tony Kovanen
e5416ff741 Don't readd subs when reconnecting 2014-06-18 22:48:22 +03:00
Guillermo Rauch
a5cf4f57a0 Release 1.0.5 2014-06-17 18:14:44 -07:00
Guillermo Rauch
799843b032 Release 1.0.5 2014-06-17 18:14:40 -07:00
Guillermo Rauch
a079cbc7f9 client: fixes #1632 2014-06-17 18:07:30 -07:00
Guillermo Rauch
1c68029030 Merge pull request #701 from rase-/fix/more-tests
Test fixes.
2014-06-17 17:03:51 -07:00
Tony Kovanen
8925b62e4e Test fixes.
- Readded all the browsers to Zuul config.
- Fixed b64 encoding test, typo + we're better off asserting the actual b64
  encoding.
- Got rid of the base64-js dependency only needed by the test described above.
- Running iPhone tests for 6.0 and above due to some really weird timeout
  issues on older iPhone emulators, where tests do succeed when run
  individually (and fail on no other browser even together).
2014-06-18 02:57:34 +03:00
Guillermo Rauch
fb17a52bc9 fix base64 test 2014-06-17 14:12:03 -07:00
Guillermo Rauch
b3129141e4 fix indent 2014-06-17 10:56:03 -07:00
Guillermo Rauch
570bcd0626 fix SCRIPT5022: SecurityError on IE
this error is not caused by cross-domain, but by the limit
on how many open connections the tab might have

thus we close each connection after the test is done
2014-06-17 09:34:41 -07:00
Guillermo Rauch
1c35f9ac32 Merge branch 'master' of github.com:automattic/socket.io-client 2014-06-17 08:09:14 -07:00
Guillermo Rauch
1d8630a874 socket: whitelist connect_error and connect_timeout (fixes #534) 2014-06-17 08:08:52 -07:00
Guillermo Rauch
8a77f1ebe3 socket: whitelist connect_error and connect_timeout 2014-06-17 08:01:56 -07:00
Guillermo Rauch
1b60056793 Merge pull request #697 from rase-/fix/tests
Delete bad test, set timeouts before disconnecting eioc
2014-06-16 17:27:30 -07:00
Tony Kovanen
5834fed8a9 Delete bad test, set timeouts before disconnecting eioc 2014-06-17 03:24:28 +03:00
Guillermo Rauch
b282b9654e Merge branch 'master' of github.com:automattic/socket.io-client 2014-06-16 14:56:08 -07:00
Guillermo Rauch
14a9fdb64f package: bump engine.io 2014-06-16 08:36:01 -07:00
Guillermo Rauch
c511c7544a package: bump engine.io-client 2014-06-16 08:35:45 -07:00
Thanasis Polychronakis
55fb100fc0 http.Server is a constructor
...and thus requires the `new` keyword
2014-06-14 13:52:36 +03:00
Guillermo Rauch
bcba6b1aab Merge pull request #693 from holic/fix-url-port
url: use strings for port, eqeq for port check
2014-06-13 19:19:42 -07:00
Guillermo Rauch
7dcb4dcc9d Merge pull request #695 from audreyt/patch-1
Handle io.connect(null, opts) correctly
2014-06-13 19:16:24 -07:00
唐鳳
84da0c910e Handle io.connect(null, opts) correctly
In migrating to Socket.IO 1.0.x, we had to change `null` into `"/"` in:

```
io.connect(null, opts)
```

( See adbc86e529 (diff-d87f0347aff1316677a2d709ec4b4777R49) )

This is because `typeof null` is `object`, so the options are discarded.

Fixed by checking for truth value of `uri` before checking its type.
2014-06-14 06:26:42 +08:00
Kevin Ingersoll
9c7a0a34fe url: use strings for port, eqeq for port check 2014-06-13 14:38:50 -07:00
Guillermo Rauch
a94b6abb5a Release 1.3.0 2014-06-13 13:27:36 -07:00
Guillermo Rauch
6159df3937 fixed client 2014-06-13 13:04:50 -07:00
Guillermo Rauch
095acb49ce package: fix component-emitter 2014-06-13 12:39:19 -07:00
Guillermo Rauch
b177528107 Merge branch 'master' of github.com:automattic/socket.io-client 2014-06-13 12:35:57 -07:00
Guillermo Rauch
31d39285bd package: fix duplicate parser [Rase-] 2014-06-13 12:35:46 -07:00
Guillermo Rauch
f4c65a6ba0 Merge pull request #692 from rase-/add/reconnection-events-to-socket
Reconnection events propagated to socket
2014-06-13 11:26:57 -07:00
Tony Kovanen
3c6237f051 Rename propagateEvent to emitAll 2014-06-13 21:26:31 +03:00
Tony Kovanen
b9c4816aca Document events 2014-06-13 21:21:51 +03:00
Tony Kovanen
be3f3c4bb5 Use blacklist instead of internal emit function 2014-06-13 21:21:28 +03:00
Guillermo Rauch
e07d4e1b40 Merge pull request #263 from andybons/example_fix
Update example to use v1.2.2
2014-06-13 11:18:39 -07:00
Andrew Bonventre
51318a66c8 update example to use v1.2.2 2014-06-13 14:13:21 -04:00
Tony Kovanen
f15104dcba style 2014-06-13 20:27:39 +03:00
Guillermo Rauch
6f7bab5dfd Merge pull request #1578 from kevin-roark/add/emit-buffer-test
added the client emit-buffer test
2014-06-13 10:10:40 -07:00
Guillermo Rauch
544aae4079 Merge pull request #682 from kevin-roark/add/emit-buffer
add a buffer for emitted events to only send after connection
2014-06-13 10:10:34 -07:00
Guillermo Rauch
b806c88ff7 Merge pull request #262 from dainis/newline_escape_fix
Newline escape fix
2014-06-13 10:09:10 -07:00
Dainis Tillers
c998d68631 Merge branch '1.1.1_newline_escape_fix' into newline_escape_fix 2014-06-13 15:06:45 +03:00
Dainis Tillers
de0b4a9d4a Fixed - previously any json message which contained a newline would fail to parse as it would replace escaped newline incorrectly 2014-06-13 15:03:46 +03:00
Tony Kovanen
57551c1462 Propagate events to sockets without an internal event listener in Manager 2014-06-13 14:14:57 +03:00
Tony Kovanen
109395ee34 Propagating reconnecting and reconnection events to socket 2014-06-13 03:45:41 +03:00
Tony Kovanen
a20671c511 Propagate reconnection events to socket from manager 2014-06-13 03:28:38 +03:00
Guillermo Rauch
4d51b9f9a0 Merge pull request #655 from holic/fix-url-port
Fix incorrect ports in connection URL
2014-06-12 15:00:27 -07:00
Kevin Ingersoll
d08acd89c7 Use explicit port on url ID, not on url href 2014-06-12 14:32:39 -07:00
Kevin Ingersoll
f09d2b439c Fix protocol regex, use falsy port, use href as unique ID 2014-06-12 14:16:07 -07:00
Kevin Ingersoll
67d077af2e Fix ports when connecting to 80/443 from non-80/443 host 2014-06-12 14:15:57 -07:00
Guillermo Rauch
7d2b44e176 index: fix typo [thanks @yanatan16] 2014-06-11 10:42:48 -07:00
Guillermo Rauch
f3c5981f70 Merge pull request #17 from kevin-roark/add/benchmarking
added benchmarking
2014-06-08 14:12:41 -07:00
Kevin Roark
17cf621e86 big binary bench as well 2014-06-08 14:08:10 -07:00
Kevin Roark
8a7e0b8b0a added benchmarking 2014-06-08 12:23:48 -07:00
Tony Kovanen
0b5fdf995a Merge pull request #1603 from nkzawa/patch-2
Add removeListener to blacklisted events
2014-06-08 14:40:25 +03:00
Naoyuki Kanezawa
a66bea5b33 add removeListener to blacklisted events 2014-06-08 20:34:50 +09:00
Guillermo Rauch
ff7ef76ff9 Merge pull request #260 from ifraixedes/patch-1
Update README.md
2014-06-07 10:26:57 -07:00
Ivan Fraixedes
038d0ef21e Update README.md
`require(engine.io).listen()` can receive a second optional parameter as options
2014-06-07 17:14:41 +01:00
Guillermo Rauch
a1a88aaaaf Merge pull request #1600 from poldridge/master
Update index.js
2014-06-06 22:36:19 -07:00
poldridge
3f817c3a18 Update index.js
Added missing hasOwnProperty check. socket.io breaks without it when Object.prototype has been extended.
2014-06-06 22:08:58 -07:00
Roman Shtylman
79a1ac0398 README: use svg badges 2014-06-06 17:21:57 -04:00
Roman Shtylman
5f889a682f README: change badge organization to Automattic 2014-06-06 17:21:26 -04:00
Guillermo Rauch
1efe0d05c5 index: added BC for force new connection 2014-06-06 09:06:54 -07:00
Guillermo Rauch
0791a86d67 Merge pull request #687 from reid/deps
Merge-ready @davglass deps PR: component-emitter@1.1.2, component-bind@1.0.0
2014-06-04 15:26:13 -07:00
Reid Burke
e07cec53a0 Merge branch 'deps' of github.com:davglass/socket.io-client into deps
Conflicts:
	package.json
2014-06-04 15:20:44 -07:00
Guillermo Rauch
3c308369d2 Merge pull request #16 from reid/component-emitter
Upgrade component-emitter to 1.1.2
2014-06-04 15:17:37 -07:00
Reid Burke
035fa7dded Upgrade component-emitter to 1.1.2
Switch from depending on a tarball URL to the published
component-emitter package at its latest version.

Change all references to emitter module to the new
component-emitter name.
2014-06-04 15:03:37 -07:00
Guillermo Rauch
2ec3d89d4b Merge pull request #213 from defunctzombie/server_attach
add Server.attach method
2014-06-04 11:16:57 -07:00
Roman Shtylman
b8366057d2 lib: remove unused file 2014-06-04 13:45:48 -04:00
Roman Shtylman
48f006f947 make require('engine.io')() return a new Server instance
fixes #212
2014-06-04 13:45:48 -04:00
Roman Shtylman
cb2b80afd9 remove lib/index.js
Needless level of indirection which blocks actually reading the
important parts of the code.
2014-06-04 13:45:47 -04:00
Roman Shtylman
d3ed8418a8 remove unused require 2014-06-04 13:45:47 -04:00
Roman Shtylman
d74f93e4f9 add Server.attach method
This method does what engine.attach use to do but is now on the
instantiated server instance. This makes it possible to create engine.io
servers without yet attaching them to any active http server.

When creating a project which will server static files/pages alongside
engine.io on the same domain/process this makes it easier to separate
logic into files without having to pass around the http server.
2014-06-04 13:45:43 -04:00
Guillermo Rauch
ce9e4720d9 Merge pull request #258 from mokesmokes/fix211
fix GH-211, set CORS headers when sending error message
2014-06-03 17:45:33 -07:00
Guillermo Rauch
baac860d5d Update package.json 2014-06-03 17:43:53 -07:00
Guillermo Rauch
dca8afc952 Update Readme.md 2014-06-03 17:43:40 -07:00
Mark Mokryn
b98406a678 fix GH-211, set CORS headers when sending error message 2014-06-04 03:21:11 +03:00
Guillermo Rauch
b6db0bb9b6 Update package.json
Fixes #673
2014-06-03 15:38:32 -07:00
Guillermo Rauch
99bbd74d14 Merge pull request #1582 from kevin-roark/add/clearer-example-instructions
Add/clearer example instructions
2014-06-02 20:44:34 -07:00
Kevin Roark
398511ddee Merge branch 'upstream' into add/clearer-example-instructions 2014-06-02 20:28:42 -07:00
Kevin Roark
fdf7937815 clearer instructions to install chat example 2014-06-02 20:28:19 -07:00
Guillermo Rauch
658b8fd36c Release 1.0.4 2014-06-02 20:08:33 -07:00
Guillermo Rauch
475909e642 Release 1.0.4 2014-06-02 20:08:33 -07:00
Guillermo Rauch
95acec8b94 package: bump socket.io-client 2014-06-02 20:07:07 -07:00
Kevin Roark
5812ddf2b0 added the client emit-buffer test 2014-06-01 23:20:42 -07:00
Kevin Roark
8e76ec1717 add a buffer for emitted events to only send after connection 2014-06-01 23:18:02 -07:00
FredyC
77fd9d110a updated tests to reflect autoConnect option 2014-06-01 10:09:53 +02:00
FredyC
29cc049f37 add autoConnect option to wait with connecting 2014-06-01 09:32:06 +02:00
Guillermo Rauch
955055bf53 Merge pull request #15 from kevin-roark/fix/parser-style-and-optimization
Less indentation and a decent optimization
2014-05-31 23:35:00 -07:00
Kevin Roark
5ca1da1c7e bump protocol version here too 2014-05-31 23:30:39 -07:00
Kevin Roark
4e33d6a6c5 Less indentation and a small optimization
The optimization is the "else if" instead of "if" for checking
array in _removeBlobs. No need to iterate over keys of a blob.
2014-05-31 22:41:12 -07:00
Guillermo Rauch
1bbc3951bd Release 1.0.3 2014-05-31 18:34:50 -07:00
Guillermo Rauch
fa60e791e9 Release 1.0.3 2014-05-31 18:34:49 -07:00
Tony Kovanen
5c3e0af944 Merge pull request #678 from rase-/bump/server
Bump socket.io
2014-05-31 21:54:20 +03:00
Tony Kovanen
4bf3d7b7ca Bump socket.io 2014-05-31 21:52:57 +03:00
Guillermo Rauch
36792e2b81 README: remove old notice 2014-05-31 11:37:17 -07:00
Guillermo Rauch
3a6cf6c967 Merge branch 'master' of github.com:automattic/socket.io-client 2014-05-31 11:36:34 -07:00
Guillermo Rauch
039eed2c2a package: bump socket.io-client 2014-05-31 09:53:25 -07:00
Guillermo Rauch
6de022b180 Merge pull request #1565 from kevin-roark/add/binary-ack
Add/binary ack
2014-05-31 09:50:19 -07:00
Guillermo Rauch
dc9881caed Merge pull request #677 from rase-/fix/tests
Fix tests
2014-05-31 09:49:04 -07:00
Tony Kovanen
57c85897bb Update socket.io dev dependency 2014-05-31 13:46:19 +03:00
Guillermo Rauch
a06331d29f travis fix 2014-05-30 21:37:22 -07:00
Guillermo Rauch
22aaae4135 Release 0.3.0 2014-05-30 21:33:58 -07:00
Guillermo Rauch
1f4baa6f82 Merge pull request #3 from hiddenmin/patch-1
Update package.json
2014-05-30 21:32:46 -07:00
Amin Cheloh
e46f60ba3e Update package.json 2014-05-31 11:30:03 +07:00
Guillermo Rauch
6b67b9ce13 README: fix travis 2014-05-30 21:24:16 -07:00
Guillermo Rauch
e639685370 fix travis 2014-05-30 21:23:55 -07:00
Guillermo Rauch
1f2e681ce2 package: bump socket.io-parser for binary ack fix 2014-05-30 21:11:57 -07:00
Guillermo Rauch
62adb5efcd package; bump socket.io-parser for binary ack fix 2014-05-30 21:11:29 -07:00
Guillermo Rauch
2997b08ce3 Release 2.2.0 2014-05-30 21:11:00 -07:00
Guillermo Rauch
15c60ad13c Merge pull request #8 from kevin-roark/add/binary-ack
add binary ack documentation, update to version 4
2014-05-30 20:50:42 -07:00
Guillermo Rauch
647b51ef0b Merge pull request #676 from kevin-roark/add/binary-ack
distinction between ACK and BINARY_ACK
2014-05-30 20:49:05 -07:00
Kevin Roark
fb9fe3ebe3 add binary ack documentation, update to version 4 2014-05-30 20:49:00 -07:00
Guillermo Rauch
8acf2452de Merge pull request #14 from kevin-roark/add/binary-ack
added a BINARY_ACK type
2014-05-30 20:43:23 -07:00
Kevin Roark
397944fcbe big file tests 2014-05-30 20:40:44 -07:00
Kevin Roark
b43ef06adf distinction between ACK and BINARY_ACK 2014-05-30 18:42:42 -07:00
Kevin Roark
27dada65b9 distinction between ACK and BINARY_ACK 2014-05-30 18:42:23 -07:00
Kevin Roark
ca4f42a922 added a BINARY_ACK type 2014-05-30 18:41:47 -07:00
Guillermo Rauch
99f1ac9aae Merge pull request #1563 from rase-/fix/no-disconnect-fired-for-nsp
Fix namespace iterator in disconnect
2014-05-30 16:40:59 -07:00
Tony Kovanen
ee8d0fbae0 Fix namespace iterator in disconnect 2014-05-31 02:25:28 +03:00
Guillermo Rauch
79e00801bd Merge pull request #674 from rase-/add/utf8-tests
Add tests for utf8 multibyte chracters
2014-05-30 15:48:47 -07:00
Guillermo Rauch
8e08a6d419 Merge pull request #1562 from rase-/add/utf8-tests
Add test case for emitting multibyte chars
2014-05-30 15:48:34 -07:00
Tony Kovanen
318ae87f50 Add test case for emitting multibyte chars 2014-05-31 01:45:31 +03:00
Tony Kovanen
8d5ef935de Add tests for utf8 multibyte chracters 2014-05-31 01:39:44 +03:00
Guillermo Rauch
2c1b61148d Merge branch 'master' of github.com:automattic/socket.io 2014-05-30 14:14:12 -07:00
Guillermo Rauch
507054c0a8 package: bump engine.io for utf8 binary fix 2014-05-30 14:09:54 -07:00
Guillermo Rauch
f5b75b0a0e package: bump engine.io-client for binary utf8 fix 2014-05-30 14:09:33 -07:00
Guillermo Rauch
3358918824 Release 1.2.2 2014-05-30 12:37:43 -07:00
Guillermo Rauch
d84b6aa22d package: bump engine.io-parser 2014-05-30 12:18:04 -07:00
Guillermo Rauch
5ac8af3e4a Release 1.0.6 2014-05-30 12:16:54 -07:00
Guillermo Rauch
c396acffa6 Merge branch 'master' of github.com:LearnBoost/engine.io-parser 2014-05-30 12:00:09 -07:00
Guillermo Rauch
1b8e077b22 Merge pull request #24 from rase-/fix/utf8
Fix utf8 encoding for binary payloads.
2014-05-30 11:59:47 -07:00
Tony Kovanen
37ede5ffdd Add parser encode/decode test with long dash 2014-05-30 16:20:36 +03:00
Tony Kovanen
2da2fbbabc Don't use the already deprecated binary buffer encoding 2014-05-30 16:04:38 +03:00
Tony Kovanen
067e286d2b Use plain binary encoding for byte length since we're now using utf8.js 2014-05-30 14:15:27 +03:00
Tony Kovanen
dfceb006d7 Merge pull request #1554 from grant/master
Fix xss vulnerability in example chat app
2014-05-30 12:15:12 +03:00
Grant Timmerman
4d83456f74 Fix xss vulnerability in example chat app 2014-05-30 02:03:33 -07:00
Tony Kovanen
201aad83b1 Merge pull request #1540 from grant/master
Make chat example wrap long words (no overflow)
2014-05-30 12:02:15 +03:00
Grant Timmerman
72eb61d01f Make chat example wrap long words (no overflow) 2014-05-30 01:44:27 -07:00
Tony Kovanen
163a2a696e Merge pull request #1543 from mohnish/patch-1
Remove obsolete message from README file
2014-05-29 21:33:36 +03:00
Dav Glass
64de64cb91 component-emitter@1.1.2, component-bind@1.0.0 2014-05-29 08:54:14 -05:00
Guillermo Rauch
199a479ebc Merge pull request #1545 from overra/patch-1
Use cleanInput() on incoming messages
2014-05-28 20:47:20 -07:00
Guillermo Rauch
d383ff9662 Merge pull request #1546 from hiddenmin/patch-1
Update Readme.md
2014-05-28 19:42:39 -07:00
Amin Cheloh
416b550189 Update Readme.md
socket.io-adapter link
2014-05-29 09:41:37 +07:00
Adam Snodgrass
536b338a01 Use cleanInput() on incoming messages
This prevents XSS if one were to send messages using socket.io from the console.
2014-05-28 20:35:24 -05:00
Mohnish Thallavajhula
a06ae10895 Remove obsolete message from README file 2014-05-28 17:10:50 -07:00
Guillermo Rauch
35a85084b1 Release 1.0.2 2014-05-28 13:24:59 -07:00
Guillermo Rauch
8d1e98306d Release 1.0.2 2014-05-28 13:24:56 -07:00
Guillermo Rauch
0c2b44a846 package: bump parser for windows fix 2014-05-28 13:23:51 -07:00
Guillermo Rauch
3aab16cf86 package: bump parser for windows fix 2014-05-28 13:23:37 -07:00
Guillermo Rauch
0f6ee2dbd9 travis 2014-05-28 12:56:10 -07:00
Guillermo Rauch
d7f40a0bc6 travis 2014-05-28 12:55:55 -07:00
Guillermo Rauch
61ea471035 Merge pull request #255 from Aaron1011/fix_badge
Fix Travis Badge URL in README
2014-05-28 12:09:30 -07:00
Aaron1011
5d83c7c222 Fix Travis Badge URL in README 2014-05-28 15:07:37 -04:00
Guillermo Rauch
68ac0d6d24 Release 1.0.1 2014-05-28 10:32:31 -07:00
Guillermo Rauch
9857cd0550 Release 1.0.1 2014-05-28 10:32:28 -07:00
Guillermo Rauch
367a9cb5a5 Release 1.0.0 2014-05-28 10:19:25 -07:00
Guillermo Rauch
00ef9ca652 Release 1.0.0 2014-05-28 10:19:24 -07:00
Guillermo Rauch
c5333d0d08 Merge branch 'master' of github.com:LearnBoost/socket.io-client 2014-05-27 17:42:15 -07:00
Guillermo Rauch
05911dab50 added android to zuul 2014-05-27 17:42:05 -07:00
Guillermo Rauch
6bebd60ddb Merge pull request #669 from kevin-roark/update/has-binary-data
bump has-binary-data
2014-05-24 15:19:53 -07:00
Guillermo Rauch
2febbce87d Merge pull request #1530 from kevin-roark/update/has-binary-data
bump has-binary-data
2014-05-24 15:19:48 -07:00
Kevin Roark
b0e6072512 bump has-binary-data 2014-05-24 14:23:40 -05:00
Kevin Roark
31c45862cb bump has-binary-data 2014-05-24 14:14:59 -05:00
Guillermo Rauch
aaf07313c6 Release 2.1.5 2014-05-24 11:37:02 -07:00
Guillermo Rauch
60f25b95e8 Merge pull request #668 from rase-/fix/ack
add test cases for dates in ack and on callbacks
2014-05-24 11:23:56 -07:00
Guillermo Rauch
cf16eca0f7 Merge pull request #11 from rase-/fix/date
don't iterate keys of date objects
2014-05-24 11:22:14 -07:00
Tony Kovanen
9e6f519926 add test cases for dates in ack and on callbacks 2014-05-24 21:18:31 +03:00
Guillermo Rauch
809e2bc3f8 Merge pull request #1529 from rase-/add/bc
Added socket.handshake BC object
2014-05-24 11:08:00 -07:00
Tony Kovanen
e2fb6e58c8 don't iterate keys of date objects 2014-05-24 19:33:30 +03:00
Tony Kovanen
10adcb089e Added socket.handshake BC object 2014-05-24 17:02:47 +03:00
Guillermo Rauch
ed0b5c13ff Release 1.0.0-pre5 2014-05-22 09:35:33 -07:00
Guillermo Rauch
5bc75ea944 Release 1.0.0-pre5 2014-05-22 09:35:32 -07:00
Guillermo Rauch
cd4f6ad5e9 package: bump socket.io-client for parser fixes 2014-05-22 09:32:42 -07:00
Guillermo Rauch
24f2ef5009 package: bump engine.io-client 2014-05-22 09:26:26 -07:00
Guillermo Rauch
54e6c79014 package: bump engine.io 2014-05-22 09:25:58 -07:00
Guillermo Rauch
3b6c195afa Release 1.2.1 2014-05-22 09:08:39 -07:00
Guillermo Rauch
ca7a539856 package: bump engine.io-client 2014-05-22 09:08:06 -07:00
Guillermo Rauch
0eca5e5d46 shishishishishi 2014-05-22 01:45:21 -07:00
Guillermo Rauch
13cbe34fbc index: prevent inaccurate length for utf8.js-encoded strings 2014-05-22 01:26:56 -07:00
Pawel
5676699a1c added missing comment about Content-Type header 2014-05-21 11:21:32 +02:00
Pawel
bd42b1ee1e added missing support for XSS filters on IE
issue #252
2014-05-21 11:14:56 +02:00
Guillermo Rauch
0986c3f94c Release 1.0.0-pre4 2014-05-19 16:02:59 -07:00
Guillermo Rauch
237b234cab Release 1.0.0-pre4 2014-05-19 16:02:54 -07:00
Guillermo Rauch
547440605d package: bump client 2014-05-19 16:02:31 -07:00
Guillermo Rauch
668cb4bd54 build 2014-05-19 16:01:55 -07:00
Guillermo Rauch
7bbd91b98f Release 1.2.0 2014-05-18 10:17:41 -07:00
Guillermo Rauch
21ee5c46f1 re-run tests 2014-05-17 15:57:50 -07:00
Guillermo Rauch
45ddad7467 Release 1.0.0-pre3 2014-05-17 15:40:41 -07:00
Guillermo Rauch
d763c8b6ea Release 1.0.0-pre3 2014-05-17 15:40:40 -07:00
Guillermo Rauch
10261c5211 removed flashsocket, moving to userland 2014-05-17 15:24:40 -07:00
Guillermo Rauch
36f955b296 package: bump parser 2014-05-17 14:03:09 -07:00
Guillermo Rauch
5d210ac46c package: bump parser 2014-05-17 14:02:57 -07:00
Guillermo Rauch
993b2b0240 Release 2.1.4 2014-05-17 13:50:54 -07:00
Guillermo Rauch
005a55026e Merge pull request #10 from kevin-roark/fix/null-reconstruction-bug
fix null reconstruction bug
2014-05-17 13:36:50 -07:00
Guillermo Rauch
2a513998e5 package: bump engine.io-client 2014-05-16 16:57:44 -07:00
Guillermo Rauch
ea89e520bc package: bump engine.io 2014-05-16 16:57:41 -07:00
Kevin Roark
6d3218eb3a fix null reconstruction bug 2014-05-15 10:51:39 -04:00
Guillermo Rauch
4bb92430e0 re-execute tests 2014-05-14 11:38:24 -07:00
Guillermo Rauch
361053c30b further reduce 2014-05-14 11:34:13 -07:00
Guillermo Rauch
e822d4f1de README: tweak 2014-05-14 11:27:12 -07:00
Guillermo Rauch
6bae44f7a9 Release 1.1.1 2014-05-14 11:19:05 -07:00
Guillermo Rauch
b5a311e2d1 test: reduce packet size 2014-05-14 10:45:20 -07:00
Guillermo Rauch
c8bf064b10 Merge pull request #1513 from hallucynogenyc/patch-1
Update for new npm check
2014-05-06 10:15:33 -04:00
hallucynogenyc
08fe191211 Update for new npm check
Npm will now throw a warning when installing a package:

npm WARN package.json socket.io@1.0.0-pre2 No repository field.

If the repository field is not present.
2014-05-06 16:14:50 +02:00
Guillermo Rauch
ccc4482fe6 package: bump parser 2014-05-06 06:31:50 -04:00
Guillermo Rauch
7fe6f0f63e Release 1.0.5 2014-05-06 06:31:05 -04:00
Guillermo Rauch
086e366095 Merge pull request #20 from joeybaker/patch-1
Don't pass too many arguments
2014-05-05 18:18:18 -04:00
Joey Baker
b0e75f94c4 Don't pass too many arguments
`.apply()` has a max argument length which was easily exceeded by a large buffer. This makes more calls to `String.fromCharCode` but is guaranteed not to throw a `RangeError`.

More on max argument size: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply#Using_apply_and_built-in_functions
2014-05-05 15:02:08 -07:00
Guillermo Rauch
371e940355 Merge pull request #19 from rase-/quirky-strings
Encode strings with utf8.js to support multibyte strings
2014-04-30 10:16:41 -07:00
Guillermo Rauch
855733b484 Merge pull request #661 from rase-/fix/tests
Fix reconnection tests on browsers using JSONP
2014-04-30 10:05:45 -07:00
Tony Kovanen
7b8ba01e60 Fix reconnection tests on browsers using JSONP 2014-04-30 16:04:35 +03:00
Guillermo Rauch
81f93af215 Merge pull request #17 from lpinca/update/base64-arraybuffer
package: bump `base64-arraybuffer` to `0.1.2`
2014-04-29 20:34:20 -07:00
Guillermo Rauch
dcccf58dcb Merge pull request #16 from get/license
Add MIT license file and update readme
2014-04-29 18:09:20 -07:00
Tony Kovanen
52bc2f8c03 Encode strings with utf8.js to support multibyte strings 2014-04-30 01:23:35 +03:00
Guillermo Rauch
7e7c0e1800 test: comment out bad tests
cc @j-salazar
2014-04-28 11:44:18 -07:00
Guillermo Rauch
ab0fa5bee7 test: fix global mem leak error 2014-04-28 11:21:15 -07:00
Guillermo Rauch
0842729c1f test: temporarily removing parser test 2014-04-28 11:16:59 -07:00
Guillermo Rauch
9720c76d10 Release 1.0.0-pre2 2014-04-27 19:40:33 -07:00
Guillermo Rauch
4a7085d2c5 Release 1.0.0-pre2 2014-04-27 19:40:32 -07:00
Guillermo Rauch
0f127d2b7d package: bump engine.io 2014-04-27 19:23:07 -07:00
Guillermo Rauch
8f8ee231c8 package: bump engine.io-client 2014-04-27 19:22:54 -07:00
Guillermo Rauch
e87e9e18e1 package: bump parser 2014-04-27 18:54:53 -07:00
Guillermo Rauch
c68af4db35 package: bump parser 2014-04-27 18:54:42 -07:00
Guillermo Rauch
aea5477c43 Release 2.1.3 2014-04-27 18:45:57 -07:00
Guillermo Rauch
2619b9153f README: fix 2014-04-27 14:27:58 -07:00
Guillermo Rauch
327bfaafa7 Release 1.1.0 2014-04-27 14:24:45 -07:00
Guillermo Rauch
76628a0d9e socket: removed unneeded clearTimeout (fixes #250) 2014-04-26 10:50:27 -07:00
Luigi Pinca
b4e7c610b3 package: bump base64-arraybuffer to 0.1.2 2014-04-24 15:13:36 +02:00
GK
5f5eb31edc added MIT license file and updated readme 2014-04-22 19:44:01 -04:00
Guillermo Rauch
8313b3f7dc Merge pull request #9 from rase-/bump/zuul
Bump zuul version
2014-04-17 17:14:59 -07:00
Guillermo Rauch
7e1019ece7 Merge pull request #657 from rase-/bump/zuul
Bump zuul version
2014-04-17 17:14:50 -07:00
Tony Kovanen
ec5cdc09fe Bump zuul version 2014-04-18 03:09:48 +03:00
Tony Kovanen
11edc45624 Bump zuul version 2014-04-18 03:05:57 +03:00
Guillermo Rauch
739e412b20 Merge pull request #15 from rase-/bump/zuul
Bump zuul version
2014-04-17 17:05:33 -07:00
Tony Kovanen
ad03afaa36 Bump zuul version 2014-04-18 03:01:48 +03:00
Guillermo Rauch
46351d38b8 Merge pull request #1489 from kevin-roark/add/protocol-check
added test that server and client using same protocol
2014-04-14 13:11:04 -07:00
Kevin Roark
ce68fb3105 Merge branch 'upstream' into add/protocol-check 2014-04-14 12:43:01 -04:00
Guillermo Rauch
94905500e4 Merge pull request #1467 from rase-/add/set-backwards-compatibility
Added backwards compatible settability of engine.io maxHttpBufferSize
2014-04-13 12:25:36 -07:00
Guillermo Rauch
927904067c package: bump engine.io-parser 2014-04-13 12:06:11 -07:00
Guillermo Rauch
2d6c0000f2 Release 1.0.4 2014-04-13 12:05:48 -07:00
Tony Kovanen
f830899e39 Added backwards compatible settability of engine.io maxHttpBufferSize
Updated readme
2014-04-12 12:02:52 +03:00
Guillermo Rauch
ca8a435d01 Merge pull request #246 from rase-/fix/jsonp-tests
Fix tests
2014-04-11 11:09:51 -07:00
Tony Kovanen
83caa815cd Removed an old test that checked the ws api works (which is now removed) and fixed a global leak in JSONP tests 2014-04-11 21:09:24 +03:00
Guillermo Rauch
e86b9f09f6 Merge pull request #656 from kevin-roark/fix/query-auth
Allows user-level query string parameters to be in socket.request
2014-04-11 10:57:19 -07:00
Guillermo Rauch
3444f017bc Merge pull request #1492 from kevin-roark/add/query-test
Added a test to check access to client query params
2014-04-11 10:57:04 -07:00
Kevin Roark
0588dc0fc4 Added a test to check access to client query params
It fails with the current upstream client! There is a pending PR to
make this test pass though.
2014-04-11 13:19:19 -04:00
Guillermo Rauch
57425ab1dd Merge pull request #1485 from rase-/add/origins
Added support for setting allowed origins
2014-04-11 09:46:37 -07:00
Guillermo Rauch
32db7c46c0 tweaks 2014-04-11 09:45:52 -07:00
Tony Kovanen
463d7a16a1 Moved the origins checking callback outside the origins getter/setter function. 2014-04-11 19:39:10 +03:00
Tony Kovanen
5d74847123 Updated README to include origins 2014-04-11 01:29:37 +03:00
Guillermo Rauch
ddf29dff03 Merge pull request #243 from rase-/add/origin-callback
Origins support
2014-04-10 15:24:05 -07:00
Tony Kovanen
5b7f0cffb1 Updated README to include allowRequest callback 2014-04-11 01:23:42 +03:00
Tony Kovanen
802f130080 Made the request verification process async 2014-04-11 01:17:57 +03:00
Tony Kovanen
db36d031bc Added support for giving a function to engine.io to decide whether a request should be allowed or not when verifying. This is used by socket.io to check for allowed origins. 2014-04-11 01:11:32 +03:00
Kevin Roark
99bfc07b9d Allows user-level query string parameters to be in socket.request
Uses the full url string rather than parsed.href;

Also relies on a PR in engine.io
2014-04-10 16:26:45 -04:00
Kevin Roark
f8b4d87331 added test that server and client using same protocol 2014-04-10 14:45:32 -04:00
Tony Kovanen
e9928b2b1d Switched to async allowRequest callback in engine.io for setting the allowed origins 2014-04-10 21:02:20 +03:00
Guillermo Rauch
60c8596a51 Merge pull request #12 from nkzawa/patch-0
Fix encodePayloadAsBinary method encodes packets to base64
2014-04-10 10:42:14 -07:00
Guillermo Rauch
c597bac0c5 package: bump engine.io-parser to 1.0.3 2014-04-10 06:06:48 -07:00
Guillermo Rauch
c4a35bc536 Release 1.0.3 2014-04-10 06:06:08 -07:00
Guillermo Rauch
0743f325b9 Merge pull request #241 from contra/master
use _query instead of query, closes #203
2014-04-09 15:02:00 -07:00
Tony Kovanen
d33553a4bd Added support for setting allowed origins 2014-04-09 22:34:53 +03:00
Contra
1ebc286af4 use _query instead of query, fixes compat with restify 2014-04-03 18:03:16 -07:00
Naoyuki Kanezawa
14728f9a77 fix encodePayloadAsBinary method encodes packets to base64 2014-04-02 00:41:40 +09:00
Philipp Kyeck
6c03892236 fixed the payload format
was there but wasn't displayed correctly b/c of missing code formatting
2014-03-30 22:05:15 +02:00
Guillermo Rauch
45a98970d7 added information about logging 2014-03-28 11:51:54 -03:00
Guillermo Rauch
d669fbb8e0 Merge pull request #238 from rase-/add/max-http-buffer-size
Maximum buffer size for polling
2014-03-26 16:22:17 -03:00
Tony Kovanen
f8100f9237 Added a maximum buffer size to received data from polling. Settable with the maxHttpBufferSize option 2014-03-26 21:19:54 +02:00
Guillermo Rauch
1327863d1f Merge pull request #8 from kevin-roark/add/docs
added documentation with a few examples
2014-03-26 14:49:15 -03:00
Kevin Roark
1771ee75e1 added documentation with a few examples 2014-03-26 13:47:47 -04:00
Guillermo Rauch
8b2df0b237 Merge pull request #11 from binlain/master
Fix length calculation when encoding as binary
2014-03-26 11:02:20 -03:00
binlain
395ff6f86f Fix length calculation when encoding as binary 2014-03-26 00:11:02 +01:00
Guillermo Rauch
0b4e4f6a67 Merge pull request #1464 from rase-/add/set-backwards-compatibility
Set function for BC
2014-03-25 20:09:16 -03:00
Tony Kovanen
656047536a The set function in server can be used to set some attributes for backwards compatibility 2014-03-26 00:04:22 +02:00
Guillermo Rauch
97b7ab4fe2 Merge pull request #1462 from nicolagreco/patch-1
Mistake in callback call 'done' instead of 'next' in docs
2014-03-24 22:38:02 -03:00
Nicola Greco
6a435ce677 Mistake in callback call 'done' instead of 'next' in docs 2014-03-25 01:02:46 +00:00
Guillermo Rauch
98f807192e Merge pull request #236 from DimitarChristoff/bug-235-enumerables
fixing looping array via for in to normal loop
2014-03-24 19:40:53 -03:00
Guillermo Rauch
e0a30f3416 Merge pull request #7 from kevin-roark/update/protocol-version
updated protocol version
2014-03-24 16:14:06 -03:00
Guillermo Rauch
45a6d7beaa package: bump server for new parser 2014-03-24 16:02:10 -03:00
Kevin Roark
ed7cd9410c updated protocol version 2014-03-24 14:55:35 -04:00
Guillermo Rauch
116e023b48 Merge pull request #6 from kevin-roark/add/new-protocol-description
Updated Readme for version 3
2014-03-24 15:49:56 -03:00
Kevin Roark
8b75c22bba Protocol now reflects the latest parser implementatation.
Including 'decoded' events, Decoder and Encoder instances, Decoder.add,
etc.
2014-03-24 14:46:32 -04:00
Guillermo Rauch
6aa553b211 Merge branch 'master' of github.com:LearnBoost/socket.io 2014-03-24 14:44:00 -03:00
Guillermo Rauch
024af23b2c package: bump client 2014-03-24 14:43:37 -03:00
Guillermo Rauch
bf3882a235 package: bump parser 2014-03-24 14:36:19 -03:00
Guillermo Rauch
b50d9f8f5d Merge pull request #1443 from kevin-roark/add/simple-tests
added some new tests, including binary with acks
2014-03-24 14:21:19 -03:00
Kevin Roark
874c194210 Merge branch 'upstream' into add/simple-tests
Conflicts:
	package.json
2014-03-24 13:03:43 -04:00
DimitarChristoff
e4593af733 fixing looping array via for in to normal loop 2014-03-21 11:32:13 +00:00
Guillermo Rauch
f537560bcc package: bump socket.io-parser 2014-03-18 18:28:49 -03:00
Guillermo Rauch
7197d6a29d rebuild 2014-03-18 17:16:38 -03:00
Guillermo Rauch
c2ec3ae823 package: rollback socket.io-parser to fix event acks 2014-03-18 16:46:05 -03:00
Guillermo Rauch
8dba96511d package: rollback socket.io-parser to fix acks 2014-03-18 16:45:48 -03:00
Guillermo Rauch
f8d1d33dfa Merge branch 'master' of github.com:LearnBoost/socket.io
Conflicts:
	package.json
2014-03-18 16:34:49 -03:00
Guillermo Rauch
2f93ddd2b9 Merge branch 'master' of github.com:LearnBoost/socket.io-client 2014-03-18 16:34:28 -03:00
Guillermo Rauch
736106a9e7 package: bump engine.io 2014-03-18 16:31:22 -03:00
Guillermo Rauch
9414193836 package: bump engine.io-client for android fix 2014-03-18 16:31:08 -03:00
Guillermo Rauch
7f9d623660 Release 1.0.5 2014-03-18 16:26:37 -03:00
Guillermo Rauch
61f012f349 package: bump engine.io-parser 2014-03-18 16:23:53 -03:00
Guillermo Rauch
e87f52c656 Release 1.0.2 2014-03-16 13:45:04 -03:00
Guillermo Rauch
2d9b4551fb Merge pull request #8 from rase-/add/android-test
Added android to zuul browsers
2014-03-16 12:56:23 -03:00
Tony Kovanen
112c37966b Encoding binary as ArrayBuffer for android, because blob data is sent as empty payload 2014-03-16 14:28:04 +02:00
Guillermo Rauch
f1a2826708 fix pkg 2014-03-16 08:02:14 -03:00
Tony Kovanen
0609fa1ff9 Added android to zuul browsers 2014-03-16 02:31:15 +02:00
Guillermo Rauch
f5a8ac293a Merge pull request #1452 from kevin-roark/update/parser-dependency
updated parser dependency
2014-03-15 19:35:35 -02:00
Kevin Roark
afc83ad65a Merge branch 'upstream' into add/simple-tests
Conflicts:
	package.json
2014-03-15 17:32:27 -04:00
Kevin Roark
b5f90923a2 updated parser dependency 2014-03-15 17:30:47 -04:00
Guillermo Rauch
aa5ecb3ce6 Merge pull request #649 from kevin-roark/update/parser-dependency
updated parser dependency
2014-03-15 19:30:45 -02:00
Kevin Roark
c8e73e9824 Merge branch 'upstream' into update/parser-dependency 2014-03-15 17:08:07 -04:00
Guillermo Rauch
c574f5f959 Merge pull request #1451 from elisee/patch-1
Fix // … to be /* … */ in README.md
2014-03-15 17:57:01 -02:00
elisee
ba339cc460 Fix // … to be /* … */ 2014-03-15 20:25:00 +01:00
Guillermo Rauch
3777da984e tidy up .gitignore 2014-03-15 10:46:10 -03:00
Guillermo Rauch
aee4dd9a6d package: bump expect.js 2014-03-15 10:39:21 -03:00
Guillermo Rauch
85f248991d Release 1.0.0-pre 2014-03-15 10:36:57 -03:00
Guillermo Rauch
ad86129437 Release 1.0.0-pre 2014-03-15 10:36:51 -03:00
Guillermo Rauch
c8eda77da3 package: fix versions 2014-03-15 10:33:02 -03:00
Guillermo Rauch
a4fabba781 Readme: tweak 2014-03-15 10:23:25 -03:00
Guillermo Rauch
1c3995dc0b rebuild 2014-03-15 10:23:14 -03:00
Kevin Roark
1b4cf93da4 updated parser dependency 2014-03-14 22:13:00 -04:00
Guillermo Rauch
c19d2692e2 package: bump engine.io 2014-03-14 19:39:10 -03:00
Guillermo Rauch
efb94e15cd package: bump engine.io-client 2014-03-14 19:38:48 -03:00
Guillermo Rauch
ca05ac493c Release 1.0.4 2014-03-14 19:38:24 -03:00
Guillermo Rauch
85b5c7af1a package: bump engine.io-client 2014-03-14 19:37:17 -03:00
Guillermo Rauch
36ad8e87eb package: bump socket.io-adapter 2014-03-14 15:05:43 -03:00
Guillermo Rauch
668b9cfb47 Release 0.2.0 2014-03-14 15:04:31 -03:00
Guillermo Rauch
c039311f4a Merge branch 'master' of github.com:LearnBoost/socket.io-adapter 2014-03-14 15:04:00 -03:00
Guillermo Rauch
74bbac0633 Merge pull request #1 from kevin-roark/update/parser-dependency
needs the faster parser
2014-03-14 16:03:32 -02:00
Kevin Roark
50a641a2db needs the faster parser 2014-03-14 13:25:13 -04:00
Kevin Roark
7d4aa670ad bumped parser dependency 2014-03-13 10:49:31 -04:00
Kevin Roark
620f94a007 Merge branch 'upstream' into add/simple-tests
Conflicts:
	package.json
2014-03-12 20:33:01 -04:00
Guillermo Rauch
f808c377b0 package: bump engine.io 2014-03-12 15:47:29 -03:00
Guillermo Rauch
af2d92a530 build 2014-03-12 15:46:46 -03:00
Guillermo Rauch
5b06e88661 bump engine.io-client 2014-03-12 15:45:19 -03:00
Guillermo Rauch
12a67e8aa9 build 2014-03-12 15:39:59 -03:00
Guillermo Rauch
901353d044 support: fix browserify 2014-03-12 15:35:59 -03:00
Guillermo Rauch
52fdbcb71a Release 1.0.3 2014-03-12 15:25:26 -03:00
Guillermo Rauch
edadf1bbd0 package: bump engine.io-client 2014-03-12 15:19:36 -03:00
Guillermo Rauch
086a3e5a59 Release 1.0.2 2014-03-12 14:54:45 -03:00
Guillermo Rauch
0a287e4437 bump engine.io-client 2014-03-12 14:54:26 -03:00
Guillermo Rauch
236c440107 Merge pull request #645 from rase-/add/reconnect-on-open
Reconnects in open if it fails
2014-03-12 15:49:09 -02:00
Guillermo Rauch
d1d332d91a build 2014-03-12 14:38:54 -03:00
Guillermo Rauch
3f8af8828b support: fix browserify 2014-03-12 14:31:53 -03:00
Guillermo Rauch
56f8bda74d Merge pull request #647 from rase-/fix/browserify
Forces browserify build to only insert global
2014-03-12 15:20:00 -02:00
Tony Kovanen
5cbd005ef3 Test case for reconnection disabled 2014-03-12 19:05:14 +02:00
Tony Kovanen
e7b1646cf4 Forces browserify build to only insert global 2014-03-12 18:45:20 +02:00
Tony Kovanen
50659849e4 Tests are now stable 2014-03-12 17:33:46 +02:00
Tony Kovanen
4636c6bbda Increase timeout 2014-03-12 15:52:27 +02:00
Tony Kovanen
588d47e04d Reconnects in open if it fails 2014-03-12 15:13:25 +02:00
Guillermo Rauch
85e20509fc Merge pull request #635 from nkzawa/patch-4
Should call callback on open
2014-03-12 10:52:01 -02:00
Guillermo Rauch
5b9080b2af Merge pull request #644 from nkzawa/patch-6
Enable reconnection by default
2014-03-12 10:51:53 -02:00
Naoyuki Kanezawa
3ce84e2784 enable reconnection by default 2014-03-12 02:29:23 +09:00
Guillermo Rauch
e92027568d package: bump engine.io-client 2014-03-11 11:53:59 -03:00
Guillermo Rauch
41c5b37ac7 bump engine.io 2014-03-11 11:53:42 -03:00
Guillermo Rauch
c972153669 bump client 2014-03-10 20:09:56 -03:00
Guillermo Rauch
bb5f739636 build 2014-03-10 20:09:20 -03:00
Guillermo Rauch
ee257ce3e7 fix browserify signature 2014-03-09 12:22:56 -03:00
Kevin Roark
4823d20cf1 Merge branch 'upstream' into add/simple-tests
Conflicts:
	package.json
2014-03-08 20:58:41 -05:00
Guillermo Rauch
380d3b7e2a Merge pull request #7 from rase-/refactor/tests
Cleaned up logic for deciding if blob tests should be run
2014-03-08 21:12:45 -02:00
Tony Kovanen
134897a1e0 Cleaned up logic for deciding if blob tests should be run 2014-03-09 01:01:17 +02:00
Guillermo Rauch
44a79f9cee server: make Server#adapter work after construction 2014-03-07 18:33:36 -03:00
Guillermo Rauch
56e7de5044 Release 0.1.0 2014-03-07 18:07:08 -03:00
Guillermo Rauch
41d9c0b344 initial commit 2014-03-07 17:46:17 -03:00
Guillermo Rauch
81e8a0c3a5 added support for volatile packets 2014-03-07 04:09:43 -06:00
Guillermo Rauch
adffabeee3 style 2014-03-07 03:41:22 -06:00
Guillermo Rauch
79dd06a767 socket: fix flags api state 2014-03-07 03:32:27 -06:00
Guillermo Rauch
93df3c47cc Readme; document Socket#id 2014-03-07 00:43:40 -06:00
Guillermo Rauch
2a3a5a01a2 Readme: document Socket#join and Socket#leave 2014-03-07 00:39:39 -06:00
Guillermo Rauch
dd8745ece2 Readme: document to multiple-call situation 2014-03-07 00:33:54 -06:00
Guillermo Rauch
4615e932c1 Readme: document Socket#to and Socket#in 2014-03-07 00:33:05 -06:00
Guillermo Rauch
7e96f0a1ff Readme: document Socket#emit 2014-03-07 00:31:01 -06:00
Guillermo Rauch
8df80ee91c move adapter out 2014-03-06 22:49:38 -06:00
Kevin Roark
612d35194f updated parser dependency 2014-03-06 18:41:43 -05:00
Guillermo Rauch
4f2916b5a6 Release 2.1.2 2014-03-06 17:37:57 -06:00
Guillermo Rauch
4ead96448c Release 1.0.1 2014-03-06 17:33:48 -06:00
Guillermo Rauch
f14ad2d28d package: bump engine.io-parser 2014-03-06 17:30:49 -06:00
Guillermo Rauch
83514d709f Release 1.0.1 2014-03-06 17:29:14 -06:00
Guillermo Rauch
e247e937fe Merge pull request #6 from kevin-roark/add/binary-ack-support
Encoding ack packets as binary
2014-03-06 17:23:50 -06:00
Guillermo Rauch
66be853117 Merge pull request #6 from rase-/refactor/browser.js
Using the blob module
2014-03-06 17:19:03 -06:00
Guillermo Rauch
a2612ed8c2 Merge pull request #5 from rase-/enhance/style
Style, bump arraybuffer.slice version and remove nbsp
2014-03-06 17:14:16 -06:00
Tony Kovanen
ec08d1d004 Using the blob module for creating a blob constructor that abstracts the constructor api used 2014-03-07 00:35:46 +02:00
Kevin Roark
c8cce3e8c0 removed the 'in' slowness 2014-03-06 17:24:58 -05:00
Guillermo Rauch
4d08358017 transports: fix jshint warnings and style 2014-03-06 14:03:44 -08:00
Kevin Roark
a5ff1d854e added some new tests, including binary with acks 2014-03-06 16:58:21 -05:00
Kevin Roark
2f729e07b4 Encoding ack packets as binary
So that arbitrary data can be passed back and forth in ack callbacks.
2014-03-06 16:52:08 -05:00
Tony Kovanen
56e1ce292d Style, bump arraybuffer.slice version and remove nbsp 2014-03-06 22:49:24 +02:00
Guillermo Rauch
0c8ed9547c package: introduce proper engine.io version 2014-03-06 12:11:46 -08:00
Guillermo Rauch
ee529125d8 package: introduce proper engine.io-client version 2014-03-06 12:11:28 -08:00
Guillermo Rauch
38ef3810d1 Release 1.0.0 2014-03-06 11:55:06 -08:00
Guillermo Rauch
caacf6d442 polling-xhr: added OPTIONS support, fixes CORS 2014-03-06 11:33:05 -08:00
Guillermo Rauch
b0e5527513 style 2014-03-06 11:32:24 -08:00
Guillermo Rauch
8104694fdf package: bump parser 2014-03-04 23:29:22 -08:00
Guillermo Rauch
3e7bc3e4f8 package: bump parser 2014-03-04 23:20:06 -08:00
Guillermo Rauch
b8d7885a0e Release 2.1.1 2014-03-04 23:18:59 -08:00
Guillermo Rauch
1b7b04bfba Merge pull request #5 from kevin-roark/fix/remove-blob-object-check
Fix/remove blob object check
2014-03-04 23:15:44 -08:00
Kevin Roark
ba64f07bca Removed has-binary-data dependency
And replaced it with better isBuf function. Has binary data would not have
checked objects that contain blobs. isBuf only checks the current object,
not its child objects
2014-03-05 00:20:52 -05:00
Kevin Roark
47df0694f5 Fixed the object check in binary.removeBlobs
Remove blobs has to iterate over a javascript object and asynchronously
remove the blobs / files. It does this by iterating over arrays and
objects in the larger object recursively.

Problem was in checking for object to iterate over, wasn't checking if
that object was binary data itself. So it was working, but really slowly,
by iterating over every byte in a Buffer and checking it for blobs.
Much faster now :)
2014-03-04 23:50:36 -05:00
Guillermo Rauch
9575acd876 remove duplicate manifest 2014-03-04 15:08:32 -08:00
Guillermo Rauch
b49521610e Merge pull request #636 from nkzawa/patch-5
Set the sent flag to true
2014-03-04 14:55:30 -08:00
Guillermo Rauch
bc2125b250 Merge pull request #638 from j-salazar/lookup_opts
Let uri be optional when adding options for lookup()
2014-03-04 14:55:08 -08:00
Julian Salazar
cec50ca7bc let uri be optional when adding options for lookup() 2014-03-04 12:41:12 -08:00
Naoyuki Kanezawa
696fc5211b set the sent flag to true 2014-03-04 22:58:01 +09:00
Naoyuki Kanezawa
db638c2276 should call callback on open 2014-03-04 22:47:31 +09:00
Guillermo Rauch
6be582db3d package: bump client 2014-03-04 00:25:24 -08:00
Guillermo Rauch
7e629140fd build 2014-03-03 22:54:09 -08:00
Guillermo Rauch
a2812f7b15 Merge branch 'master' of github.com:LearnBoost/socket.io-client 2014-03-03 22:22:28 -08:00
Guillermo Rauch
befeca6d37 build 2014-03-03 22:22:14 -08:00
Guillermo Rauch
94b5387e49 fix reconnection 2014-03-03 22:21:21 -08:00
Guillermo Rauch
265401680d Merge pull request #633 from nkzawa/patch-3
Fix undefined packet type
2014-03-03 22:13:33 -08:00
Guillermo Rauch
570993fdbf build 2014-03-03 17:32:43 -08:00
Guillermo Rauch
502ef414a7 bunch of reconnection fixes 2014-03-03 17:32:33 -08:00
Guillermo Rauch
a8453d9421 README: clarify reconnection events 2014-03-03 14:24:13 -08:00
Guillermo Rauch
12733a8759 test: fix global leakage 2014-03-03 14:22:51 -08:00
Guillermo Rauch
5e28161322 Merge pull request #1440 from kevin-roark/add/binary-broadcasting
Added binary support to broadcasting of events
2014-03-02 20:53:37 -08:00
Kevin Roark
c2bf0ea700 Added binary support to broadcasting of events
lib/namespace.js previously was not considering whether an event had
binary data and was giving all events parser.EVENT type -- now it uses
the has-binary-data module to set the event type appropriately.

Then, after this fix there was a problem with lib/adapter.js -- because
socket.io-parser modifies the packet object in its encoding, the sockets
after the 1st in a broadcast were not getting the correct data. To fix
this, the data is encoded once in adapter, and then the encoded data
is passed to each of the sockets.

lib/socket.js and lib/client.js were updated to allow for the above. The
.packet method of each now takes an optional second "preEncoded" parameter
-- if this is true, then client skips the encoding and just writes the
packet argument directly to engine.

test/socket.io.js was updated to add two new tests that test
multi-messaging of events with binary data.
2014-03-02 22:15:16 -05:00
Naoyuki Kanezawa
a3ae721aae fix undefined packet type 2014-03-02 16:17:11 +09:00
Guillermo Rauch
a9b8bb9810 Merge pull request #608 from nkzawa/patch-2
fix a namespace connection error
2014-03-01 19:31:35 -08:00
Guillermo Rauch
a3e4caed0d Merge pull request #632 from rileytg/patch-1
fix http://browserify.org/ link
2014-03-01 19:26:45 -08:00
Naoyuki Kanezawa
fc4cdb40e7 Merge remote-tracking branch 'upstream/master' into patch-2
Conflicts:
	test/connection.js
2014-03-02 06:22:07 +09:00
Riley Guerin
a30df67e31 fix http://browserify.org/ link 2014-03-01 13:06:20 -08:00
Guillermo Rauch
571f3a663c package: bump socket.io-client for new build 2014-03-01 10:18:33 -08:00
Guillermo Rauch
4cdfe187b2 build 2014-03-01 10:18:05 -08:00
Guillermo Rauch
8865ea180a package: bump socket.io 2014-03-01 09:33:07 -08:00
Guillermo Rauch
45c5abc7d6 add badge 2014-03-01 09:08:24 -08:00
Guillermo Rauch
d293e3be7c version badge 2014-03-01 09:00:34 -08:00
Guillermo Rauch
e2a5e4b1f2 package: adjust socket.io-client 2014-03-01 08:55:50 -08:00
Guillermo Rauch
f6ffa50e04 package: adjust socket.io 2014-03-01 08:55:27 -08:00
Guillermo Rauch
7b4c8c67c2 package: bump parser 2014-03-01 08:55:05 -08:00
Guillermo Rauch
f602e4e5c2 package: bump parser 2014-03-01 08:54:53 -08:00
Guillermo Rauch
e280e17094 Merge pull request #1432 from kevin-roark/add/better-binary-events
Updated protocol-facing code for new binary protocol
2014-03-01 08:53:49 -08:00
Guillermo Rauch
2c0bb5d451 Merge pull request #629 from kevin-roark/add/better-binary-events
Updated protocol-facing code to reflect new binary protocol
2014-03-01 08:53:43 -08:00
Guillermo Rauch
3283b89c4e Release 2.1.0 2014-03-01 08:32:23 -08:00
Guillermo Rauch
947d7b4ea5 Merge pull request #1437 from keyosk/master
Update chat example
2014-03-01 08:21:53 -08:00
Cody Massin
318d62e5ad When displaying leave and join messages show a message with an updated participants count.
Signed-off-by: Cody Massin <keyosk@gmail.com>
2014-03-01 00:20:51 -08:00
Guillermo Rauch
dd4b822426 Merge pull request #4 from kevin-roark/add/class-based-protocol
Protocol is now class-based
2014-02-27 15:09:14 -08:00
Kevin Roark
d2c8362fc6 Updated manager to reflect new class-based protocol
Main difference is the handling of parser.Decoder's 'decoded' event
and removing most of the logic that interprets the packet data from
manager, since parser handles it now.
2014-02-27 18:02:24 -05:00
Kevin Roark
fc34c7d7a4 Updated protocol-facing code to reflect newest parser
Socket.io-parser now has a class-based Encoder and Decoder scheme,
so client.js was changed appropriately.

The main difference is that most of the logic for interpreting packets
is now isolated to parser, and client receives a 'decoded' event when
parser has a reconstructed packet ready to go.
2014-02-27 17:54:02 -05:00
Kevin Roark
5bea0bf41c Protocol is now class-based
Separated the encoding and decoding into two public-facing objects,
Encoder and Decoder.

Both objects take nothing on construction. Encoder has a single method,
encode, that mimics the previous version's function encode (takes a
packet object and a callback). Decoder has a single method too, add, that
takes any object (packet string or binary data). Decoder emits a 'decoded'
event when it has received all of the parts of a packet. The only
parameter for the decoded event is the reconstructed packet.

I am hesitant about the Encoder.encode vs Decoder.add thing. Should it be
more consistent, or should it stay like this where the function names are
more descriptive?

Also, rewrote the test helper functions to deal with new event-based
decoding. Wrote a new test in test/arraybuffer.js that tests for memory
leaks in Decoder as well.
2014-02-27 17:46:20 -05:00
Guillermo Rauch
101aeabdb8 Merge pull request #3 from kevin-roark/add/new-binary-parsing
A faster and smaller binary parser and protocol
2014-02-27 12:15:10 -08:00
Guillermo Rauch
027c73b91b remove old credentials 2014-02-27 12:14:52 -08:00
Kevin Roark
299849b002 A faster and smaller binary parser and protocol
This is a squash of a few commits. Below is a small summary of commits.

Results from it: before the build size of socket.io-client was ~250K.
Now it is ~215K.
Tests I was doing here
(https://github.com/kevin-roark/socketio-binaryexample/tree/speed-testing)
take about 1/4 - 1/5 as long with this commit compared to msgpack.

The first was the initial rewrite of the encoding, which removes msgpack
and instead uses a sequence of engine.write's for a binary event. The
first write is the packet metadata with placeholders in the json for
any binary data. Then the following events are the raw binary data that
get filled by the placeholders.

The second commit was bug fixes that made the tests pass.

The third commit was removing unnecssary packages from package.json.

Fourth commit was adding nice comments, and 5th commit was merging
upstream.

The remaining commits involved merging with actual socket.io-parser,
rather than the protocol repository. Oops.
2014-02-26 22:31:39 -05:00
Kevin Roark
2f526f7a68 Updated Readme for version 3
Version 3 is the protocol that supports the newest binary-handling
parser.
2014-02-26 21:24:45 -05:00
Guillermo Rauch
53f9dce1a1 Merge branch 'master' of github.com:LearnBoost/socket.io-protocol
Conflicts:
	index.js
2014-02-26 14:59:48 -08:00
Kevin Roark
449c28ce1c Updated protocol-facing code for new binary protocol
This is a squash of four boring commits. The gist is that client.js
encoding and decoding stuff was updated to take an array of encoded packets
to write, and to handle sequences of binary packets to decode. There was
also merging done with upstream. All tests are passing.
2014-02-26 13:45:47 -05:00
Kevin Roark
67f15b16d2 Updated protocol-facing code to reflect new binary protocol
This is a squash of 6 small commits. Below is a summary of each. The gist
is that manager.js encoding and decoding portions were changed to work
with the new socket.io-protocol; this includes handling of encoding
a list of packets, and handling sequences of binary packets.

Commit 1 was the initial rewrite.

Commit 2 got all the tests passing via bug fixes.

Commit 3 updated the has-binary-data dependency and the build.

Commit 4 added nice comments.

Commits 5 and 6 updated build and engine.io dependencies respectively.
2014-02-26 13:41:51 -05:00
Guillermo Rauch
9249b76e40 Merge pull request #4 from kevin-roark/fix/global-buffer-check
Added a check for global.Buffer before .isBuffer
2014-02-24 17:49:59 -08:00
Kevin Roark
bc162313a1 Added a check for global.Buffer before .isBuffer
Need this check for the future where we remove the browserify insertion
of Buffer. It is also cleaner to check, I believe.
2014-02-24 20:33:31 -05:00
Guillermo Rauch
3faca287a5 chat: forward 3000 2014-02-24 16:54:48 -08:00
Guillermo Rauch
266278d14c prettify 2014-02-24 16:46:23 -08:00
Guillermo Rauch
d286ba2064 rename app->index 2014-02-24 16:28:04 -08:00
Guillermo Rauch
d4ec1b6ff0 use shorthand io call 2014-02-24 16:27:46 -08:00
Guillermo Rauch
49f11f9cf5 README: move to index 2014-02-24 16:27:37 -08:00
Guillermo Rauch
b33afd6455 build 2014-02-24 11:13:10 -08:00
Guillermo Rauch
39564b3594 fix dep 2014-02-23 09:30:26 -08:00
Guillermo Rauch
0ffdc7c397 add missing dependency in tests 2014-02-23 09:22:30 -08:00
Guillermo Rauch
f26cc4cd00 travis: fix 2014-02-23 09:15:56 -08:00
Guillermo Rauch
05fd23ddda Merge pull request #1430 from kevin-roark/fix/has-binary-dependency
fixed the has-binary-data dependency
2014-02-21 14:19:35 -08:00
Kevin Roark
d21b1f36a3 fixed the has-binary-data dependency 2014-02-21 17:10:53 -05:00
Guillermo Rauch
f34f4bb65b build 2014-02-21 13:40:48 -08:00
Guillermo Rauch
f753830874 package: bump socket.io 2014-02-21 13:32:47 -08:00
Guillermo Rauch
573b32cc7d package: bump client 2014-02-21 13:32:12 -08:00
Guillermo Rauch
c7ac4155ca Merge pull request #622 from kevin-roark/add/binary-support
Add/binary support
2014-02-21 13:18:30 -08:00
Guillermo Rauch
16d1afc7fc Merge pull request #1426 from brishin/binary
Binary
2014-02-21 13:02:26 -08:00
Guillermo Rauch
299bfcb533 Merge pull request #624 from Aaron1011/fix_node
Don't test on Node 0.8
2014-02-21 13:02:04 -08:00
Aaron Hill
f5c66b7c59 Don't test on Node 0.8
Zuul 1.5.2 doesn't seem to support it
2014-02-21 16:00:31 -05:00
Guillermo Rauch
c9e738e7c3 Merge pull request #623 from Aaron1011/node_11
Test against Node 0.11
2014-02-21 12:53:15 -08:00
Kevin Roark
2782221069 made text-blob-builder a module and added dev dependency 2014-02-20 18:31:19 -05:00
Aaron Hill
e8a440a3f1 Test against Node 0.11 2014-02-20 18:23:52 -05:00
Kevin Roark
3244a57d58 Merge branch 'upstream' into add/binary-support
Merging the browserify changes, etc.
2014-02-20 17:24:09 -05:00
Kevin Roark
c2785fcbb1 fixed spacing on test and updated build 2014-02-20 17:23:49 -05:00
Kevin Roark
675830e726 updated socket.io-client dependency 2014-02-20 17:21:39 -05:00
Guillermo Rauch
2b51abbeea build 2014-02-20 14:14:49 -08:00
Guillermo Rauch
36f8aa8355 updated credentials 2014-02-20 13:56:43 -08:00
Guillermo Rauch
fd1018b92a Merge pull request #1 from rase-/add/zuul
Added zuul config and made testing work on browsers
2014-02-20 13:54:56 -08:00
Guillermo Rauch
b66ef40573 package: bump engine.io-client 2014-02-20 13:48:32 -08:00
Guillermo Rauch
2ae3b9dde2 implemented better browserify pipeline 2014-02-20 13:43:08 -08:00
Guillermo Rauch
78164e5f65 Merge pull request #227 from j-salazar/memleak
close() properly when triggered in connection handler
2014-02-20 13:37:04 -08:00
Tony Kovanen
4e8db59871 Configured npm test 2014-02-20 13:08:04 +02:00
Tony Kovanen
85f8f98699 Added a couple of tests with Blobs for issue #2 2014-02-20 12:39:56 +02:00
Tony Kovanen
42cc5d2cff Added zuul config and made testing work on browsers 2014-02-20 12:18:21 +02:00
Julian Salazar
ef77af8c2f close() properly when triggered in connection handler 2014-02-20 01:06:41 -08:00
Kevin Roark
755870466a updated engine and parser dependencies and build 2014-02-19 19:57:02 -05:00
Kevin Roark
b1c971507b updated engine and -parser dependencies 2014-02-19 19:54:31 -05:00
Guillermo Rauch
5efe005679 Release 2.0.0 2014-02-19 16:51:16 -08:00
Guillermo Rauch
f071471e46 package: bump engine.io-client 2014-02-19 15:43:49 -08:00
Guillermo Rauch
6524010835 package: bump parser 2014-02-19 15:38:49 -08:00
Guillermo Rauch
861b60ef26 package: fix github url 2014-02-19 15:26:55 -08:00
Guillermo Rauch
86725d1e92 moved from socket.io-protocol 2014-02-19 15:26:26 -08:00
Kevin Roark
9de6059d64 Merge branch 'upstream' into add/binary-support
Conflicts:
	.zuul.yml
	lib/socket.js
	package.json
	socket.io.js
	test/connection.js
	test/support/server.js
2014-02-19 18:16:55 -05:00
Guillermo Rauch
504996417a updated readme and moved parser out 2014-02-19 15:12:47 -08:00
Kevin Roark
8c3ca99e7c merged binary with upstream's new chat app 2014-02-19 18:03:36 -05:00
Kevin Roark
beab053123 anonymous function style correct 2014-02-19 17:57:59 -05:00
Guillermo Rauch
6e8a2cd890 .travis: fix 2014-02-19 12:03:16 -08:00
Guillermo Rauch
db68db7b6b Merge pull request #3 from rase-/add/zuul
Added zuul configurations and testing for browsers
2014-02-19 11:44:28 -08:00
Tony Kovanen
8e5557d712 Added zuul configurations and testing for browsers 2014-02-19 21:26:27 +02:00
Kevin Roark
d5c35bb1f2 Added binary support to socket.io-client
Added changes to reflect socket.io-parser's async encoding, and use
of has-binarydata to check the event type of an event.

Next added browser tests for sending and receiving of binary data via
arraybuffers.

Then added blob tests and blob recognition.

To make blobs fully work (and Files as well), had to add packet buffering
to client so that slow-encoding blobs are still sent before other events.

I fixed a stupid bug I had added where I used the indexof module (for old
browsers) on a string somewhere instead of an array). This was causing
old IE to receive all events twice.

Old iphone tests were still failing so I updated tests to reflect that
some browsers can receive a blob but not construct them.

Finally, reduced build size by adding the "browser" field to package.json
and making browserify less confused.
2014-02-19 14:07:32 -05:00
Kevin Roark
745ee03102 Added binary support to socket.io
This is a squash of about 25 commits, and here is a summary:

adamreis added initial binary test with the doge image.

kevin-roark updated binary tests and wrote some binary encoding protocol.

kevin-roark replaced the custom binary encoding with msgpack because we
have to handle arbitrary json that contains binary.

adamreis added some 'crazy' tests for emmiting and receiving events with
several types of data.

kevin-roark updated client.js to use socket.io-protocol's async encoding

Did a bunch of upstream merging.
2014-02-19 13:46:39 -05:00
Guillermo Rauch
69de792c03 Merge pull request #1427 from grant/upstream
Example: Chat -- Welcome message is always on top. Click now focuses input.
2014-02-18 21:14:53 -08:00
Grant Timmerman
d037d6cb38 Redefined input-focus click areas 2014-02-18 21:08:43 -08:00
Grant Timmerman
e06ea11c27 Welcome message is always on top. Click now focuses input. 2014-02-18 20:43:59 -08:00
Guillermo Rauch
ab4ea948cc Merge pull request #218 from rase-/add/binary-support
Binary support
2014-02-18 17:28:57 -08:00
Guillermo Rauch
daf8df8f5c Merge pull request #1425 from Aaron1011/node_11
Test on Node 0.11
2014-02-18 17:00:06 -08:00
Guillermo Rauch
ff2476c7a5 Merge pull request #1415 from grant/upstream
Example: Chat
2014-02-18 15:51:51 -08:00
Guillermo Rauch
10e2f12ef9 Merge pull request #3 from brishin/add/binary-support
Add/binary support
2014-02-18 15:00:58 -08:00
Kevin Roark
7f4ad41bca merged new dependencies into upstream 2014-02-18 17:40:27 -05:00
Kevin Roark
26c65aa4a4 Added browser field to package to reduce build
Also made some stylistic changes based on guille's comments on PR
so far.
2014-02-18 17:12:06 -05:00
Tony Kovanen
20d06700c3 Removed the need to set any default values for binary support in transports 2014-02-18 23:56:01 +02:00
Tony Kovanen
a9a6f25e76 style 2014-02-18 23:33:22 +02:00
Guillermo Rauch
c86ea6d9c6 Merge pull request #2 from HaykoKoryun/patch-1
created .npmignore
2014-02-18 13:19:36 -08:00
Guillermo Rauch
bb797a4f83 .travis: drop 0.6, 0.8, upgrade to 0.10 2014-02-18 13:15:22 -08:00
Guillermo Rauch
fd07b59875 Readme: tweak 2014-02-18 13:14:43 -08:00
Guillermo Rauch
1c44485c77 Readme: initial readme 2014-02-18 13:11:21 -08:00
Guillermo Rauch
4f391be65d README: point to reference implementation 2014-02-18 13:10:03 -08:00
Guillermo Rauch
19a4bf06e3 moved parser into own repo engine.io-parser 2014-02-18 13:08:22 -08:00
Guillermo Rauch
7d2c099f79 package: new repository 2014-02-18 13:06:42 -08:00
Guillermo Rauch
105fb8befe moving code from engine.io-protocol 2014-02-18 13:06:06 -08:00
Guillermo Rauch
39f6040bfd Release 1.0.0 2014-02-18 12:23:12 -08:00
Guillermo Rauch
5bfbad0411 Merge pull request #15 from rase-/add/binary-support
Binary support
2014-02-18 12:20:20 -08:00
Aaron Hill
fc77c0faca Test on Node 0.11 2014-02-18 12:31:07 -05:00
Kevin Roark
27f872754e added binary info to docs 2014-02-18 11:18:58 -05:00
Grant Timmerman
e0a85a90aa Changed hash function after testing it on generated lists of random usernames 2014-02-17 13:50:43 -08:00
Grant Timmerman
3aa3213b13 Moved colors to client with hash fn, cleaned up app.js 2014-02-17 13:41:21 -08:00
Grant Timmerman
575ff2ecfc Fixed scrollbar height, fixed "undefined is typing", cleaned up fade effect 2014-02-16 12:12:02 -08:00
Grant Timmerman
852a9d34df Added X is typing functionality 2014-02-16 02:50:33 -08:00
Grant Timmerman
8a3781499d Reorganized event system, added log event, and changed formatting of chat 2014-02-16 01:05:41 -08:00
Grant Timmerman
ab60d166ac Added basic chatroom html 2014-02-15 23:31:00 -08:00
Tony Kovanen
c9c286da12 Fixed b64 encoding for browsers with no binary types at all 2014-02-16 09:11:24 +02:00
Grant Timmerman
f7838635a7 Added basic login page html for the new design 2014-02-15 23:00:20 -08:00
Tony Kovanen
47842afac1 Updated README to match the updated protocol 2014-02-16 03:13:25 +02:00
Tony Kovanen
9d233d3a8b Style 2014-02-15 09:23:43 +02:00
Tony Kovanen
8cd37f0839 Style 2014-02-15 09:15:12 +02:00
Grant Timmerman
cfb2a26d4f Updated package.json, added numUsers int on server, and used io shorthand notation 2014-02-14 21:29:08 -08:00
Guillermo Rauch
09cfb17731 *: remove unused client dir and symlink WARN 2014-02-14 10:34:24 -08:00
Tony Kovanen
a711e3346f Vendor prefixes in BlobBuilder taken into account 2014-02-14 04:50:54 +02:00
Guillermo Rauch
dc2afa4bc1 more tests 2014-02-13 14:44:25 -08:00
Guillermo Rauch
4cd4381b80 lib: bc compatibility 2014-02-13 14:12:59 -08:00
Kevin Roark
98067423ab better msgpack browser module 2014-02-13 00:42:29 -05:00
Guillermo Rauch
d65ec8d649 package: bump socket.io-client 2014-02-12 16:43:08 -08:00
Guillermo Rauch
a34d4e54dc build 2014-02-12 16:36:07 -08:00
Guillermo Rauch
e16ac61b82 package: bump socket.io-client 2014-02-12 16:28:35 -08:00
Guillermo Rauch
525de3c99a fix url 2014-02-12 16:28:14 -08:00
Kevin Roark
a60fd25ee9 Base64 decoding support
Added a function that takes the base64 encoding of our event packets and
decodes them into packet json with correct type, namespace, and data args,
where data args are defined as [eventName, {base64: true, data: base64string}].
Then we leave it up to the user to handle something where base64 is true.

This bit of code is only relevant for very old browsers.
2014-02-12 18:05:46 -05:00
Guillermo Rauch
d17f5ce914 package: use a specific debug 2014-02-12 14:21:04 -08:00
Guillermo Rauch
1982afa481 package: serve a working socket.io-client 2014-02-12 14:16:32 -08:00
Guillermo Rauch
9ab3b106d9 socket: restore 0.8 compatibility 2014-02-12 12:40:22 -08:00
Guillermo Rauch
27141f962d Merge pull request #223 from binlain/master
Fix possible DOS and small changes to timeouts
2014-02-12 12:19:00 -08:00
binlain
336e05b461 Fix dos by possibly creating many intervals 2014-02-12 22:12:39 +01:00
binlain
4c84571280 Merge pull request #1 from LearnBoost/master
123
2014-02-12 15:28:54 +01:00
Kevin Roark
2ad8c4ab4f using isarray 2014-02-12 03:56:42 -05:00
Kevin Roark
0d457ad531 updated debug 2014-02-12 03:04:24 -05:00
Grant Timmerman
1860aa41ee Removed extra lines, removed extra html 2014-02-11 21:46:59 -08:00
Grant Timmerman
598a140ad4 Update styles and formatting 2014-02-11 21:30:07 -08:00
Grant Timmerman
b8f6d4054c Added more friendly username input interface 2014-02-11 21:11:58 -08:00
Grant Timmerman
450d408ed6 Updated code style 2014-02-11 18:18:54 -08:00
Guillermo Rauch
8a438a67a9 fix url for ie6-8 2014-02-11 18:13:25 -08:00
Grant Timmerman
0023aed4c3 Changed tabs to spaces, removed screenshot, and updated README 2014-02-11 17:13:44 -08:00
Grant Timmerman
f99cdc9339 Updated package.json and Readme 2014-02-11 16:22:01 -08:00
Grant Timmerman
999b8bc387 Updated screenshot 2014-02-11 16:16:25 -08:00
Guillermo Rauch
7466ebee3d fix for old ies 2014-02-11 14:19:37 -08:00
Grant Timmerman
95d19e285c Removed external npm socket.io and now using local socket.io module 2014-02-11 13:09:46 -08:00
Grant Timmerman
9f8b1a2e1e Removed .gitignore in the chat example 2014-02-11 13:04:14 -08:00
Grant Timmerman
0c5e3eb5cf Merge branch 'master' of https://github.com/LearnBoost/socket.io into upstream 2014-02-11 13:00:20 -08:00
Grant Timmerman
eca3316620 Removed zuul yml 2014-02-11 12:59:17 -08:00
Grant Timmerman
29df46ae07 Added chat example 2014-02-11 12:48:55 -08:00
Guillermo Rauch
b9ea532c0e .zuul: add iphone and a few other chromes 2014-02-11 11:38:27 -08:00
Guillermo Rauch
361429b076 Release 1.1.2 2014-02-11 10:14:33 -08:00
Guillermo Rauch
8fd1348336 package: bump json3 to fix IE6-7 2014-02-11 10:13:17 -08:00
Nathan Rajlich
2999c522a0 add LICENSE file
Closes #41.
2014-02-10 20:24:05 -08:00
Nathan Rajlich
dbad2e1cdb Release 1.1.2 2014-02-10 18:15:22 -08:00
Nathan Rajlich
39f2b5d849 History: add v1.1.1 changelog notes 2014-02-10 18:15:07 -08:00
Nathan Rajlich
82822cfe8c package: rename to "component-emitter" 2014-02-10 18:13:25 -08:00
Nathan Rajlich
204a1047cf package: update "main" and "component" fields 2014-02-10 18:12:26 -08:00
Tony Kovanen
7c61b41b1c Fixes for iPhone safari 2014-02-11 04:08:12 +02:00
Guillermo Rauch
ca72a22102 package: bump socket.io-parser to fix debug bug 2014-02-10 16:27:04 -08:00
Guillermo Rauch
8bec36b803 socket: fix event blacklisting on ie8<= 2014-02-10 16:26:45 -08:00
Guillermo Rauch
3e972eb423 Release 1.1.1 2014-02-10 16:06:23 -08:00
Guillermo Rauch
e7f3b5fe40 package: bump debug to fix browserify issues 2014-02-10 16:04:42 -08:00
Guillermo Rauch
bc937fc2fb test: prevent global leak problems 2014-02-10 15:52:16 -08:00
Jonathan Ong
b2d7c9be50 Merge pull request #42 from poshaughnessy/license
Add license to Readme (same format as the other components)
2014-02-10 08:42:19 -08:00
Peter O'Shaughnessy
d09675998d Add license to Readme (same format as the other components) 2014-02-10 11:10:43 +00:00
Kevin Roark
589791df3e Added support for reading File objects
Uses the same code as the Blob stuff before (fileReader can take a
Blob or File, and make an ArrayBuffer from either).

Browsers can now directly pass file handles because why not, probably
more useful than blobs.
2014-02-10 03:50:00 -05:00
Kevin Roark
3e561290ce Added Blob support and made encoding async
In order to add Blob support to Socket.IO (part of the larger binary
support), the encode function was made asynchronous (it now takes a
callback) because blobs are converted to ArrayBuffers via an
async FileReader method.

Tests were also added to test the encoding and decoding of Buffers and
ArrayBuffers. The reason there is a new special test method to test
encoded vs decoded ArrayBuffers is that decoded ArrayBuffers in node
don't have the slice function (it is native code that can't be
transmitted over msgpack). Not sure how big of an issue this is.

Because of this new async, we need to now worry about buffering, etc.
Ideally this would all be engine.io level, but dang blobs.

Blob support is very close to file support -- update on that soon.
2014-02-09 14:49:22 -08:00
Guillermo Rauch
980b6a7c40 package: bump engine.io 2014-02-09 11:18:49 -08:00
Guillermo Rauch
9ebe35936c package: bump engine.io-client 2014-02-09 11:18:37 -08:00
Guillermo Rauch
e1fbce0f35 Merge branch 'master' of github.com:LearnBoost/socket.io-client 2014-02-09 11:12:37 -08:00
Guillermo Rauch
fba0495614 README: fix test section 2014-02-09 11:11:05 -08:00
Guillermo Rauch
06d031aea6 Release 0.9.0 2014-02-09 09:57:22 -08:00
Guillermo Rauch
9cde1b367c Merge pull request #214 from mokesmokes/closetest
add tests for https://github.com/LearnBoost/engine.io-client/issues/207
2014-02-09 08:46:09 -08:00
Tony Kovanen
7fa7f82759 Fixes for iPhone safari 2014-02-09 09:44:15 +02:00
Kevin Roark
6c22a75cf9 browser style msgpack 2014-02-08 17:49:27 -08:00
Guillermo Rauch
824f80a2a8 Merge pull request #619 from grant/patch-2
Fixed Spelling Mistake
2014-02-08 17:25:37 -08:00
Grant Timmerman
3c593cf93d Fixed Spelling Mistake
succesful -> successful
2014-02-08 17:19:09 -08:00
Guillermo Rauch
d2f2cc8490 Merge pull request #618 from defunctzombie/fix/url-test
Fix/url test
2014-02-08 16:53:22 -08:00
Tony Kovanen
26cc5aaabc Extracted arraybuffer slicing to a separate module 2014-02-09 02:38:39 +02:00
Roman Shtylman
a70d7e5a44 update debug dependency for browserify 2014-02-08 16:37:57 -08:00
Roman Shtylman
9c7a52ca51 fix using undefined location global in node for lib/url
use `global.location` to support node and browsers
2014-02-08 16:37:10 -08:00
Kevin Roark
95a2a4bd5d replaced custom binary encoding with msgpack 2014-02-08 14:29:06 -08:00
Guillermo Rauch
36b284dd7f README: style 2014-02-08 14:18:48 -08:00
Kevin Roark
e374341a56 initial binary support encoding 2014-02-08 14:11:18 -08:00
Tony Kovanen
f2623da126 Changed blob feature detection 2014-02-08 23:59:02 +02:00
Guillermo Rauch
1ed7920b0e Merge pull request #222 from nlagrow/upgrade
Deny upgrade when proxy doesn't support websocket
2014-02-08 13:50:06 -08:00
Guillermo Rauch
c0393fce20 Merge pull request #1399 from lzyzsd/master
fix captcha in comment
2014-02-08 12:13:01 -08:00
Guillermo Rauch
093f5f7186 style 2014-02-08 12:12:47 -08:00
Guillermo Rauch
1f0f209d5e Merge pull request #1411 from get/server-client-file
change index to read build file from client
2014-02-08 12:11:57 -08:00
Nick LaGrow
468ca23339 Merge branch 'master' of https://github.com/LearnBoost/engine.io into upgrade 2014-02-08 12:11:35 -08:00
Nick LaGrow
17143bde09 Deny upgrade when proxy doesn't support websocket
Some proxies - such as nginx and squid - don't support websocket. The client attempting to upgrade its transport caused the engine.io connection to break (see GH-177). THe server now checks within handleRequest to see if the transport has changed without an upgrade request - if this is the case, the upgrade request is denied (defaults to polling) and the connection is maintained
2014-02-08 12:10:47 -08:00
Guillermo Rauch
6ad57905c4 Merge pull request #611 from poohlty/remove-require-fs
Remove require fs in lib/index.js
2014-02-08 11:41:33 -08:00
Guillermo Rauch
6daaa94f7b Merge pull request #613 from grant/patch-1
Update .travis.yml
2014-02-08 11:41:20 -08:00
Guillermo Rauch
9418352d5b Merge pull request #614 from bmalehorn/zuul_fix
fixed zuul redirect bug
2014-02-08 11:39:23 -08:00
Guillermo Rauch
b19bd5570f Merge pull request #615 from bmalehorn/zuul_update
updated zuul to latest version
2014-02-08 11:38:59 -08:00
GK
fc61a37a6d change index to read build file from client 2014-02-08 11:18:07 -08:00
Naoyuki Kanezawa
78f1fd152f fix a namespace connection error 2014-02-09 03:19:28 +09:00
Brian Malehorn
a9aa51094e updated zuul to latest version 2014-02-08 13:13:03 -05:00
Brian Malehorn
01bf1a613b fixed zuul redirect bug
url() has optional parameter loc
2014-02-08 12:53:40 -05:00
Grant Timmerman
f2808a6fb9 Update .travis.yml
Remove 0.8 from travis.yml in socket.io-client
2014-02-08 09:28:03 -08:00
Tony Kovanen
11bf741f3d Bugfix to blob encoding 2014-02-08 19:16:58 +02:00
Tony Kovanen
603c39c3cc style 2014-02-08 05:09:16 +02:00
Tianyu Liu
351b54ceec Remove require fs in lib/index.js 2014-02-07 17:15:30 -08:00
Tony Kovanen
057d4836cb BlobBuilder stuff 2014-02-08 03:00:15 +02:00
Tony Kovanen
81437e5235 Using after instead of async 2014-02-08 01:42:22 +02:00
Guillermo Rauch
1e84be1270 Merge pull request #14 from HaykoKoryun/patch-1
created .npmignore
2014-02-07 15:29:35 -08:00
Guillermo Rauch
bf8761fb9b Merge pull request #1410 from brishin/test
Fix `npm test`
2014-02-07 15:24:45 -08:00
Brian Donghee Shin
3dcba2859c Fix npm test 2014-02-07 15:23:22 -08:00
Guillermo Rauch
b53edd6e92 Merge pull request #609 from kevin-roark/fix/event-emitter-callback-bug
Should check packet.id for non-null, not 0
2014-02-07 15:16:27 -08:00
Kevin Roark
13d34ff0b6 Should check packet.id for non-null, not 0
Like the server does!!!
2014-02-07 15:10:32 -08:00
Tony Kovanen
9c4f36e10a Supporting sending of blobs. Not completely done yet. 2014-02-08 00:33:47 +02:00
Guillermo Rauch
0ec4836de9 Merge branch 'master' of github.com:LearnBoost/socket.io-client 2014-02-07 14:00:42 -08:00
Tony Kovanen
5df182abfb Dummy support for sending blobs 2014-02-04 09:48:16 +02:00
Tony Kovanen
e345a0f9f7 Truly async encoding 2014-02-04 09:05:27 +02:00
Tony Kovanen
d71fde22fd Making encoding work with callbacks. Not completely there yet. 2014-02-04 00:04:05 +02:00
Tony Kovanen
3ca16b414b Making encoding work with callbacks. Not completely there yet. 2014-02-04 00:03:40 +02:00
Guillermo Rauch
c73e01485d Merge pull request #1403 from nkzawa/patch-1
middlewares of main namespace should be called first
2014-02-03 14:00:14 -08:00
Naoyuki Kanezawa
a3e1b0658f middlewares of main namespace should be called first 2014-02-04 04:00:24 +09:00
Guillermo Rauch
aa0527fe54 Merge pull request #216 from mokesmokes/reqfix
fix Socket.request for upgraded sockets
2014-02-03 07:25:54 -08:00
Mark Mokryn
25e03c8351 Socket.request a simple property 2014-02-03 17:20:32 +02:00
Guillermo Rauch
3cf6a0949b Merge pull request #1402 from gdi2290/patch-1
update copyright year
2014-02-03 06:52:08 -08:00
Guillermo Rauch
c0ec1af75c Merge pull request #220 from gdi2290/patch-1
update copyright year
2014-02-03 06:52:05 -08:00
Tony Kovanen
740150ae50 Nicer feature detection 2014-02-03 15:48:28 +02:00
Mark Mokryn
3b8d7863b8 Socket.request made a nonwritable Socket property set in constructor 2014-02-03 13:32:59 +02:00
PatrickJS
193f401e79 update copyright year 2014-02-03 02:23:19 -08:00
PatrickJS
a98b8abe97 update copyright year 2014-02-03 02:08:42 -08:00
Tony Kovanen
feec922511 Encoding payloads is now using the same base64 encoding scheme as individual packets 2014-02-03 03:13:41 +02:00
Tony Kovanen
44159592c7 Using url parameter for communicating the need for base64 instead of upgrade packet for WebSockets 2014-02-03 02:31:48 +02:00
Mark Mokryn
9bf3119cf4 adding tests for engine.io-client #207, PR #239 2014-02-03 00:31:44 +02:00
Guillermo Rauch
349413ab06 Merge pull request #217 from mokesmokes/id
document Socket.id
2014-02-02 11:02:41 -08:00
Guillermo Rauch
e475fd9aeb Merge pull request #219 from mokesmokes/upgradeEvent
Emit upgrade event after new transport set
2014-02-02 10:49:36 -08:00
Tony Kovanen
1bf72e860c Got rid of polyfilling ArrayBuffer#slice, and made a separate tested module for a function that abstracts slicing 2014-02-02 17:42:19 +02:00
Tony Kovanen
7723e8a2db Upgrade packet can now set transport binary support capabilities 2014-02-02 14:42:16 +02:00
Tony Kovanen
02c44eea33 Individual packets can now be encoded/decoded as base64 strings 2014-02-02 02:45:02 +02:00
Mark Mokryn
1cbca8684b added upgrade event timing test 2014-02-02 02:16:00 +02:00
Mark Mokryn
c8ddbf8e1c Emit upgrade event after new transport set 2014-02-02 01:59:09 +02:00
Tony Kovanen
004261aabd Polyfilling slice when it doens't exist for ArrayBuffer and base64 string to ArrayBuffer conversion into separate modules 2014-02-01 20:19:27 +02:00
Tony Kovanen
e60c62815a Parser now has to figure out whether binary or string data is sent 2014-02-01 14:53:13 +02:00
Tony Kovanen
d9d8548341 Parser now has to figure out whether binary or string data is sent 2014-02-01 14:34:33 +02:00
Tony Kovanen
efc4c06b89 Adapting code to conventions 2014-02-01 13:26:24 +02:00
Tony Kovanen
dbe140c117 Binary support 2014-02-01 01:20:51 +02:00
Tony Kovanen
129687d0ad Binary support 2014-02-01 00:24:39 +02:00
Mark Mokryn
4785b786cb document Socket.id 2014-01-29 17:09:51 +02:00
Bruce Lee
db429864f6 fix captcha 2014-01-24 21:29:55 +08:00
Guillermo Rauch
461918ba63 README: point to new spec 2014-01-18 11:34:06 -08:00
Guillermo Rauch
7ac24db0ce Updated README 2014-01-18 11:33:33 -08:00
Guillermo Rauch
0a6b887fbe Release 0.8.2 2014-01-18 11:26:45 -08:00
Guillermo Rauch
94334afc55 package: bump engine.io-client 2014-01-18 11:26:18 -08:00
Guillermo Rauch
267001cb58 socket: style 2014-01-18 11:24:48 -08:00
Guillermo Rauch
3105fbf8a6 package: added repo 2014-01-17 15:38:33 -08:00
Guillermo Rauch
fcdc78bf9d Merge pull request #605 from defunctzombie/add/zuul-travis-keys
add saucelabs credentials to .travis.yml
2014-01-17 14:48:21 -08:00
Guillermo Rauch
3c1ca60760 Merge pull request #597 from HaykoKoryun/patch-1
updated .npmignore
2014-01-17 14:48:07 -08:00
Roman Shtylman
5aafe90a0b add saucelabs credentials to .travis.yml
Makes the zuul tests actually run on saucelabs.
2014-01-17 14:47:58 -05:00
Guillermo Rauch
c8233bf62c Release 0.8.1 2014-01-17 08:25:22 -08:00
Guillermo Rauch
c3de37047c package: bump engine.io-client 2014-01-17 08:22:17 -08:00
Guillermo Rauch
a429e38d5b Merge pull request #604 from defunctzombie/patch-1
bump zuul to 1.3.0
2014-01-15 20:07:50 -08:00
Roman Shtylman
dc8b76413a bump zuul to 1.3.0
Fixes some saucelabs environment issues and other improvements to zuul.
2014-01-15 22:46:05 -05:00
Guillermo Rauch
7d5612eed7 Merge pull request #1395 from nulltask/patch-1
index: remove send dep
2014-01-15 10:22:41 -08:00
Seiya Konno
3efcd52674 index: remove send dep 2014-01-16 03:18:39 +09:00
Guillermo Rauch
8c0b60791c gitignore: added coverage 2014-01-10 11:47:55 -03:00
Guillermo Rauch
32fe383e70 package: remove send dependency 2014-01-10 11:47:24 -03:00
Guillermo Rauch
6305ebe8aa test: extend client serving tests 2014-01-10 11:47:04 -03:00
Guillermo Rauch
2b1a5afe6c index: simplify and speed up client serving 2014-01-10 11:46:45 -03:00
Guillermo Rauch
d94044fdf9 Makefile: tweak for test-cov 2014-01-09 13:09:44 -03:00
Guillermo Rauch
84bf735e4d add test coverage 2014-01-09 13:09:26 -03:00
Guillermo Rauch
142c73c9a1 index: remove SIO_COV env 2014-01-09 13:01:08 -03:00
Guillermo Rauch
6fb0c8426f Merge branch 'master' of github.com:LearnBoost/engine.io 2014-01-08 17:34:58 -03:00
Guillermo Rauch
d001452935 Merge pull request #210 from mokesmokes/patch-1
Update contributors, thanks Guillermo
2014-01-08 12:04:05 -08:00
mokesmokes
032fd4c8c5 Update contributors, thanks Guillermo 2014-01-08 21:55:46 +02:00
Guillermo Rauch
93fa9a7cb2 polling-xhr: syntax 2014-01-08 16:54:40 -03:00
Guillermo Rauch
099a49b19e package: pin dev deps 2014-01-06 14:58:46 -03:00
Guillermo Rauch
c96768e85c examples: fix port output 2014-01-06 14:07:16 -03:00
Guillermo Rauch
00c35016f8 Merg branch 'master' of github.com:LearnBoost/engine.io 2014-01-06 14:06:35 -03:00
Guillermo Rauch
53c75034d2 Merge pull request #204 from andybons/example
Correctly log the port that the latency example is running on.
2014-01-06 08:27:39 -08:00
Guillermo Rauch
14cc4c5f6b Merge pull request #206 from HaykoKoryun/patch-1
created .npmignore
2014-01-06 07:06:47 -08:00
Guillermo Rauch
b14e3c1b96 Merge pull request #209 from defunctzombie/latency-example-fix
fix latency example
2014-01-06 07:05:53 -08:00
Guillermo Rauch
d5d9236a73 README: fix typo 2014-01-06 09:03:34 -03:00
Roman Shtylman
9e38c2664a fix latency example 2014-01-06 00:40:52 -05:00
Guillermo Rauch
d23c1d9f27 page: syntax 2014-01-05 19:43:47 -03:00
Guillermo Rauch
bd94d27e8f Release 0.8.0 2014-01-05 19:41:35 -03:00
Guillermo Rauch
34ab2c7680 package: bump engine.io-client to 0.8.0 2014-01-05 19:41:06 -03:00
Guillermo Rauch
8ede274e05 test: fix syntax, remove globals 2014-01-05 19:16:15 -03:00
Guillermo Rauch
ecb9762651 package: bump engine.io-client 2014-01-02 08:00:23 -03:00
Guillermo Rauch
07cf9395a0 package: bump engine.io 2014-01-02 08:00:04 -03:00
Guillermo Rauch
7ed789d381 package: remove ~ 2014-01-02 07:40:44 -03:00
Guillermo Rauch
1f02fcf267 Release 0.7.14 2014-01-01 19:02:29 -03:00
Guillermo Rauch
dc7a3e8895 package: bump engine.io-client to 0.7.14 2014-01-01 19:02:02 -03:00
Guillermo Rauch
35c7d55bac package: added test script 2013-12-27 13:16:23 -03:00
Guillermo Rauch
c576ca9875 package: bump zuul 2013-12-26 23:51:57 -03:00
Guillermo Rauch
c5051b67e8 fix connection test 2013-12-26 23:35:50 -03:00
Guillermo Rauch
0f4653c11a make url tests run only on node due to location pollution 2013-12-26 22:32:44 -03:00
Guillermo Rauch
7e42ef05cc url: restore location in tests 2013-12-26 22:00:41 -03:00
Guillermo Rauch
3777bd73bc package: point to socket.io commit temporarily 2013-12-26 21:31:54 -03:00
Guillermo Rauch
48936231ea index: add support for string port numbers 2013-12-26 21:30:33 -03:00
Guillermo Rauch
e65b9b5329 add zuul 2013-12-26 21:25:23 -03:00
Guillermo Rauch
2df1a74f27 README: tweak 2013-12-25 16:43:20 -03:00
Guillermo Rauch
91a6c9dcd2 README: document manager options 2013-12-25 16:40:31 -03:00
Guillermo Rauch
4db6bb5536 .travis: update 2013-12-25 16:13:37 -03:00
Guillermo Rauch
35523da32c README: simplify 2013-12-25 16:12:59 -03:00
Guillermo Rauch
39d5e20944 switch to browserify 2013-12-25 16:00:27 -03:00
Guillermo Rauch
eeb373d2c8 Release 1.1.0 2013-12-25 15:59:41 -03:00
Guillermo Rauch
eb6930f8d5 package: pin versions 2013-12-25 14:28:25 -03:00
Guillermo Rauch
656e224f7c index: use json3 2013-12-25 14:17:11 -03:00
Guillermo Rauch
2b27ff2f2e package: add json3 dep 2013-12-25 14:16:40 -03:00
Guillermo Rauch
f2394e75b9 *: switch to istanbul for coverage analysis 2013-12-25 13:39:51 -03:00
Guillermo Rauch
4671ec33a8 package: pin dev dependencies 2013-12-25 13:34:23 -03:00
Guillermo Rauch
afce31d97b package: pin debug 2013-12-25 13:33:21 -03:00
Guillermo Rauch
96a2017d17 package: switch to browserify 2013-12-25 13:32:27 -03:00
Guillermo Rauch
816087cc00 Makefile: don't rely on global component install 2013-12-25 13:25:19 -03:00
Guillermo Rauch
db2530fef5 Makefile: fix global to be io instead of eio 2013-12-25 13:17:19 -03:00
Guillermo Rauch
2b5183b369 socket: revert onclose reason 2013-12-25 13:15:18 -03:00
Guillermo Rauch
14c71c2e72 socket: fix onclose reason 2013-12-25 13:13:02 -03:00
Guillermo Rauch
03db6a62e7 Readme: document use 2013-12-24 21:46:23 -03:00
Guillermo Rauch
83208b6e11 socket: add conn, client, request getters 2013-12-24 21:36:48 -03:00
Guillermo Rauch
036faa7d89 Readme: fix 2013-12-24 21:02:15 -03:00
Guillermo Rauch
7b2a71ac4f server: add listen 2013-12-24 20:49:21 -03:00
Guillermo Rauch
da844159d9 namespace: jshint friendly usage of reserved keyword for backwards-compatibility 2013-12-24 20:10:16 -03:00
Guillermo Rauch
baea55009b Readme: document usage with node 2013-12-24 20:08:47 -03:00
Guillermo Rauch
198efb0957 Readme: clarify engine.io options 2013-12-24 20:07:56 -03:00
Guillermo Rauch
f0e88265d6 Readme: added example of using 1.0 and koajs 2013-12-24 20:05:24 -03:00
Guillermo Rauch
760e1b5cda Readme: fix 2013-12-24 20:01:56 -03:00
Guillermo Rauch
ecca4ee738 use serveClient in favor of static for broader jshint compliance 2013-12-24 20:00:46 -03:00
Guillermo Rauch
d31aafa5fd socket: fix style 2013-12-24 19:56:10 -03:00
Guillermo Rauch
c545e3b963 lib: fix style 2013-12-24 19:56:01 -03:00
Guillermo Rauch
af66e5df4e client: fix style 2013-12-24 19:55:52 -03:00
Guillermo Rauch
a86994f693 index: syntax 2013-12-24 19:51:53 -03:00
Jonathan Ong
7547b11c71 Merge pull request #38 from HaykoKoryun/patch-1
created .npmignore
2013-12-23 08:09:38 -08:00
Hayko Koryun
4f850be846 created .npmignore
created `.npmignore` to additionally ignore the `test` folder for __production__
2013-12-23 05:09:02 -08:00
Hayko Koryun
76e5e32c52 created .npmignore
created `.npmignore` to additionally ignore the `test` folder for __production__
2013-12-23 04:45:24 -08:00
Hayko Koryun
3d205ee489 updated .npmignore
updated `.npmignore` to completely ignore `test` folder for __production__
2013-12-23 04:32:04 -08:00
Hayko Koryun
41021c8df3 created .npmignore
created `.npmignore` file to additionally ignore `test` folder to not pull for __production__
2013-12-23 04:02:33 -08:00
Hayko Koryun
27ca74dafc created .npmignore
created `.npmignore` to additionally ignore `examples` and `test` folders to not pull them for __production__
2013-12-23 03:54:57 -08:00
Guillermo Rauch
0a197af0b2 Release 0.7.13 2013-12-20 12:41:39 -03:00
Guillermo Rauch
c154d11aad package: bump engine.io-client 2013-12-20 12:41:01 -03:00
Andrew Bonventre
680df59d27 correctly log the port that the example is running on 2013-12-16 19:14:35 -05:00
Guillermo Rauch
e10ca28cc7 transports: added support for xss filters and IE11 UA
thanks @3rd-eden for bringing up ie11
2013-12-09 16:36:21 -03:00
Guillermo Rauch
430670f136 Merge pull request #1313 from tylermcginnis33/patch-1
Remove unnecessary comma from documentation
2013-12-09 08:27:02 -08:00
Guillermo Rauch
b527c7570b transports: added support for XSS filters on IE 2013-12-09 13:25:58 -03:00
Guillermo Rauch
f65966d858 Merge pull request #1220 from balupton/patch-1
Removed 0.6 from travis (no longer supported by socket.io deps), added 0.10
2013-12-09 08:16:38 -08:00
Guillermo Rauch
2f3f54fb38 updated history 2013-12-09 13:03:37 -03:00
Guillermo Rauch
f0cc5aa834 package: bump engine.io 2013-12-09 13:00:02 -03:00
Guillermo Rauch
340281152f LICENSE: update 2013-12-09 00:28:51 -03:00
Guillermo Rauch
5f247ca38e package: remove optionalDependencies 2013-12-09 00:27:45 -03:00
Jonathan Ong
24ca3a05c8 travis stuff 2013-12-01 14:27:00 -08:00
Jonathan Ong
a5631018f6 1.1.1 2013-12-01 14:24:50 -08:00
Jonathan Ong
84a9ee4ec9 fix .once adding .on to the listener 2013-12-01 14:24:28 -08:00
Jonathan Ong
039f5fbee6 Merge pull request #36 from juliangruber/patch-1
docs: Emitter#off()
2013-11-30 20:06:08 -08:00
Julian Gruber
f544102278 docs: Emitter#off() 2013-11-30 23:16:22 +01:00
binlain
9e01e245bf Use setImmediate instead of process.nextTick 2013-11-17 03:24:28 +01:00
Guillermo Rauch
605af3a9d9 .travis 2013-11-11 18:11:52 -03:00
Guillermo Rauch
8f54073666 Release 0.7.12 2013-11-11 18:09:34 -03:00
Guillermo Rauch
fead2c9f3a package: bump engine.io-client 2013-11-11 18:08:59 -03:00
amir abu shareb
a14f2e39ac add .repo prop 2013-11-06 23:49:09 +02:00
Guillermo Rauch
43f6627505 Release 0.7.11 2013-11-06 13:07:01 -03:00
Guillermo Rauch
7c56db516e package: bump engine.io-client 2013-11-06 12:44:10 -03:00
Guillermo Rauch
20adda3b6b Merge pull request #199 from mokesmokes/GH-198
fix GH-198
2013-11-06 06:57:36 -08:00
Mark Mokryn
38f2dd151d test updated 2013-10-31 14:58:53 +02:00
Mark Mokryn
2f0306d1f3 test added 2013-10-30 21:22:15 +02:00
Mark Mokryn
b4b4887f51 fix GH-198 2013-10-30 17:03:19 +02:00
Guillermo Rauch
e3692fd6e0 Release 0.7.10 2013-10-28 15:56:25 -05:00
Guillermo Rauch
ac108addd4 package: bump engine.io-client 2013-10-28 15:54:22 -05:00
Jonathan Ong
b98e1142b7 1.1.0 2013-10-20 23:03:51 -07:00
Amir Abu Shareb
7400f85e8d alias .on, .off to .addEventListener and .removeEventListener 2013-10-20 14:09:43 +03:00
Nathan Rajlich
ed9300475c Merge pull request #196 from LearnBoost/update/ws-0.4.31
package: update "ws" to v0.4.31
2013-10-16 23:28:00 -07:00
Nathan Rajlich
9aaa28b56e package: update "ws" to v0.4.31 2013-10-14 11:05:32 -07:00
Jonathan Ong
0c46bde5d1 Merge pull request #31 from btd/master
Added bower.json
2013-10-09 14:56:41 -07:00
Jonathan Ong
1590302b30 Merge pull request #29 from repoify/add/repository
Add repository field to readme
2013-10-09 14:54:59 -07:00
Denis Bardadym
2817060644 Added bower.json 2013-09-27 14:02:40 +04:00
Tyler McGinnis
cbabf0719e Remove unnecessary comma from documentation
A comma is used when there are three or more items in a series or you are separating two or more independent clauses.
2013-09-11 19:10:46 -07:00
Guillermo Rauch
9308adc822 Release 0.7.9 2013-08-30 20:26:35 -07:00
Guillermo Rauch
95457ebaa8 package: bump engine.io-client 2013-08-30 20:26:12 -07:00
Guillermo Rauch
4a32bc69b4 Release 0.7.8 2013-08-30 17:37:41 -07:00
Guillermo Rauch
cdf770cb22 package: bump engine.io-client 2013-08-30 17:36:09 -07:00
Guillermo Rauch
2902f1ea5e Merge pull request #190 from LearnBoost/update/ws
package: update "ws" to TooTallNate/ws@0cb9fe7a21a7a7c200f68b57916d1d62b...
2013-08-30 17:01:13 -07:00
Nathan Rajlich
5f3e45b4e7 package: update "ws" to TooTallNate/ws@0cb9fe7a21
Pending https://github.com/einaros/ws/pull/235
2013-08-30 16:54:04 -07:00
Guillermo Rauch
8df69de904 Release 0.7.7 2013-08-30 16:07:55 -07:00
Guillermo Rauch
47c2e4b5cf package: bump engine.io-client 2013-08-30 16:06:11 -07:00
Guillermo Rauch
c774b14da7 Release 0.7.6 2013-08-30 14:28:41 -07:00
Guillermo Rauch
1f2434b362 package: bump engine.io-client 2013-08-30 14:27:07 -07:00
Guillermo Rauch
0465ac8147 Release 0.7.5 2013-08-30 14:14:50 -07:00
Guillermo Rauch
88355ac3f5 package: bump engine.io-client 2013-08-30 14:12:13 -07:00
Guillermo Rauch
20d586ec9e Release 0.7.4 2013-08-25 14:15:13 -07:00
Guillermo Rauch
d3fb10eb7f package: bump engine.io-client 2013-08-25 14:14:53 -07:00
Guillermo Rauch
b063180406 Release 0.7.3 2013-08-23 15:50:18 -07:00
Guillermo Rauch
532997f6be package: bump engine.io-client (noop) 2013-08-23 15:47:31 -07:00
Guillermo Rauch
1e55b039b9 package: fix regresison in upgrade cause by ws update 2013-08-23 15:45:35 -07:00
Guillermo Rauch
072d6a8ed2 Release 0.7.2 2013-08-23 15:41:20 -07:00
Guillermo Rauch
68cfbff94a package: bump engine.io-client for WebSocket browser fix 2013-08-23 15:40:58 -07:00
Guillermo Rauch
6954ab3b00 Release 0.7.1 2013-08-23 14:46:08 -07:00
Guillermo Rauch
876a740119 package: bump engine.io-client for ws fix 2013-08-23 14:45:05 -07:00
Guillermo Rauch
912e93a1b7 Release 0.7.0 2013-08-23 11:09:31 -07:00
Guillermo Rauch
bfb7e38660 package: bump engine.io-client 2013-08-23 10:46:42 -07:00
Guillermo Rauch
3901c60b61 Merge pull request #189 from mahnunchik/master
updated example, engine version 0.6.3, usage component
2013-08-23 08:35:37 -07:00
Guillermo Rauch
c6226b6e82 Merge pull request #571 from quinn-ftw/patch-1
Update README.md
2013-08-22 23:19:44 -07:00
quinn-ftw
853cbce372 Update README.md
spelling fix
2013-08-22 22:22:50 -07:00
Eugeny Vlasenko
46f9203e58 updated example, engine version 0.6.3, usage component 2013-08-22 19:21:33 +07:00
Forbes Lindesay
57472b9978 add repository field to readme 2013-08-21 10:01:14 -07:00
Guillermo Rauch
433aa787b3 Merge pull request #180 from yields/master
don't use __proto__
2013-08-14 14:26:54 -07:00
Amir Abu Shareb
797b874928 inline merge 2013-08-14 18:58:01 +03:00
Guillermo Rauch
7db80a70c3 Merge pull request #187 from mahnunchik/master
added support node version 0.10 to .travis.yml
2013-08-14 08:49:08 -07:00
Eugeny Vlasenko
f1a08f7a55 added support node version 0.10 to .travis.yml 2013-08-14 18:17:24 +07:00
Guillermo Rauch
2df65ff5ee Merge pull request #186 from kkoopa/test_fix
Fixed tests. Closes #184 and #185
2013-08-13 21:01:52 -07:00
King Koopa
73794f375d Fixed respond to flash policy request test. Closes #184 2013-08-11 16:20:09 +03:00
King Koopa
2699d153e9 Fixed upgrade with timeout test. Closes #185 2013-08-11 16:10:49 +03:00
Guillermo Rauch
c5f8aed3ce Merge pull request #183 from jbowes/patch-1
Bump ws dep
2013-08-09 09:12:35 -07:00
James Bowes
55d43c59a3 Bump ws dep
ws 0.4.27 includes a number of fixes for node 0.10.x.
2013-08-09 09:13:55 -03:00
Amir Abu Shareb
4a52160119 typo 2013-07-03 15:51:46 +03:00
Amir Abu Shareb
a2fff6fcab don't use __proto__, closes #170 2013-07-03 15:48:17 +03:00
TJ Holowaychuk
b0a02583d6 fix pkg.json name 2013-06-27 08:55:16 -07:00
TJ Holowaychuk
df9d9c63dc Release 1.0.1 2013-06-27 08:53:58 -07:00
Guillermo Rauch
ee3882404f Release 0.6.3 2013-06-21 21:44:57 -07:00
Guillermo Rauch
608919d51f package: bumped engine.io-client to 0.6.3 2013-06-21 21:44:32 -07:00
Guillermo Rauch
8d0c482d1e Merge pull request #1 from sam-github/repository_in_package_json
Put git repository in package.json
2013-06-17 14:01:08 -07:00
Sam Roberts
31d95b8e0d Put git repository in package.json 2013-06-17 12:38:25 -07:00
Guillermo Rauch
5d2377b26f package: syntax 2013-06-15 17:42:55 -07:00
Guillermo Rauch
7d32f9c14c Release 0.6.2 2013-06-15 16:38:24 -07:00
Guillermo Rauch
d352ccdcda Revert "socket: clear timer after sending one noop packet (fixes #174)"
This reverts commit 752dab4c16.
2013-06-15 16:22:40 -07:00
Guillermo Rauch
1f3d7f6eb6 Revert "WebSocket setTimeout wrap when on iOS"
This reverts commit bc5ba93296.
2013-06-06 17:28:04 -07:00
Guillermo Rauch
8687ea4520 Revert "websocket:Improve send method"
This reverts commit 60c61af68e.
2013-06-06 17:27:57 -07:00
Guillermo Rauch
32b04b64a0 Release 0.6.1 2013-06-06 06:52:16 -07:00
Guillermo Rauch
c81e859abb package: bumped engine.io-client to 0.6.1 2013-06-06 06:51:49 -07:00
Guillermo Rauch
482eb164f2 package: update engine.io test dep 2013-06-01 09:27:18 -07:00
Guillermo Rauch
831a2ddcbf Release 0.6.0 2013-06-01 09:26:37 -07:00
Guillermo Rauch
752dab4c16 socket: clear timer after sending one noop packet (fixes #174) 2013-05-31 07:22:08 -07:00
Guillermo Rauch
a7697c2f92 Merge pull request #172 from Raynos/master
Clear all timers on socket clos
2013-05-27 09:59:07 -07:00
Guillermo Rauch
b07f1151e2 Merge pull request #161 from jphire/master
fix/#156 add test for calling socket.close() in payload
2013-05-27 08:53:20 -07:00
Raynos
cb578ad70e clear timers in onClose 2013-05-20 23:37:15 -07:00
Raynos
316c84eef3 Clear all timers on socket close 2013-05-20 22:14:27 -07:00
Benjamin Arthur Lupton
6a11d09590 Removed 0.6 from travis, added 0.10
Also stringified the versions as they should be, as it is a yaml file so `0.10` becomes `0.1`, so for versions we should use strings - `"0.10"` stays `0.10`
2013-04-19 12:45:47 +10:00
Guillermo Rauch
af0a4576c3 Merge pull request #160 from mjgil/bug-159-fix
adding fix for when websocket is undefined
2013-04-06 09:22:28 -07:00
Malcom Gilbert
365aaaa6cc Merge remote branch 'upstream/master' into bug-159-fix 2013-04-03 15:56:46 -04:00
Malcom Gilbert
51ede1ec38 adding test for faulty websocket request 2013-03-24 18:21:55 -04:00
Guillermo Rauch
315935484a Merge pull request #162 from mscdex/patch-1
Fix typos and use consistent capitalization
2013-03-23 20:21:14 -07:00
Brian White
6bd328e79e Fix typos and use consistent capitalization 2013-03-23 23:56:54 -03:00
Guillermo Rauch
17df993e76 Merge branch 'master' of github.com:/LearnBoost/engine.io 2013-03-23 19:36:26 -07:00
Guillermo Rauch
db297a75c1 Merge pull request #157 from albertyfwu/bug136_tests
added tests for callbacks and buffering
2013-03-23 19:35:50 -07:00
Guillermo Rauch
ccb4b9cbbe package: for travis 2013-03-23 19:24:05 -07:00
Malcom Gilbert
0280352f88 sending error on transport creation failure due to bad request 2013-03-22 17:08:37 -04:00
Janne Laukkanen
9bac4635ed fix/156 add payload socket.close() test 2013-03-22 19:37:39 +02:00
Guillermo Rauch
64f6b244b6 Merge pull request #1189 from kaosdynamics/patch-1
Fix socket.io-client repository name
2013-03-19 16:35:17 -07:00
albertyfwu
6dd979cc13 remove from tests 2013-03-19 12:12:32 -04:00
albertyfwu
237499cdfb added test for client-side buffer cleanup 2013-03-19 12:09:40 -04:00
TJ Holowaychuk
64244adbf6 mit 2013-03-18 14:39:44 -07:00
Guillermo Rauch
c19ce153f3 Merge pull request #158 from rykov/master
Add Version Badge to README
2013-03-18 14:36:54 -07:00
Michael Rykov
b6c477a29b Add Version Badge to README 2013-03-18 14:33:50 -07:00
albertyfwu
15912c22c4 changed flushComplete to flush 2013-03-17 22:18:16 -04:00
albertyfwu
671d2fe6dd changed test to listen to flushComplete 2013-03-17 21:02:54 -04:00
albertyfwu
6d51d73d14 more extensive tests for executing callbacks in order 2013-03-17 20:55:30 -04:00
albertyfwu
8c6a03d9ad changed test to test callbacks in order 2013-03-17 13:38:57 -04:00
albertyfwu
28af6bd777 added tests for callbacks and buffering 2013-03-17 12:49:30 -04:00
Guillermo Rauch
88071eeffb test: moved jsonp tests into own file 2013-03-16 20:07:51 -07:00
Guillermo Rauch
97ea40622d travis: end support for 0.6 2013-03-16 12:38:01 -07:00
Guillermo Rauch
26718d4475 Release 0.5.0 2013-03-16 12:34:52 -07:00
Guillermo Rauch
cbe8a2ef05 polling: implemented new protocol 2013-03-16 12:34:05 -07:00
Guillermo Rauch
ba82df2db5 test: clean up query string test 2013-03-16 09:20:34 -07:00
Guillermo Rauch
4cbaacb8af package: bumped engine.io-parser for flow control support 2013-03-16 09:10:45 -07:00
Guillermo Rauch
f5cf2243ec transports: implemented new parser 2013-03-16 09:10:32 -07:00
Guillermo Rauch
96249f5e8d Release 0.3.0 2013-03-16 09:08:08 -07:00
Guillermo Rauch
88094e54d2 parser: if callback returns false ignore rest of payload 2013-03-16 09:07:14 -07:00
Guillermo Rauch
8f3be371cc test: fixed all broken tests 2013-03-16 09:07:02 -07:00
Guillermo Rauch
bdaff4ef2b package: bumepd engine.io-parser 2013-03-16 09:02:01 -07:00
Guillermo Rauch
1c7031719a Release 0.2.1 2013-03-16 09:01:26 -07:00
Guillermo Rauch
60cb7aa4f9 Merge pull request #10 from albertyfwu/export_version
added protocol version to index.js
2013-03-16 09:00:26 -07:00
TJ Holowaychuk
fd7c2fa4a0 pin indexof 2013-03-15 20:12:19 -07:00
Kaos Dynamics
9ad1c2f3ac Fix socket.io-client repository name 2013-03-15 00:10:21 +01:00
Guillermo Rauch
242d02dee5 Merge pull request #1188 from MatthewMueller/master
fix install for 1.0
2013-03-13 17:57:50 -07:00
Matthew Mueller
3bd5455b1a Update package.json 2013-03-13 17:14:47 -07:00
Guillermo Rauch
82537a90cc Merge pull request #155 from albertyfwu/bug89
fixed bug89 and added tests: writeBuffer not flushed until nextTick'
2013-03-12 17:18:02 -07:00
albertyfwu
300b096000 test writeBuffer isn't cleared onError, removed 'closing' check in .flush() 2013-03-12 20:16:46 -04:00
TJ Holowaychuk
c0d1ad75e3 Merge pull request #22 from rschmukler/indexof_fix
Add indexof dependency of package.json
2013-03-12 14:50:57 -07:00
Ryan Schmukler
a338b9c170 Add indexof dependency of package.json 2013-03-12 10:05:33 -07:00
Guillermo Rauch
8913da9224 Merge pull request #21 from nulltask/fix/ie
add support for legacy ie
2013-03-12 08:04:20 -07:00
Guillermo Rauch
5a2ee6c56a Merge pull request #151 from jphire/master
#112 Figure out optimal testing strategy for JSONP
2013-03-12 07:41:10 -07:00
Guillermo Rauch
8004346659 package: bumped engine.io-client 2013-03-12 07:40:11 -07:00
albertyfwu
89de5f5975 fixed bug89 and added tests: writeBuffer not flushed until nextTick' 2013-03-12 02:59:47 -04:00
Guillermo Rauch
e027e28686 Merge pull request #154 from ysaw/issue119
Added tests for query string
2013-03-11 08:43:09 -07:00
Yihui Saw
edfec30b77 Added tests for query string 2013-03-10 22:31:39 -04:00
albertyfwu
52a5aef1e9 changed version to 0.2.0 in component.json 2013-03-05 18:02:17 -05:00
albertyfwu
a539c73ff6 changed version to 2 2013-03-05 17:44:41 -05:00
albertyfwu
ad91561a03 added comment for protocol version 2013-03-05 17:36:53 -05:00
albertyfwu
c5fc5c8dfd added protocol version to index.js 2013-03-05 17:21:24 -05:00
nulltask
8f55f63ff5 add support for legacy ie 2013-03-03 15:25:04 +09:00
TJ Holowaychuk
caf91cfc02 Merge pull request #20 from MatthewMueller/patch-2
change name back for now
2013-02-27 17:11:00 -08:00
Matthew Mueller
37269d96e5 change name back for now
based on what we discussed, you can just as easily use this in npm with:

{ "emitter" : "component/emitter" }

though it's slightly more obscure.
2013-02-27 14:06:38 -08:00
Janne Laukkanen
ee3f0cbeed added style fix for #112 2013-02-27 10:58:35 +02:00
TJ Holowaychuk
2a787907b0 history 2013-02-26 14:39:57 -08:00
TJ Holowaychuk
45d757adca typo 2013-02-26 14:39:23 -08:00
TJ Holowaychuk
9c5379b4d1 Release 1.0.0 2013-02-26 14:38:36 -08:00
TJ Holowaychuk
fac5f45e30 add .off() support. Closes #19
thought we had this already :D
2013-02-26 14:38:16 -08:00
Guillermo Rauch
89580e9c93 component: bump version 2013-02-26 11:12:28 -08:00
Guillermo Rauch
0ea79c9e11 Release 0.2.0 2013-02-26 11:11:47 -08:00
Guillermo Rauch
be5d105d4b Merge pull request #9 from albertyfwu/bug125
changed callback function to return packet, index, total; updated tests ...
2013-02-26 11:09:50 -08:00
albertyfwu
ddb500a4b2 changed protocol to return on error but not terminate early on correct packets 2013-02-26 01:47:24 -05:00
albertyfwu
6da1bee9e4 changed callback function to return packet, index, total; updated tests correspondingly 2013-02-24 22:18:41 -05:00
Janne Laukkanen
17e3e52582 added tests for JSONP transport and a --globals flag in Makefile 2013-02-25 01:48:58 +02:00
Guillermo Rauch
7cc56a51a8 package: bumped engine.io 2013-02-22 10:55:26 -08:00
Guillermo Rauch
6afdd8ce14 Added travis badge 2013-02-22 09:02:39 -08:00
Guillermo Rauch
3482f08690 Merge pull request #8 from sweetieSong/add/decodePayload-Callback
Add/decode payload callback
2013-02-22 09:01:35 -08:00
Sweet Song
fc6a6b3f4d parse.js: Added isLast statements to decPayload tests 2013-02-22 11:55:58 -05:00
Sweet Song
8f0b43d400 index.js: Added return so as to not continue after encountering an error
parser.js: Added test case and corrected types of
2013-02-22 11:29:34 -05:00
Sweet Song
b21493325a index.js: replaced return [err] with callback
parser.js: replaced error return expects
2013-02-22 10:58:07 -05:00
Sweet Song
dc063040d2 index.js: Only return on error
parser.js: removed assertions to arrays

remove NOTE
2013-02-18 23:08:52 -05:00
Sweet Song
560e8cc0e6 index.js: Added initial version of callback
test.js: Added in callback function

NOTE: there might be a bug in the index decodePayload function, I will continue to look into it
2013-02-16 14:34:37 -05:00
Guillermo Rauch
0450cc42cd Release 0.4.3 2013-02-08 12:11:07 -08:00
Guillermo Rauch
ce28c9300f package: bumped engine.io-client to 0.4.3 2013-02-08 12:10:48 -08:00
Guillermo Rauch
81e599b344 Release 0.4.2 2013-02-08 11:12:15 -08:00
Guillermo Rauch
1059147fa3 Merge pull request #141 from pokermania/to_learnboost_20130130
close socket if upgrade is received and socket.readyState != open
2013-02-08 08:17:08 -08:00
Guillermo Rauch
59281c0e56 Merge pull request #145 from st3redstripe/spelling
Fix spelling errors
2013-02-08 07:53:37 -08:00
stephen-bradshaw
f2bc5190b4 fix spelling errors 2013-02-08 09:27:52 +00:00
Guillermo Rauch
1d7157622e Merge pull request #144 from shtylman/fix-multiple-paths
Only end upgrade socket connections if unhandled
2013-01-31 19:44:14 -08:00
Roman Shtylman
fd36eeaf02 Only end upgrade socket connections if unhandled
This fixes an issue where multiple engine.io instances (on different
paths) would result in the closing of websocket connections for all of
the instances. This happened because each engine.io instance would
register an `upgrade` handler on the server. This handler would check
for a matching path and otherwise call `socket.end()` Since multiple
upgrade events would be triggered with different paths, the peer
handlers would close each other.

This patch resolves this behavior in the following way:
- When an instance upgrade handler encounters a path which it does not
  recognize it creates a timeout for `destroyUpgradeTimeout`.
- At the end of the timeout, the socket is checked for writable state
  and bytes written. If there has been not activity and the socket is
  writable, then it will be ended.

This allows for peer socket handlers to keep the socket alive by sending
some data over it. This also mimics the core node behavior of closing
sockets on upgrade when no handler is specified. We consider not
handling an upgrade request similar to no handler. However, we cannot
immediately end the socket for the reasons noted above.

fixes #143
2013-01-31 22:42:11 -05:00
Guillermo Rauch
150d2bfb0c Merge pull request #142 from shtylman/fix-package-deps
fix websocket dependency
2013-01-30 15:02:18 -08:00
Roman Shtylman
ee475f10f2 fix websocket dependency
listing the dependency in dev dependencies clobbers the actual
dependency
2013-01-30 17:25:56 -05:00
Andor Goetzendorff
4ef40991be close socket if upgrade is received and socket.readyState != open 2013-01-30 16:57:44 +01:00
Guillermo Rauch
1ff3a1d239 Readme: added clarification 2013-01-28 07:59:13 -08:00
Guillermo Rauch
0d5200ed69 Readme: fix 2013-01-28 07:53:30 -08:00
Guillermo Rauch
abf798e2bb Readme: note 2013-01-28 07:51:55 -08:00
Guillermo Rauch
2102eb4bb3 Readme: added listen to examples 2013-01-28 07:51:14 -08:00
Guillermo Rauch
0d718b4a9c Release 0.4.1 2013-01-27 10:25:47 -08:00
Guillermo Rauch
86c0b9e186 package: buped engine.io-parser 2013-01-26 09:00:49 -08:00
Guillermo Rauch
9d3b235743 Release 0.1.1 2013-01-26 08:59:14 -08:00
Guillermo Rauch
03c8c353c4 Merge pull request #137 from sweetieSong/ExtractParser
Extract parser
2013-01-26 08:57:00 -08:00
Guillermo Rauch
4b3b526578 Merge pull request #6 from ss2249/SetUp
index.js: Added in
2013-01-19 14:54:41 -08:00
Sweet
6f890ab8a0 removed the lib-cov 2013-01-19 14:49:00 -08:00
Sweet
b69264dad9 Removed the lib/index in all the files 2013-01-19 14:27:17 -08:00
Sweet
fe36cae750 index.js: Added in
package.json: added the repo
2013-01-19 14:24:10 -08:00
Sweet
82ef6b416c Adding .tracis.yml for first build 2013-01-19 13:25:18 -08:00
Sweet
90c0cd0e3f parser.js: deleted
package.json: updated the version for the client
everything else: fixed paths/requirements to the new protocol/parser repo
2013-01-19 13:14:00 -08:00
Sweet
dd5a4cb939 Merge branch 'master' of github.com:LearnBoost/engine.io into ExstractParser
Conflicts:
	package.json
2013-01-19 12:37:37 -08:00
Sweet
face92f018 paerse.js: modified parser to be used with the parser repo
package.json: updated with the correct parser dependency
common.js: changed the parser path
server.js: also changed the parser path
2013-01-19 12:25:31 -08:00
Guillermo Rauch
bd0940ad8b Release 0.1.0 2013-01-19 11:48:27 -08:00
Guillermo Rauch
851890c07c Merge pull request #136 from xixixao/master
package:add git repo url
2013-01-19 11:20:58 -08:00
Michal Srb
782bf6505a package:add git repo url 2013-01-19 18:57:25 +00:00
Michal Srb
ac120a16ed Merge remote-tracking branch 'upstream/master' 2013-01-19 18:40:44 +00:00
Michal Srb
6c479b36e5 Merge remote-tracking branch 'origin/master' 2013-01-19 18:40:13 +00:00
Guillermo Rauch
1c68636575 Merge pull request #134 from xixixao/master
WebSocket setTimeout wrap when on iOS
2013-01-19 10:36:13 -08:00
Guillermo Rauch
9011a0e0d4 Merge pull request #135 from xixixao/fix/119
Fixed should trigger ping timeout test
2013-01-19 10:26:37 -08:00
Guillermo Rauch
9092b2419e Merge pull request #5 from ss2249/SetUp
Set up
2013-01-19 10:25:24 -08:00
Sweet
fa8c737233 .gitignore: Added the node_module directory
component.json: Changed the version number, removed dependencies, and added the keys.js
package.json: Added the keys.js in script
2013-01-19 10:21:25 -08:00
Michal Srb
86366e86a5 Fixed should trigger ping timeout test 2013-01-19 18:20:25 +00:00
Michal Srb
60c61af68e websocket:Improve send method 2013-01-19 18:15:32 +00:00
Sweet
bf63fe6224 changes to package.json for version 2013-01-19 09:57:07 -08:00
Michal Srb
ef6d89b3d5 Fixed should trigger ping timeout test 2013-01-19 17:45:13 +00:00
Michal Srb
bc5ba93296 WebSocket setTimeout wrap when on iOS 2013-01-19 04:26:03 +00:00
Sweet
03f32eaceb adding travis 2013-01-18 18:37:37 -08:00
Sweet
8bb00c8edf testing up basic parser 2013-01-18 17:35:40 -08:00
Guillermo Rauch
0b9d9c4efa Merge pull request #133 from xixixao/master
Bump up version in package
2013-01-18 15:53:09 -08:00
Michal Srb
8f0f586934 package: bumped versions 2013-01-18 23:48:06 +00:00
Guillermo Rauch
7ac254d6f3 Initial commit 2013-01-18 15:18:25 -08:00
Guillermo Rauch
a103bd5e19 Merge pull request #132 from roamm/send_packet_callback
Fixed bugs in the previous send callback fix and added new test cases
2013-01-16 10:38:33 -08:00
roam
148f654c92 Fixed bugs in previous send callback fix and updated test cases 2013-01-16 17:31:42 +08:00
roam
72861f3d49 Added a test case which makes the code before the send callback fix fail 2013-01-16 15:13:50 +08:00
roam
06b39687eb Fixed send callback test failures 2013-01-16 14:35:56 +08:00
roam
41ee77e3c6 Revert "Revert "Fixed packet send callback design issue""
This reverts commit ead08d6e5b.
2013-01-15 17:17:47 +08:00
TJ Holowaychuk
57ccc30408 add node aliases 2013-01-08 13:11:15 -08:00
Guillermo Rauch
ead08d6e5b Revert "Fixed packet send callback design issue"
This reverts commit 0dfa68c710.
2012-12-26 17:19:41 -03:00
Guillermo Rauch
3c968fcb55 Merge pull request #130 from roamm/packet_send_callback
Fixed packet send callback issues
2012-12-26 12:15:06 -08:00
Guillermo Rauch
c3a04f704b manager: fix reconnect attempts start 2012-12-24 20:39:28 -03:00
Guillermo Rauch
558f8b2626 socket: improve keeping track of connected state 2012-12-24 19:51:17 -03:00
Guillermo Rauch
a2f172995c manager: keep count of connected clients to close underlying transport 2012-12-24 19:51:01 -03:00
Guillermo Rauch
cef1583a64 test: middleware tests 2012-12-24 19:50:49 -03:00
Guillermo Rauch
5f843feb90 namespace: make sure not to fire connection if underlying client closed after next is called from a middleware 2012-12-24 19:50:25 -03:00
Guillermo Rauch
01a06b2b62 Makefile: change slow param 2012-12-24 19:50:13 -03:00
Guillermo Rauch
46d069b3cc test: added room tracking test 2012-12-24 15:07:23 -03:00
Guillermo Rauch
708af3f803 README: renamed joined to rooms 2012-12-24 15:07:13 -03:00
Guillermo Rauch
0881dfbdce socket: rename joined to rooms 2012-12-24 15:07:04 -03:00
Guillermo Rauch
c54011b6a1 Readme: document Namespace#connected 2012-12-23 23:25:17 -03:00
Guillermo Rauch
f605b365b4 test: added broadcasting / namespace emit tests 2012-12-23 23:24:35 -03:00
Guillermo Rauch
1ec766799f test: fix helper to take options 2012-12-23 23:24:19 -03:00
Guillermo Rauch
67f7d5749b adapter: initial memory impl 2012-12-23 23:23:05 -03:00
Guillermo Rauch
95d8e7531c socket: keep track of socket in connected hash 2012-12-23 23:21:50 -03:00
Guillermo Rauch
2e71357221 socket: added leaveAll 2012-12-23 23:21:37 -03:00
Guillermo Rauch
ef96e3b07f socket: added leave 2012-12-23 23:21:18 -03:00
Guillermo Rauch
6046c385b9 socket: added join 2012-12-23 23:21:07 -03:00
Guillermo Rauch
e8d11924aa socket: added in 2012-12-23 23:20:58 -03:00
Guillermo Rauch
eb0213882f socket: fix emit 2012-12-23 23:20:46 -03:00
Guillermo Rauch
de8e746959 socket: rooms and flags are now hashes 2012-12-23 23:20:26 -03:00
Guillermo Rauch
dc173330e5 socket: fix flags 2012-12-23 23:20:13 -03:00
Guillermo Rauch
d65635d212 socket: rename rooms to joined 2012-12-23 23:20:03 -03:00
Guillermo Rauch
dd0fd539e6 namespace: fix emit 2012-12-23 23:19:05 -03:00
Guillermo Rauch
5d4f90de47 namespace: make in able to track multiple rooms 2012-12-23 23:18:48 -03:00
Guillermo Rauch
59c8c34ceb namespace: fix flags 2012-12-23 23:18:38 -03:00
Guillermo Rauch
bcfec6df76 namespace: added connected hash 2012-12-23 23:18:26 -03:00
Guillermo Rauch
dbba592dfa namespace: implement own flags 2012-12-23 23:18:14 -03:00
Guillermo Rauch
d411dec5a4 index: rename adaptor to adapter 2012-12-23 23:18:01 -03:00
Guillermo Rauch
ab5a226f3e README: rename Adaptor to Adapter 2012-12-23 23:17:48 -03:00
roam
0dfa68c710 Fixed packet send callback design issue
There were two issues here.
1. When Socket.send called with or without callback alternately,
   the trigger order is incorrect.
2. The 'drain' event from transport is one per packet for transports
   supporting framing like websocket and is all in one for those without
   framing like polling.
2012-12-20 00:49:32 +08:00
Guillermo Rauch
a92e8349f0 Release 1.0.3 2012-12-19 00:29:19 -03:00
Guillermo Rauch
fb857bd8b4 index: added Server#adaptor 2012-12-18 18:09:41 -03:00
Guillermo Rauch
2e5fdb65bd README: improved getters/setters docs and added Adaptor section 2012-12-18 18:07:30 -03:00
Guillermo Rauch
b4f12ea2f9 README: document Socket#rooms 2012-12-18 18:02:28 -03:00
Guillermo Rauch
902373196e socket: added broadcast flag 2012-12-18 17:28:14 -03:00
Guillermo Rauch
ae516a3f06 test: added args + callback events tests 2012-12-18 17:27:22 -03:00
Guillermo Rauch
ecf937c775 test: style 2012-12-18 17:27:09 -03:00
Guillermo Rauch
d1def44858 test: added event ack tests 2012-12-18 17:23:53 -03:00
Guillermo Rauch
7ff88f80a3 socket: fix Socket#ack 2012-12-18 17:22:50 -03:00
Guillermo Rauch
1b98649bc4 socket: style 2012-12-18 17:22:14 -03:00
Guillermo Rauch
381bc4260a socket: forgot this js oddity that you can access objects with strings or numbers 2012-12-18 17:20:20 -03:00
Guillermo Rauch
8a5cb03fcb socket: fix Socket#ack 2012-12-18 17:20:01 -03:00
Guillermo Rauch
22c91d8e49 socket: allow for falsy packet.id 2012-12-18 17:19:36 -03:00
Guillermo Rauch
344323a314 index: make sure decoded id is a Number 2012-12-18 17:16:05 -03:00
Guillermo Rauch
53dae5c6fc index: added instrumentation through debug 2012-12-18 17:09:33 -03:00
Guillermo Rauch
bd37a9a34b socket: protect against __proto__ deletion 2012-12-18 17:00:44 -03:00
Guillermo Rauch
f19131bfb0 Release 1.0.2 2012-12-18 16:31:38 -03:00
Guillermo Rauch
2fa98fb61a package: bumped socket.io-parser 2012-12-18 15:50:14 -03:00
Guillermo Rauch
68c2e389bb *: bumped socket.io-protocol 2012-12-18 15:49:42 -03:00
Guillermo Rauch
da048ee1bd index: allow for falsy values in id and data 2012-12-18 15:44:23 -03:00
Guillermo Rauch
6b3cdd7c9c test: added test for event emitting with send 2012-12-18 15:25:56 -03:00
Guillermo Rauch
3038ce5526 test: added event emitting test 2012-12-18 15:24:24 -03:00
Guillermo Rauch
a0020bcb2c socket: fix event packet 2012-12-18 15:22:16 -03:00
Guillermo Rauch
c929f8c7fb test: added socket event reception test 2012-12-18 15:18:26 -03:00
Guillermo Rauch
1d8a747773 test: added socket#send test 2012-12-18 15:15:42 -03:00
Guillermo Rauch
56ed3fbe75 socket: fixed packet handling 2012-12-18 15:15:12 -03:00
Guillermo Rauch
8138a4d070 socket: fix event packet encoding 2012-12-18 15:13:04 -03:00
Guillermo Rauch
bea30df54a socket: fix send message unshifting 2012-12-18 15:11:53 -03:00
Guillermo Rauch
169046e026 test: added disconncet(true) test 2012-12-18 14:58:09 -03:00
Guillermo Rauch
56221bc093 socket: attempt to send disconnect packets prior to closing the transport
this will prevent reconnection from triggering
2012-12-18 14:57:37 -03:00
Guillermo Rauch
5da04cd1a9 socket: fixed EventEmitter inheritance 2012-12-18 14:57:23 -03:00
Guillermo Rauch
342845d5c2 socket: added missing acks initialization 2012-12-18 14:56:58 -03:00
Guillermo Rauch
97b63b0860 namespace: blacklist newListener event 2012-12-18 14:56:44 -03:00
Guillermo Rauch
12d1dca7ca socket: added more blacklisted events 2012-12-18 14:56:24 -03:00
Guillermo Rauch
3a259d420c namespace: improve middleware logic 2012-12-18 14:55:58 -03:00
Guillermo Rauch
19837a0f86 client: added disconnect method 2012-12-18 14:55:42 -03:00
Guillermo Rauch
3feb98a346 client: removed extra line 2012-12-17 15:26:04 -03:00
Guillermo Rauch
a8ea0f4fb0 socket: added Emitter mixin 2012-12-17 14:36:24 -03:00
Guillermo Rauch
8eb209e0cc socket: send connect packet upon open 2012-12-17 14:27:34 -03:00
Guillermo Rauch
bccc6d1ddd socket: fix packet method 2012-12-17 14:27:19 -03:00
Guillermo Rauch
df3b994242 manager: added packet method to write to engine socket 2012-12-17 14:27:07 -03:00
Guillermo Rauch
1609eaa4e5 index: added second parameter to of optional 2012-12-17 14:25:55 -03:00
Guillermo Rauch
e724e7bdf6 test: added test for of second parameter 2012-12-17 14:25:40 -03:00
Guillermo Rauch
06e7df4eb2 test: added multiplexing tests 2012-12-17 12:45:26 -03:00
Guillermo Rauch
28a19bfb43 test: added second parameter to helper to aid w testing namespaces 2012-12-17 12:45:13 -03:00
Guillermo Rauch
deefa7bbb9 client: style 2012-12-17 09:58:34 -03:00
Guillermo Rauch
9d9fe9e2e2 socket: emit data event (synonym with message) 2012-12-17 09:57:54 -03:00
Guillermo Rauch
bfd019c2f3 Readme: described Socket and Client classes 2012-12-17 09:36:11 -03:00
Guillermo Rauch
198798acab README: document events 2012-12-17 09:06:48 -03:00
Guillermo Rauch
3335e3fe94 manager: let a connect timeout fire error event logic 2012-12-17 09:06:28 -03:00
Guillermo Rauch
755cead37c Readme: document namespace events 2012-12-17 09:01:45 -03:00
Guillermo Rauch
01e73669f9 test: added connect namespace event test 2012-12-17 09:00:17 -03:00
Guillermo Rauch
35a607fac8 README: added travis build status 2012-12-17 08:52:36 -03:00
Guillermo Rauch
5022b06242 Readme: added build status 2012-12-17 08:52:00 -03:00
Guillermo Rauch
95ded5d885 engine.io: style 2012-12-17 08:45:14 -03:00
Guillermo Rauch
adf51b0b03 Makefile: added build, build.js removal to clean task 2012-12-17 08:44:52 -03:00
Guillermo Rauch
78ea878c1f gitignore: added build.js 2012-12-17 08:44:40 -03:00
Guillermo Rauch
80d236e35d Makefile: cleanup build.js file 2012-12-17 08:44:04 -03:00
Guillermo Rauch
337e9a285e build 2012-12-17 08:43:33 -03:00
Guillermo Rauch
6b0d0ed7c1 Makefile: added echo 2012-12-17 08:43:20 -03:00
Guillermo Rauch
3afe5e3032 test: added basic namespace tests 2012-12-17 08:43:03 -03:00
Guillermo Rauch
4315732220 index: added missing on method 2012-12-17 08:39:12 -03:00
Guillermo Rauch
fcd969b1be index: fix style 2012-12-17 08:39:02 -03:00
Guillermo Rauch
6db3fdcf52 index: fixed multiplexing id lookup 2012-12-17 08:38:04 -03:00
Guillermo Rauch
881f284ff5 socket: remove reconnecting event 2012-12-17 08:37:10 -03:00
Guillermo Rauch
c67d2d5494 namespace: instrument add 2012-12-17 08:29:43 -03:00
Guillermo Rauch
4f0fce34f5 index: fix client url 2012-12-17 08:29:25 -03:00
Guillermo Rauch
31adf5e45e lib: fixed static server binding 2012-12-17 01:10:03 -03:00
Guillermo Rauch
3063241eba test: fixed test for engine.io attachment 2012-12-17 01:09:50 -03:00
Guillermo Rauch
3b65a9f011 index: feel static server attachment order 2012-12-17 00:46:54 -03:00
Guillermo Rauch
f1e2af3d91 test: added client creation helper 2012-12-17 00:18:39 -03:00
Guillermo Rauch
70ce641d85 namespace: fix run call 2012-12-16 23:50:46 -03:00
Guillermo Rauch
c87a530b08 index: remove client event 2012-12-16 23:50:39 -03:00
Guillermo Rauch
12f1821f1c socket: added Socket#write 2012-12-16 23:35:42 -03:00
Guillermo Rauch
fc65ed630a index: override path with /socket.io 2012-12-16 21:36:04 -03:00
Guillermo Rauch
b0046b6c4b test: adapted url tests with new simplifications 2012-12-16 21:22:03 -03:00
Guillermo Rauch
f5d6ff56d7 url: moar simplifications 2012-12-16 21:14:44 -03:00
Guillermo Rauch
0c6b0b4111 url: simplify by no longer accepting object 2012-12-16 21:13:29 -03:00
Guillermo Rauch
446680e3f9 index: simplify by only accepting strings 2012-12-16 21:12:36 -03:00
Guillermo Rauch
1a95f15695 url: remove nsp 2012-12-16 21:12:22 -03:00
Guillermo Rauch
dba6f18bdd manager: only accept a string as first parameter 2012-12-16 21:07:43 -03:00
Guillermo Rauch
efd26bf991 index: pass string uri 2012-12-16 21:07:27 -03:00
Guillermo Rauch
01e06d7a4f engine.io: cleanup 2012-12-16 20:35:54 -03:00
Guillermo Rauch
c59bb42e85 engine.io: deprecated resource 2012-12-16 20:25:08 -03:00
Guillermo Rauch
4e82aaff87 url: allow port in combination with host 2012-12-16 20:03:54 -03:00
Guillermo Rauch
9cc22171de manager: fixed disconnect 2012-12-16 19:45:23 -03:00
Guillermo Rauch
d574b7c0db manager: nicer? cleanup impl 2012-12-16 19:45:13 -03:00
Guillermo Rauch
1583c712b0 manager: implemented on 2012-12-16 19:41:35 -03:00
Guillermo Rauch
f4c7eb619a socket: implemented on 2012-12-16 19:41:22 -03:00
Guillermo Rauch
169ba2b94d on: added helper
should make its own component
2012-12-16 19:41:07 -03:00
Guillermo Rauch
07afc2e8fb manager: implemented on 2012-12-16 19:38:56 -03:00
Guillermo Rauch
137d87b375 manager: prevent socket function override 2012-12-16 19:38:25 -03:00
Guillermo Rauch
b711dd9889 manager: added missing module.exports 2012-12-16 19:38:15 -03:00
Guillermo Rauch
068b044017 manager: added on dep 2012-12-16 19:38:07 -03:00
Guillermo Rauch
8d75aed8f9 emitter: remove on override 2012-12-16 19:32:34 -03:00
Guillermo Rauch
98e939a2ea test: remove emitter tests 2012-12-16 19:32:19 -03:00
Guillermo Rauch
b7415ae618 index: fixed url dep 2012-12-16 19:25:53 -03:00
Guillermo Rauch
98c4bb6955 test: fixed style 2012-12-16 19:13:02 -03:00
Guillermo Rauch
6d0b1a5117 test: basic namespaces tests 2012-12-16 19:12:03 -03:00
Guillermo Rauch
cb806c0d4e test: attachment and client serving tests 2012-12-16 18:58:17 -03:00
Guillermo Rauch
eb029808f5 Readme: muuuch nice readme <3 2012-12-16 18:58:00 -03:00
Guillermo Rauch
2615aa45e7 index: add warning about passing a function to attach 2012-12-16 18:53:46 -03:00
Guillermo Rauch
f6370c1635 index: removed middleware attachment possibility 2012-12-16 18:50:42 -03:00
Guillermo Rauch
73c772d0b3 Revert "engine.io: added middleware attachment possibility (eg: for express)"
This reverts commit 7b3243dbea.
2012-12-16 18:49:06 -03:00
Guillermo Rauch
4ecbf2a46e index: fix event listener override 2012-12-16 18:37:57 -03:00
Guillermo Rauch
c3d5024496 index: fix port binding 2012-12-16 18:37:46 -03:00
Guillermo Rauch
9c2224cca0 index: api cleanup 2012-12-14 10:07:07 -03:00
Guillermo Rauch
c695065c7a dox 2012-12-14 10:06:52 -03:00
Guillermo Rauch
ac9cb14733 manager: simplify API 2012-12-14 09:45:24 -03:00
Guillermo Rauch
44da490467 index: renamed client to static for clarity 2012-12-14 09:27:55 -03:00
Guillermo Rauch
8901efd085 package: added supertest 2012-12-14 09:18:44 -03:00
Guillermo Rauch
1e68a83bd3 index: fix send implementation 2012-12-14 09:18:34 -03:00
Guillermo Rauch
4ea334899f package: added client dep and superagent 2012-12-13 16:39:10 -03:00
Guillermo Rauch
5f397464a9 client: added static files 2012-12-13 16:38:58 -03:00
Guillermo Rauch
373c66f1ee index: added client serving with send 2012-12-13 16:38:23 -03:00
Guillermo Rauch
be99036ebc package: bumped versions 2012-12-13 12:30:41 -03:00
Guillermo Rauch
c10a9ae6a0 test: adapted version checking for 0.4 2012-12-13 12:30:26 -03:00
Guillermo Rauch
7b3243dbea engine.io: added middleware attachment possibility (eg: for express) 2012-12-13 12:29:37 -03:00
Guillermo Rauch
bec38c2ce1 index: move this to engine.io 2012-12-13 12:20:56 -03:00
Guillermo Rauch
b6a4899689 initial 1.0 commit 2012-12-13 12:14:54 -03:00
Guillermo Rauch
3c03ba36c8 package: added back keywords 2012-12-13 11:05:56 -03:00
Guillermo Rauch
95fcd9c657 package: added back contributors 2012-12-13 11:05:11 -03:00
Guillermo Rauch
3af1ad982c Merge branch 'master' of github.com:LearnBoost/socket.io 2012-12-13 10:54:19 -03:00
Guillermo Rauch
7d205214f0 socket: added onack instrumentation 2012-12-13 10:52:12 -03:00
Guillermo Rauch
3bcdba0b4c socket: fixed event emitting instrumentation 2012-12-13 10:46:06 -03:00
Guillermo Rauch
a6820e3a0d socket: improved style 2012-12-13 10:35:32 -03:00
Guillermo Rauch
2301884730 url: support for io() 2012-12-13 10:12:19 -03:00
Guillermo Rauch
19e8048ec5 socket: don't emit open and close 2012-12-13 10:05:46 -03:00
Guillermo Rauch
d523a25cc0 socket: emit events after connect fires 2012-12-13 10:05:09 -03:00
Guillermo Rauch
0ce8934eed socket: turn acks into an object 2012-12-13 08:51:16 -03:00
Guillermo Rauch
8daa71302d Merge tag '0.9.12'
Release 0.9.12

Conflicts:
	package.json
2012-12-13 08:48:05 -03:00
Guillermo Rauch
60a17801f9 socket: do not remove event name from args 2012-12-13 08:47:05 -03:00
Guillermo Rauch
b2a8ed1421 Release 0.9.12 2012-12-13 08:19:16 -03:00
Guillermo Rauch
0d3313f536 manager: fix for latest node which is returning a clone with listeners [viirya] 2012-12-13 08:18:42 -03:00
Guillermo Rauch
1a27ddb583 socket: make events public for plugins to extend 2012-12-13 08:12:28 -03:00
Guillermo Rauch
fcd4f6acfc Merge pull request #1078 from stouset/master
Fix operator precedence bug
2012-12-11 09:42:23 -08:00
Guillermo Rauch
94fbce919a *: make debug dep a * 2012-12-10 18:35:17 -03:00
Guillermo Rauch
1932c156dc component: fix depedencies 2012-12-10 18:33:42 -03:00
Guillermo Rauch
c049fc8f89 package: added uglify-js 2012-12-10 18:32:32 -03:00
Guillermo Rauch
4108387a05 Makefile: default to build 2012-12-10 18:32:06 -03:00
Guillermo Rauch
510538813d url: finished module with tests 2012-12-10 18:31:54 -03:00
Guillermo Rauch
f324fca41d Release 1.0.1 2012-12-10 17:37:18 -03:00
Guillermo Rauch
456b65a8ae Release 1.0.1 2012-12-10 17:34:24 -03:00
Guillermo Rauch
a0c6f36f94 index: fix source exposure 2012-12-10 14:28:44 -03:00
TJ Holowaychuk
7063b6f07d screw npm 2012-12-10 08:47:20 -08:00
Guillermo Rauch
d5652feadc 1.0 client initial commit 2012-12-10 03:31:57 -03:00
Guillermo Rauch
74e5b62029 *: fix version 2012-12-09 21:05:29 -03:00
Guillermo Rauch
c44b059749 Readme: improve 2012-12-09 20:29:31 -03:00
Guillermo Rauch
8fae6bf6b6 *: travis 2012-12-09 20:28:40 -03:00
Guillermo Rauch
38cb105b62 *: initial component 2012-12-09 20:25:37 -03:00
Guillermo Rauch
7e0cdcad42 Merge pull request #128 from Raynos/patch-1
`npm docs engine.io` works now
2012-12-07 02:15:49 -08:00
Raynos
aad92df830 Update package.json 2012-12-06 21:50:30 -08:00
Raynos
640b760f58 npm docs engine.io works now 2012-12-06 21:49:56 -08:00
Guillermo Rauch
ebc1bebefa Merge pull request #126 from venportman/patch-1
Update README.md
2012-12-04 19:20:57 -08:00
ven
d336a12228 Update README.md
fixed spelling error 'chaning' > 'changing'
2012-12-04 22:04:06 -05:00
Guillermo Rauch
94f082be0c Release 0.3.10 2012-12-03 09:09:33 -03:00
Guillermo Rauch
96902f54a5 package: bumped engine.io-client with close fixes 2012-12-03 09:07:24 -03:00
Guillermo Rauch
58ff8991d0 Merge branch 'master' of github.com:/LearnBoost/engine.io 2012-12-03 08:34:55 -03:00
Guillermo Rauch
80036cc50f Merge pull request #1082 from shapeshed/master
Fix leaking message:id, disconnect:id
2012-11-27 20:45:46 -08:00
Guillermo Rauch
373eadf7e1 Merge pull request #1086 from sampsasaarela/master
Fixed bug in symbian anna
2012-11-20 02:06:01 -08:00
Sampsa Saarela
ef54570313 Changed content-type in response header from text/plain to application/javascript because some browsers force file download (eg. symbian anna) 2012-11-20 11:53:01 +02:00
George Ornbo
6256f569b3 fix leaking message:id, disconnect:id #1081 #1064 #862 2012-11-12 13:11:23 +00:00
Guillermo Rauch
63f1838364 Merge pull request #491 from adityab/amd-unsupport
Don't try to support AMD loaders in socket.io
2012-11-10 10:17:18 -08:00
Guillermo Rauch
472b3f15b1 Merge pull request #121 from Jxck/master
add pakcet, packetCreate document to README
2012-11-10 10:16:57 -08:00
Jxck
fe59f275d8 Merge branch 'master' of github.com:Jxck/engine.io 2012-11-10 22:46:34 +09:00
Jxck
8b549b622f add pakcet, packetCreate document to README 2012-11-10 22:45:26 +09:00
Jxck
d206381347 add pakcet, packetCreate document to README 2012-11-10 22:41:15 +09:00
Stephen Touset
cd4dee7257 Respect operator precedence 2012-11-09 17:49:40 -08:00
Aditya Bhatt
b5585aa09a Don't try to support AMD loaders, it breaks things globally. 2012-11-09 18:09:04 +05:30
Guillermo Rauch
3bafecd882 Merge branch 'master' of github.com:/LearnBoost/engine.io 2012-11-06 08:25:07 -08:00
upbot
5ff0c1976a Merge pull request #120 from Jxck/master
createPacket event
2012-11-06 08:21:12 -08:00
Jxck
b4d60687ac add packetCreate event for #99 2012-11-06 20:34:10 +09:00
Guillermo Rauch
ec9334dc03 Merge pull request #114 from Jxck/master
refuctoring test which fales depends on timing
2012-11-05 08:09:00 -08:00
Jxck
dabc50b011 refuctoring test
this test dosen't pass in some timing in my machine.
so make it not to depends on timeout.
2012-11-06 00:50:34 +09:00
Guillermo Rauch
ee1eacf638 Merge pull request #109 from indutny/feature-visible-verification-failure
server: send validation failure reason to clients
2012-11-05 07:26:43 -08:00
Guillermo Rauch
95f0614626 Merge pull request #113 from Jxck/master
#99 `packet` event
2012-11-05 06:57:15 -08:00
Jxck
46f310462b add packet event to socket 2012-11-05 21:33:02 +09:00
Guillermo Rauch
971199d19b engine.io: some cleanup 2012-11-04 09:20:47 -08:00
Guillermo Rauch
92df7872f3 examples: updated client to 0.3.8 (fixes #108) 2012-11-04 09:16:17 -08:00
Guillermo Rauch
a3798f3f15 Merge branch 'master' of github.com:/LearnBoost/engine.io 2012-11-04 09:12:51 -08:00
Guillermo Rauch
13e06795ac transports: remove Connection headers and let node handle it (fixes #111) 2012-11-04 09:11:39 -08:00
Guillermo Rauch
3b7224c7e0 Release 0.9.11 2012-11-02 08:03:15 -07:00
Guillermo Rauch
4bf6f14a51 Release 0.9.11 2012-11-02 08:02:52 -07:00
Guillermo Rauch
2030cf1432 package: move redis to optionalDependenices [3rd-Eden] 2012-11-02 08:01:24 -07:00
Guillermo Rauch
110d7c4535 Release 0.9.11 2012-11-02 08:00:24 -07:00
Guillermo Rauch
7537e2543f transports: removed headers that are set by node from htmlfile [stbuehler] 2012-11-01 17:52:51 -07:00
Guillermo Rauch
e00913aae0 transports: fixed xhr-polling 2012-11-01 17:51:59 -07:00
Guillermo Rauch
dbabf20faa transports: fix for Connection: close [stbuehler] (fixes #406) 2012-11-01 17:14:06 -07:00
Fedor Indutny
bb1f860239 server: send validation failure reason to clients 2012-11-01 00:35:49 +04:00
Guillermo Rauch
72b32827f4 Merge pull request #107 from ruxkor/patch-1
invoking as a function causes attach, refs #104
2012-10-29 05:43:31 -07:00
Andor Goetzendorff
7f08ee3f50 invoking as a function causes attach, refs #104 2012-10-29 13:40:07 +01:00
Guillermo Rauch
82b16fa490 Merge pull request #105 from kapouer/patch-1
Socket.flush: reset writeBuffer before send
2012-10-29 05:18:43 -07:00
Guillermo Rauch
4de65523d9 Merge pull request #1061 from shripadk/master
Fix: Remove socket session from child processes on disconnect
2012-10-27 18:24:33 -07:00
Shripad K
7cca186bb1 fix: remove socket session from child processes in cluster on disconnect 2012-10-28 05:45:21 +05:30
Lal Jérémy
bbe3d95513 Socket.flush: reset writeBuffer before send
This prevents legacy node versions from calling Socket.flush before it
could reset writeBuffer, leading to double-flush.
2012-10-24 23:32:23 +03:00
Guillermo Rauch
5fc9785af0 package: fix whitespace 2012-10-23 14:00:00 -07:00
Guillermo Rauch
e4c1cb0727 Release 0.3.9 2012-10-23 13:30:27 -07:00
Guillermo Rauch
5e38123fdb package: bumped engine.io-client 2012-10-23 13:30:11 -07:00
Guillermo Rauch
81fc3018a6 Release 0.3.8 2012-10-23 11:20:31 -07:00
Guillermo Rauch
35d0f98bb5 package: bumped engine.io-client 2012-10-23 11:19:43 -07:00
Guillermo Rauch
c82f8888ec examples: moar ie fixes 2012-10-21 11:43:37 -07:00
Guillermo Rauch
66f91efcfc public: support IE8<= 2012-10-21 11:31:02 -07:00
Guillermo Rauch
fb1993c4df public: fix disconnection message 2012-10-21 11:05:52 -07:00
Guillermo Rauch
62e7771ee2 public: testing out new engine.io-client 2012-10-21 11:03:14 -07:00
Guillermo Rauch
338f547bbe index: introduce process.env.PORT support 2012-10-21 10:55:34 -07:00
Guillermo Rauch
7db43e93c1 public: added copy of engine.io client 2012-10-21 10:55:16 -07:00
Guillermo Rauch
0a0c62c5a0 package: use fixed engine.io versions 2012-10-21 10:54:57 -07:00
Guillermo Rauch
d7332db2f1 examples: added first example 2012-10-21 10:46:40 -07:00
Guillermo Rauch
3447ae2cad *: remove unused runner 2012-10-21 09:56:55 -07:00
Guillermo Rauch
df7c8ed58d Release 0.3.7 2012-10-21 09:35:43 -07:00
Guillermo Rauch
9263034bd8 package: bumped engine.io-client 2012-10-21 09:33:39 -07:00
Guillermo Rauch
3a8e3a3cc2 test: added test to avoid out-of-date client version 2012-10-21 09:32:28 -07:00
Guillermo Rauch
4f0f811001 test: make sure the many messages test has the right timeout config 2012-10-21 09:21:58 -07:00
Guillermo Rauch
1aa47406fd test: improve ping timeout tests 2012-10-21 09:16:44 -07:00
Guillermo Rauch
33c5806864 test: make client ping timeout test more reliable 2012-10-21 09:10:23 -07:00
Guillermo Rauch
30ac9f7aa9 Merge pull request #101 from devinrhode2/patch-1
broken link
2012-10-18 18:16:15 -07:00
Devin Rhode
1c57fdc237 broken link 2012-10-18 09:36:44 -07:00
Guillermo Rauch
687acf6fa8 Merge pull request #100 from c9/descriptor
added contributor
2012-10-16 14:49:23 -07:00
cadorn
936436bc43 added contributor 2012-10-16 14:47:01 -07:00
Guillermo Rauch
1fb41d8662 Merge pull request #98 from indutny/feature-heartbeat-on-data
socket: reset ping timeout on incoming data
2012-10-16 09:47:24 -07:00
Fedor Indutny
be7b4e7478 socket: reset ping timeout on incoming data 2012-10-16 23:39:57 +07:00
Guillermo Rauch
f8bc8c81e8 Merge pull request #96 from c9/prio-flush
FAILING mass data test
2012-10-15 18:01:42 -07:00
cadorn
6a8a77a65e remove console.log 2012-10-15 17:29:36 -07:00
cadorn
c4bf8edf43 mass data test 2012-10-15 17:11:27 -07:00
Guillermo Rauch
b924c6a4af Release 0.3.5 2012-10-14 13:07:08 -07:00
Guillermo Rauch
e696f95f35 package: reverted last commit - we use the parser from the client 2012-10-14 13:06:40 -07:00
Guillermo Rauch
74c020c45a Release 0.3.4 2012-10-14 12:54:43 -07:00
Guillermo Rauch
a7871359ef package: engine.io-client moved to devDependencies 2012-10-14 12:54:02 -07:00
Guillermo Rauch
689644247c socket: added missing jsdoc (gross) 2012-10-11 12:43:36 -07:00
Guillermo Rauch
5856c2c831 Release 0.3.3 2012-10-10 14:49:40 -07:00
Guillermo Rauch
47b908f20a Merge pull request #93 from joewalnes/master
Slow upgrade should not take down server.
2012-10-10 14:45:18 -07:00
Joe Walnes
61d4c1a7b5 Slow upgrade should not take down server.
I noticed this on very heavily overloaded server - the typos raises an uncaught exception.
2012-10-10 16:44:37 -05:00
Guillermo Rauch
f0c7097738 transports: improved instrumentation 2012-10-08 17:22:33 -07:00
TJ Holowaychuk
3d5b12b113 Release 0.0.6 2012-10-08 17:03:16 -07:00
TJ Holowaychuk
183adc1ceb docs 2012-10-08 17:02:54 -07:00
TJ Holowaychuk
c3fc7f5aa8 add this._callbacks initialization to prevent funky gotcha 2012-10-08 17:00:09 -07:00
Guillermo Rauch
2c7128f8b4 Release 0.3.2 2012-10-08 15:47:30 -07:00
Guillermo Rauch
1c96ca4fe8 socket: improve check interval for upgrade 2012-10-08 15:41:13 -07:00
Guillermo Rauch
9b3d8a6acd Release 0.3.1 2012-10-08 13:49:18 -07:00
Guillermo Rauch
17c657957e socket: faster upgrades (we perform a check immediately) 2012-10-08 13:47:50 -07:00
Guillermo Rauch
092576990a test: fixed tests not passing with node-xmlhttprequest 1.5.0 2012-10-07 17:33:26 -07:00
Guillermo Rauch
537fc62d8f server: don't assume sid is numeric 2012-10-06 19:56:36 -07:00
Guillermo Rauch
a5d590ddb9 Release 0.3.0 2012-10-04 10:29:53 -07:00
Guillermo Rauch
d32c9c1a80 test: fixed style 2012-10-04 09:21:09 -07:00
Guillermo Rauch
dc8ceca3d1 test: clean up common 2012-10-04 09:07:37 -07:00
Guillermo Rauch
2f806d35b4 Merge pull request #84 from c9/better-pings2
Better pings 2
2012-10-04 08:41:27 -07:00
Guillermo Rauch
2d9ffc364d Merge pull request #471 from jugglinmike/node-xhr
Enable use of 'xhr' transport in Node.js
2012-10-04 08:09:23 -07:00
Mike Pennisi
d37e3ec808 Enable use of 'xhr' transport in Node.js
Normally, Socket.io chooses the "ideal" transport in Node.js:
WebSockets. This behavior can lead to unrealistic stress test results
because real-world loads will not be comprised of 100% WebSocket
connections.

The XHR transport itself is fully functional in Node. The transport
check currently fails only because `location` is not defined in the
global scope. By guarding the access of `global.location.protocol`, the
`XHR.check` method can correctly return `true` in Node.

Note that this will **not** change the default behavior in Node clients
to choose the "best available" transport. It only enables the use of a
fully-functional transport when requested.
2012-09-26 18:04:34 -04:00
Guillermo Rauch
00d40c3747 Merge pull request #90 from danzajdband/master
query instead of send get parameters in test/server.js tests.
2012-09-21 11:44:07 -07:00
Dan Zajdband
3344ac4ed9 query instead of send get parameters in test/server.js tests. It was breaking tests 2012-09-21 15:44:07 -03:00
Guillermo Rauch
ec07fa8308 Merge pull request #1031 from secobarbital/master
Fixed global variable leak
2012-09-15 13:46:03 -07:00
Seggy Umboh
f5c32c1490 Fixed global leak 2012-09-14 18:48:49 -07:00
Guillermo Rauch
8e407f0323 Merge pull request #470 from dymsza/master
Make the xhr-polling more stable
2012-09-14 15:09:36 -07:00
tomek
ec8402cdae fix the problem with disconnecting xhr-polling users 2012-09-14 12:09:09 -07:00
Guillermo Rauch
2e4cfb5288 Merge pull request #86 from fjakobs/patch-1
directly load the parser module
2012-09-14 03:33:48 -07:00
Fabian Jakobs
f08c158c3e directly load the parser module
I have to problems with `module.exports = require('engine.io-client').parser;`

1. It loads more than is needed
2. It loads the JSONP transport client, which creates a global
2012-09-14 10:57:32 +03:00
cadorn
16650233d9 ping from client 2012-09-12 16:12:46 -07:00
cadorn
0b9f7809bc changes for #78 2012-09-12 13:17:48 -07:00
Guillermo Rauch
ca9bbf930e Merge pull request #83 from nicokaiser/base64id
Moved generateId into an external module
2012-09-11 03:19:39 -07:00
Nico Kaiser
587cb14972 Moved generateId into an external module
see f7d40d5f7b
2012-09-11 12:17:04 +02:00
TJ Holowaychuk
d4919f183f add mixin warning 2012-09-10 20:15:42 -07:00
Guillermo Rauch
c3ba8a722b Merge pull request #1008 from faeldt/master
Increase performance of generateId by avoiding sync calls to crypto.randomBytes
2012-09-10 15:06:40 -07:00
Guillermo Rauch
781d51926e Merge pull request #75 from afshinm/master
remove unnecessary spacing, fix code styling in tests
2012-09-10 12:04:56 -07:00
Afshin Mehrabani
dd3440ced7 rebase with master 2012-09-10 21:01:20 +04:30
Guillermo Rauch
2ba9fa8a89 Merge pull request #80 from LearnBoost/fix/jsonp-escaping
polling-jsonp: prevent client breakage with utf8 whitespace
2012-09-09 17:55:11 -07:00
Guillermo Rauch
7eda4f0ec2 polling-jsonp: prevent client breakage with utf8 whitespace 2012-09-09 17:49:20 -07:00
Guillermo Rauch
88e24feb98 README: documented debug (fixes #77) 2012-09-09 17:36:17 -07:00
Guillermo Rauch
70b328f844 Merge pull request #1026 from jmatthewsr-ms/master
Websocket: Accept a PONG
2012-09-08 21:05:00 -07:00
Justin Matthews
32a44a3b5d Websocket: accept a pong (IE10 sends them) 2012-09-08 20:08:37 -07:00
Guillermo Rauch
4e78ece7b7 Merge pull request #453 from sfilatov/master
Make client compatible with AMD loaders. Issue #338
2012-09-08 19:41:09 -07:00
TJ Holowaychuk
bfb335c3c8 Release 0.0.5 2012-09-07 14:33:42 -07:00
TJ Holowaychuk
2c6aa090f4 fix Emitter.call(this) usage 2012-09-07 14:32:52 -07:00
Guillermo Rauch
c23ddb2bff Merge pull request #1022 from 3rd-Eden/master
Move redis
2012-09-07 13:38:36 -07:00
3rd-Eden
f7f219d6dd Move redis to the devDependencies, don't depend on redis as it's not a core component
to run Socket.IO.
2012-09-07 15:32:09 +02:00
Kristian Faeldt
f7d40d5f7b Moved generateId into an external module 2012-09-07 19:48:21 +09:00
Guillermo Rauch
c906e5800e Revert "test: tweaked timers that were making tests not pass on mountain lion"
This reverts commit fefb643c4a.
2012-09-06 11:55:58 -07:00
Guillermo Rauch
d624dea5b9 README: undocumented path 2012-09-06 11:55:37 -07:00
TJ Holowaychuk
c4df699d38 Release 0.0.4 2012-09-05 22:08:58 -07:00
TJ Holowaychuk
5d25dd6011 add mixin docs 2012-09-05 22:08:48 -07:00
TJ Holowaychuk
88fb716e4e Merge branch 'master' of github.com:component/emitter 2012-09-05 22:07:33 -07:00
TJ Holowaychuk
b251af60b6 add mixin support via Emitter(obj). Closes #5 2012-09-05 22:07:23 -07:00
TJ Holowaychuk
03c7823144 fix install docs 2012-09-05 21:52:02 -07:00
Afshin Mehrabani
a318a30ced fix code styling, bad indentation 2012-09-05 00:58:33 +04:30
Guillermo Rauch
fefb643c4a test: tweaked timers that were making tests not pass on mountain lion 2012-09-04 12:08:19 -07:00
Guillermo Rauch
95303cb3f3 test: fixed test for clearing callback references 2012-09-04 12:06:57 -07:00
Guillermo Rauch
eeacea93ff test: fix style, removed test that's not passing 2012-09-04 12:06:41 -07:00
Guillermo Rauch
a99251d38a Merge pull request #74 from afshinm/patch-1
Adding Afshin Mehrabani to contributors
2012-09-04 11:23:12 -07:00
Afshin Mehrabani
029746a4c8 Adding Afshin Mehrabani to contributors 2012-09-04 22:52:24 +04:30
Guillermo Rauch
f493172331 README: documented send callback 2012-09-04 11:16:27 -07:00
Guillermo Rauch
414a24c1e6 Merge branch 'master' of github.com:/LearnBoost/engine.io 2012-09-04 11:14:07 -07:00
Guillermo Rauch
18da616730 README: simplified client constructor example 2012-09-04 11:13:47 -07:00
Guillermo Rauch
6b725eb349 Merge pull request #71 from afshinm/master
add `send` callback feature
2012-09-04 11:12:22 -07:00
Afshin Mehrabani
b7ac48941e fix double \n 2012-09-04 22:40:46 +04:30
Afshin Mehrabani
8af0e2a253 two new test for send callback
in this new tests we assert that:
1- when socket get closed and one or more packet(s) are in writeBuffer,
callback references get cleaned to avoid memory leak.
2- callbacks still execute in polling mode
2012-09-04 21:32:25 +04:30
Guillermo Rauch
41c2ba36f2 Merge pull request #466 from joaojeronimo/master
Add should to devDependencies in package.json
2012-09-02 13:46:05 -07:00
João Jerónimo
3f822af002 add should to devDependencies 2012-09-01 02:27:53 +01:00
Guillermo Rauch
32eae5f53b Merge pull request #465 from SteveSanderson/master
Support connecting to socket.io from inside a Windows 8 client app (one-line tweak)
2012-08-30 07:55:00 -07:00
Steve Sanderson
a3d95883f5 Prefer XmlHttpRequest if CORS is available
This makes socket.io.js work on Windows 8 client applications by
default, since:
* Win8 apps are hosted in IE10, which supports CORS, and allows them
across protocols
* XDomainRequest won't work, as Win8 apps are hosted on a special
protocol ("ms-appx:") and XDomainRequest disallows cross-protocol
requests
2012-08-30 11:54:49 +01:00
Kristian Faeldt
da91c89147 Only fall back when no bytes available, not when threshold is reached 2012-08-28 19:15:55 +09:00
Kristian Faeldt
a10e963858 Added getRandomBytes to improve generateId performance 2012-08-28 18:56:11 +09:00
Guillermo Rauch
5427d2056c Release 0.2.2 2012-08-26 18:39:54 -07:00
Guillermo Rauch
b70eb526fc Merge pull request #72 from LearnBoost/remove/flash-policy-buffering
Remove/flash policy buffering
2012-08-26 18:18:20 -07:00
Guillermo Rauch
2c61e40537 test: removed flash policy buffering test
- it was a false positive (it was all being written in one packet despite
  the callback).
- node will discard subsequent packets anyways as they're not a valid
  request. we can only hope(?) that flash's request comes all in one packet
2012-08-26 18:14:01 -07:00
Guillermo Rauch
79af5e17cc server: remove buffering from handleSocket 2012-08-26 18:13:49 -07:00
Guillermo Rauch
d1cbdfff77 server: applied new coding style 2012-08-26 18:13:39 -07:00
Afshin Mehrabani
37c91fc822 fix tests + code styling 2012-08-26 19:32:59 +04:30
Afshin Mehrabani
837ba76477 add new test
test the callback while polling
2012-08-26 00:42:21 +04:30
Afshin Mehrabani
7f483042d4 styling problem 2012-08-25 22:04:58 +04:30
Afshin Mehrabani
f9423c2143 unneeded change 2012-08-25 22:02:53 +04:30
Afshin Mehrabani
7959e0a05b change in conditions 2012-08-25 21:58:14 +04:30
Afshin Mehrabani
175a3f003e fix styling problem 2012-08-25 21:52:34 +04:30
Afshin Mehrabani
934d323c66 fix .gitignore problem 2012-08-25 21:51:08 +04:30
Afshin Mehrabani
1e3a0ef614 fix styling problem 2012-08-25 21:47:22 +04:30
Afshin Mehrabani
148a10209a Revert "fix style problem"
This reverts commit 514e728433.
2012-08-25 21:45:16 +04:30
Afshin Mehrabani
514e728433 fix style problem 2012-08-25 21:42:29 +04:30
Afshin Mehrabani
2125d0bfd9 rollback .gitignore 2012-08-25 21:38:38 +04:30
Afshin Mehrabani
893a9f3700 remove send callback 2012-08-25 21:33:23 +04:30
Afshin Mehrabani
51f110f64f remove unneeded changes 2012-08-25 21:26:23 +04:30
Afshin Mehrabani
c81cf614e1 fix code style problems, remove unnecessary clearing 2012-08-25 21:09:21 +04:30
Afshin Mehrabani
8f4d6f9e13 remove unnecessary sequence id & drain emit parameter 2012-08-24 04:01:36 +04:30
Guillermo Rauch
21a3733dec Merge pull request #1001 from crazyrobot/patch-1
Redis Store: removed unneeded module ('assert')
2012-08-22 16:28:28 -07:00
Itai
4a6890898a Redis Store: removed unneeded module ('assert')
It's not used anywhere in the file and the test file (test/stores.redis.test.js) uses the 'should' module.
I'm assuming this is a leftover.
2012-08-23 02:27:03 +03:00
Guillermo Rauch
2e57cd0c44 Merge branch 'master' of github.com:/LearnBoost/engine.io 2012-08-22 10:25:24 -07:00
Guillermo Rauch
b48efb3f45 transport: avoid unhandled error events for stale transports (fixes #69) 2012-08-22 10:25:03 -07:00
Afshin Mehrabani
23004e8b6e fix code styling issues 2012-08-21 00:23:14 +04:30
Afshin Mehrabani
ab4393fbd8 fix indentation 2012-08-20 23:21:35 +04:30
Afshin Mehrabani
9073a07323 change transports send & flush functions 2012-08-20 12:20:58 +04:30
Afshin Mehrabani
d5dff2dd62 change comment 2012-08-20 12:18:22 +04:30
Afshin Mehrabani
347639b117 add new send callback tests 2012-08-20 12:16:33 +04:30
Afshin Mehrabani
cb02a97d0c add sequence id, change websocket send function 2012-08-18 12:14:17 +04:30
Afshin Mehrabani
1434eaf78f add send callback tests + a little change in function 2012-08-15 22:27:03 +04:30
Guillermo Rauch
818ca2cdc6 Merge pull request #462 from pgherveou/strict-comma
fix missing semi-colons
2012-08-14 09:04:31 -07:00
PG
3d791a45aa fix missing commas 2012-08-14 15:27:10 +02:00
Guillermo Rauch
beefb8d64a Merge pull request #66 from EugenDueck/patch-2
Adding myself to list of contributors
2012-08-13 18:00:20 -07:00
EugenDueck
337e4f23af Adding myself to list of contributors
And added guille as the author - don't want it to look like I'm responsible for all the bugs ;)
2012-08-14 09:58:35 +09:00
Guillermo Rauch
ab2a0b6a8b test: removed protocolVersion private api from tests 2012-08-13 16:14:28 -07:00
Guillermo Rauch
c797d2a9fb *: added ws dependency 2012-08-13 16:14:15 -07:00
Guillermo Rauch
d558c97089 transport: rewrite websocket transport to use ws client 2012-08-13 16:14:03 -07:00
Guillermo Rauch
b483dfcce9 test: removed old transports tests 2012-08-13 16:13:51 -07:00
Guillermo Rauch
f59e8aceaa manager: implemented ws 2012-08-13 16:13:38 -07:00
Guillermo Rauch
90bf61fe7b Merge pull request #65 from EugenDueck/patch-1
Document that toString() is performed on the message argument
2012-08-13 14:53:20 -07:00
EugenDueck
d262459d39 Document that toString() is performed on the message argument
This is what engine.io in fact already (implicitly) does, so I can give it any object I want, and it will send what `message.toString()` returns.

This allows me to implement transparent caching of the JSONified string, speeding up broadcast and multicast messages.
2012-08-14 06:49:07 +09:00
Guillermo Rauch
7b4cb7013e test: adapted test for EventEmitter update 2012-08-13 14:02:01 -07:00
Guillermo Rauch
1ea3681917 Release 0.2.1 2012-08-13 12:06:54 -07:00
Guillermo Rauch
67117d94f5 Merge pull request #64 from LearnBoost/improve/http-framing
Improve/http framing
2012-08-13 11:57:27 -07:00
Guillermo Rauch
16449ec6ca polling-xhr: skip Keep-Alive when it's implied 2012-08-13 11:51:12 -07:00
Guillermo Rauch
c165b6b465 polling-jsonp: skip Keep-Alive when it's implied [EugenDuck] 2012-08-13 11:49:18 -07:00
Afshin Mehrabani
5d846e1794 fix sample 2012-08-13 22:36:37 +04:30
Afshin Mehrabani
634b11af71 add send callback
issue #57
2012-08-13 22:34:50 +04:30
Guillermo Rauch
c7d391ec24 Merge pull request #61 from EugenDueck/patch-2
Added description for engine.io-conflation plugin
2012-08-12 14:48:10 -07:00
EugenDueck
658b5a6a93 Added description for engine.io-conflation plugin 2012-08-13 06:19:49 +09:00
Guillermo Rauch
d4cb313551 README: plugins list (cc @EugenDueck) 2012-08-12 11:20:03 -07:00
Guillermo Rauch
de9e8dffe1 Release 0.9.10 2012-08-10 13:34:50 -07:00
Guillermo Rauch
5ab8b620f2 Release 0.9.10 2012-08-10 13:30:49 -07:00
Guillermo Rauch
4479c9d9cd socket: disable disconnect on unload by default 2012-08-10 13:29:36 -07:00
Guillermo Rauch
0af4e54e6f Merge pull request #58 from LearnBoost/add/flush-drain
Add/flush drain
2012-08-10 10:46:29 -07:00
Guillermo Rauch
81a6e76426 test: added flush/drain events tests 2012-08-10 10:46:00 -07:00
Guillermo Rauch
b948f858fb socket: fix flush event parameter 2012-08-10 10:45:48 -07:00
Guillermo Rauch
271585189f socket: added flush/drain events (fixes #56) 2012-08-10 10:39:09 -07:00
Guillermo Rauch
834cbcf7a5 README: added flush/drain docs 2012-08-10 10:39:00 -07:00
Guillermo Rauch
3a3044ebba Merge pull request #972 from Coreh/express-3.x-readme
Add express 3.0 instructions on Readme.md
2012-08-10 10:17:55 -07:00
Guillermo Rauch
d10b4dd1bd Merge pull request #985 from GICodeWarrior/log-case-fix
Don't lowercase log messages
2012-08-08 18:03:57 -07:00
Rusty Burchfield
12beee2d63 Don't lowercase log messages
Lowercasing log messages is unnecessary.  It makes some messages difficult to
read, and others difficult to search for.
2012-08-08 11:32:57 -07:00
Guillermo Rauch
fbda7e1c3e Merge pull request #458 from yhpark/master
Fixed removeAllListeners to behave expected
2012-08-08 09:34:11 -07:00
Younghoon Park
fe6b50dd17 fix removeAllListeners to behave as expected 2012-08-08 21:22:30 +09:00
Guillermo Rauch
8085e399bf Update README.md 2012-08-07 17:45:33 -07:00
Guillermo Rauch
96c528430a Merge pull request #457 from neino3/xdomain-withcredentials
Fix to set withCredentials property to ture only if xdomain
2012-08-07 15:03:17 -07:00
neino3
335e8b2244 set withCredentials to ture only if xdomain 2012-08-08 06:14:32 +09:00
Guillermo Rauch
875f14d16b Revert "Fix infinite recursion in Websocket parsers."
This reverts commit c218468f67.
2012-08-07 13:18:41 -07:00
Guillermo Rauch
078fff8991 Merge pull request #51 from LearnBoost/fix/ws-connection-to-bad-transport
Fix/ws connection to bad transport
2012-08-06 16:33:17 -07:00
Guillermo Rauch
827875f481 sense: this makes more
This way all transports have a consistent constructor.
2012-08-06 16:28:12 -07:00
Guillermo Rauch
eb3822c825 websocket: expose handlesUpgrade flag 2012-08-06 16:27:17 -07:00
Guillermo Rauch
24e19fceee server: avoid passing websocket to non-websocket transports (fixes #24) 2012-08-06 16:24:44 -07:00
Guillermo Rauch
79d76b6aa2 Merge pull request #50 from LearnBoost/add/connection-close-tests
test: added `Connection: close` test.
2012-08-06 15:09:47 -07:00
Guillermo Rauch
02573b0652 test: added Connection: close test. 2012-08-06 15:08:43 -07:00
Guillermo Rauch
8ca8990a0c Merge pull request #983 from GICodeWarrior/parser-recursion
Fix infinite recursion in Websocket parsers.
2012-08-06 13:16:37 -07:00
Guillermo Rauch
23e6d751c9 Release 0.2.0 2012-08-06 13:11:18 -07:00
Rusty Burchfield
c218468f67 Fix infinite recursion in Websocket parsers.
If a client is feeding messages faster than server can handle them, infinite
recursion occurs.  Basically, the "overflow" data gets added to the parser and
it immediately parses a new message.

The fix pushes the processing of the next message (in this edge case) onto the
event queue.  This prevents the stack from recursing indefinitely.  This also
prevents a fast client from starving other clients.
2012-08-06 13:03:51 -07:00
Guillermo Rauch
7676213d46 Merge pull request #49 from LearnBoost/add/connection-close-detection
test: added closing connection test
2012-08-06 11:54:23 -07:00
Guillermo Rauch
1d580fef07 test: added closing connection test 2012-08-06 11:51:35 -07:00
Guillermo Rauch
93d8c8dc55 Merge pull request #48 from LearnBoost/improve/id-generation
Improve/id generation
2012-08-06 09:19:22 -07:00
Guillermo Rauch
fb522c46fa test: updated tests 2012-08-06 09:18:39 -07:00
Guillermo Rauch
44fd1b97a1 server: implemented stronger id generator with collision detection 2012-08-06 09:17:11 -07:00
Guillermo Rauch
4164e3bd7e Merge pull request #981 from doozr/honour-flash-settings
Honour flash settings
2012-08-06 08:59:17 -07:00
Guillermo Rauch
46227e7ac9 Merge pull request #980 from doozr/jsonp-error-crash
Always set the HTTP response in case an error should be returned to the client
2012-08-06 08:58:57 -07:00
Craig Andrews
d723d363b2 Always set the HTTP response in case an error should be returned to the client 2012-08-06 14:16:06 +01:00
Craig Andrews
fa1c1b2ada Create or destroy the flash policy server on configuration change 2012-08-06 14:14:15 +01:00
Craig Andrews
d32a848c3f Honour configuration to disable flash policy server 2012-08-06 14:14:14 +01:00
Guillermo Rauch
b0a1c34b49 Release 0.1.2 2012-08-02 17:07:23 -07:00
Guillermo Rauch
4ce21b0d14 Merge pull request #44 from LearnBoost/fix/jsonp-content-type
polling: changed text/plain to text/html (fixes #43)
2012-08-02 17:01:45 -07:00
Guillermo Rauch
26ffa48f0d polling: changed text/plain to text/html (fixes #43) 2012-08-02 17:00:06 -07:00
TJ Holowaychuk
01f83655a8 add component.json 2012-08-01 21:51:51 -07:00
Guillermo Rauch
a2663e8240 Release 0.1.1 2012-08-01 17:34:33 -07:00
Guillermo Rauch
4ff3419df0 Merge pull request #38 from LearnBoost/change/ws-impl
Change/ws impl
2012-08-01 16:32:43 -07:00
Guillermo Rauch
5a8cc19219 *: added ws dep 2012-08-01 16:10:40 -07:00
Guillermo Rauch
a86e1aeba1 server: added failing test courtesy of Contra 2012-08-01 16:10:28 -07:00
Guillermo Rauch
a80c76fa37 websocket: do error handling for each ws write 2012-08-01 16:09:45 -07:00
Guillermo Rauch
25b48dd152 server: replaced websocket.io with ws, now that it supports older drafts 2012-08-01 16:09:21 -07:00
Guillermo Rauch
48ad0d3d1d Release 0.9.9 2012-08-01 15:14:02 -07:00
Guillermo Rauch
d8351e60fd Release 0.9.9 2012-08-01 15:11:48 -07:00
Guillermo Rauch
cffb4ebdbd socket: fixed disconnect xhr url and made it actually sync 2012-08-01 15:10:24 -07:00
Guillermo Rauch
281a467960 manager: added response to sync disconnect xhrs 2012-08-01 15:08:06 -07:00
Guillermo Rauch
46a4b9ff9f Build 2012-08-01 13:48:54 -07:00
Guillermo Rauch
b5c7d6e486 Merge branch 'master' of github.com:LearnBoost/socket.io-client 2012-08-01 12:02:51 -07:00
Guillermo Rauch
34d15a7d56 xhr-polling: style 2012-08-01 12:02:31 -07:00
Guillermo Rauch
d841b3e5e5 Merge pull request #454 from nateps/master
Don't try to reconnect after receiving a 403 authorization error
2012-08-01 12:00:18 -07:00
Guillermo Rauch
1fa74a46a3 Revert "Fix disconnectSync getting ignored"
This reverts commit f48b40e134.
2012-08-01 11:58:28 -07:00
Guillermo Rauch
0679af04d4 *: bump xmlhttprequest dep 2012-08-01 11:55:44 -07:00
Guillermo Rauch
a22688470d socket: fixed force disconnect URI 2012-08-01 11:53:29 -07:00
Guillermo Rauch
ca4e3f32a3 Merge pull request #975 from huancz/master
fix issue #961 - restore compatibility with earlier node releases (up to 0.4.x)
2012-07-31 08:34:22 -07:00
Guillermo Rauch
9dd8134e6a Merge pull request #970 from renier/master
Codebase needs a license file (#965)
2012-07-31 08:32:07 -07:00
Renier Morales
180f1c91b9 Put license text in its own file (#965) 2012-07-31 11:07:21 -04:00
Marco Aurélio
bddf652c25 Add express 3.0 instructions on Readme.md 2012-07-30 15:53:47 -03:00
Guillermo Rauch
c795e4cf1a Merge pull request #971 from Coreh/express-3.x-warn
Add warning to .listen() to ease the migration to Express 3.x
2012-07-30 11:49:53 -07:00
Marco Aurélio
6afbb34581 Add warning to .listen() to ease the migration to Express 3.x 2012-07-30 15:43:00 -03:00
nateps
225e86f333 Don't try to reconnect after receiving a 403 authorization error 2012-07-27 16:58:29 -07:00
Guillermo Rauch
ac39dbc721 Merge pull request #964 from crickeys/xhr_polling_disconnectSync
Fix disconnectSync getting ignored
2012-07-27 10:06:03 -07:00
Stepan Filatov
f5d55ba2c1 Make client compatible with AMD loaders. Issue #338. 2012-07-27 20:46:55 +04:00
Stepan Filatov
85df087ced Make client compatible with AMD loaders. Issue #338. 2012-07-27 20:41:31 +04:00
Petr Běhan
a5c5c20438 restore compatibility with node 0.4.x 2012-07-27 15:38:57 +02:00
Brian Gruber
f48b40e134 Fix disconnectSync getting ignored
If using xhr-polling and a browser closes a tab or window, the
disconnectSync in the socket.io-client method is called which sends an
XHR request to the server indicating a disconnect. This line would cause
that to be ignored and so the server would have to wait for a timeout to
mark them as disconnect. This was possibly because it was sent from a
different tcp socket than the current connection.
2012-07-26 21:19:00 -05:00
Guillermo Rauch
fb6a4d5329 Merge pull request #438 from ycarmel/master
Fix issues around fallback mechanism and xhr-polling heartbeat
2012-07-25 17:36:59 -07:00
Guillermo Rauch
1679fd564c Release 0.9.8 2012-07-24 17:36:30 -07:00
Guillermo Rauch
494d87db67 Release 0.9.8 2012-07-24 17:35:39 -07:00
Guillermo Rauch
bb900d445a Release 0.9.7 2012-07-24 11:16:20 -07:00
Guillermo Rauch
ccd816f07f Release 0.9.7 2012-07-24 10:58:21 -07:00
Guillermo Rauch
49ac184cd1 jsonp-polling: fixed open check 2012-07-24 10:55:52 -07:00
Guillermo Rauch
bf76f927b1 xhr-polling: fixed open check 2012-07-24 10:54:55 -07:00
Guillermo Rauch
21dd18626b Release 0.9.7 2012-07-24 10:53:14 -07:00
Guillermo Rauch
0ae824e768 socket: fn check no longer needed 2012-07-24 10:50:35 -07:00
Guillermo Rauch
dc9dbb75fb Merge branch 'master' of github.com:LearnBoost/socket.io-client
Conflicts:
	dist/socket.io.min.js
2012-07-24 10:48:52 -07:00
Guillermo Rauch
d81b06b342 Release 0.9.7 2012-07-24 10:47:53 -07:00
Guillermo Rauch
d8923ee2af transport: fix potential open collision 2012-07-24 10:47:03 -07:00
Guillermo Rauch
c6fed55f53 tests: fixed tests for 0.8 2012-07-24 10:39:23 -07:00
Guillermo Rauch
6adebc85fc Merge pull request #958 from xaroth8088/master
Prevent crash when socket leaves a room twice.
2012-07-22 11:26:21 -07:00
xaroth8088
7a087bcc94 Prevent crash when socket leaves a room twice. 2012-07-22 11:09:06 -07:00
Guillermo Rauch
18422183c8 Merge pull request #957 from xaroth8088/master
Corrects unsafe usage of for..in, permitting socket.io to be used in environments that extend Object, etc.
2012-07-21 11:44:28 -07:00
xaroth8088
aeb904f58b Corrects unsafe usage of for..in, permitting socket.io to be used in environments where Object, Function, etc. have been extended.
http://yuiblog.com/blog/2006/09/26/for-in-intrigue/
2012-07-21 11:30:15 -07:00
xaroth8088
9c0b9de7f0 Revert "Corrects unsafe usage of for..in, permitting socket.io to be used in environments that extend Object, etc."
This reverts commit 81552c11ca.
2012-07-21 11:21:11 -07:00
xaroth8088
81552c11ca Corrects unsafe usage of for..in, permitting socket.io to be used in environments that extend Object, etc.
http://yuiblog.com/blog/2006/09/26/for-in-intrigue/
2012-07-21 10:29:20 -07:00
Guillermo Rauch
f90a919848 Merge pull request #452 from crickeys/bug/xhr_ie
Properly formats disconnectSync URI and sends it
2012-07-19 21:33:39 -07:00
Brian Gruber
888e9008e5 Properly formats disconnectSync URI and sends it
Also, fixes an issue if using https AND InternetExplorer on crossdomain
sites. In these cases the use of XDomainRequest was not working because
it relied on checks to see if the protocols matched or not. For some
reason, paramaters weren't being passed around and so these checks
failed incorrectly.
2012-07-19 23:17:58 -05:00
Guillermo Rauch
7eb043714c Merge pull request #34 from bionicbrian/master
'ws' in Example C in README appears to be a typo? Should be 'engine'?
2012-07-16 11:26:36 -07:00
Brian Moore
a671072c06 change 'ws' to 'engine' in README C example 2012-07-16 11:23:47 -07:00
TJ Holowaychuk
19e192dd41 Release 0.0.3 2012-07-11 20:02:41 -07:00
TJ Holowaychuk
d23e2ad533 add docs for .listeners(event) 2012-07-11 20:02:02 -07:00
TJ Holowaychuk
bcb45a5817 change .has to .hasListeners
as per guillermo request, which makes sense! inheriting
from emitter and then overriding .has with your own thing
could potentially suck
2012-07-11 20:01:40 -07:00
Guillermo Rauch
e1fe76aebe Fix for node 0.8 with gzip compression. Thanks @vadimi 2012-07-09 16:58:02 -07:00
Guillermo Rauch
4d5cc77ea5 Merge pull request #421 from TutoringAustralasia/manual_buffer_flushing
Adding support for manual buffer flushing
2012-07-09 08:42:15 -07:00
Guillermo Rauch
a7f6efeb80 Merge pull request #32 from 3rd-Eden/patch-1
Added the correct location of the SPEC file
2012-07-06 11:45:11 -07:00
Arnout Kazemier
cbe261f009 Added the correct location of the SPEC file 2012-07-06 15:04:56 +03:00
Guillermo Rauch
f220104618 Release 0.1.0 2012-07-03 15:35:21 -07:00
Guillermo Rauch
21f3e7033a Adapted test to new API 2012-07-03 14:20:16 -07:00
Guillermo Rauch
2edf01dd2c Added thorough cookie tests. 2012-07-03 14:20:05 -07:00
Guillermo Rauch
1c0a3e69ad Removed engine version test. 2012-07-03 14:19:49 -07:00
Guillermo Rauch
c754f549f7 Added transport headers Set-Cookie injection 2012-07-03 14:19:28 -07:00
Guillermo Rauch
2ce2138de4 Added handshake request to polling transports. 2012-07-03 14:18:46 -07:00
Guillermo Rauch
f3e867a2a8 Added headers event to transports. 2012-07-03 14:18:32 -07:00
Guillermo Rauch
45d07bc816 Introduced Transport#request 2012-07-03 14:18:09 -07:00
Guillermo Rauch
73cf06cc34 Added accessor to transport handshake request 2012-07-03 14:17:17 -07:00
Guillermo Rauch
f30f353a36 Renamed Socket#req to Socket#request 2012-07-03 14:16:35 -07:00
Guillermo Rauch
8387ffb801 Added missing docs for Server constructor 2012-07-03 14:16:25 -07:00
Guillermo Rauch
bcba7e567d Updated websocket.io 2012-07-03 12:50:40 -07:00
Guillermo Rauch
671ce071ea Removed version from api docs 2012-07-03 12:47:21 -07:00
Guillermo Rauch
aa6fe32b59 Removed version since we're not supporting 0.4 from the get-go. Use require('engine.io/package').version instead. 2012-07-03 12:46:40 -07:00
Guillermo Rauch
0cdc862eca Sorry node 0.4 2012-07-03 12:31:50 -07:00
Guillermo Rauch
81a5797237 Improved docs 2012-07-03 12:29:35 -07:00
Guillermo Rauch
d87708f48f Bumped engine.io-client 2012-07-02 11:08:39 -07:00
Guillermo Rauch
4fd56bf3f6 test: added io cookie handshake test 2012-07-02 11:03:24 -07:00
Guillermo Rauch
f0ece1b9ba polling: send io cookie (fixes #30) 2012-07-02 11:03:09 -07:00
Guillermo Rauch
566acd1ffd socket: transfer sid to transport upon opening 2012-07-02 11:02:39 -07:00
Guillermo Rauch
f2ffc52777 test: added node 0.8 to testing targets 2012-07-02 09:06:04 -07:00
Guillermo Rauch
39e91a2a49 test: fixed ws version for travis CI 2012-07-02 09:05:17 -07:00
Guillermo Rauch
927134813b polling-jsonp: added garbage jsonp querystring protection (fixes #25) 2012-07-02 08:20:52 -07:00
Guillermo Rauch
82ec5a8bc9 socket: ignore transport errors from discarded transports (fixes #26) 2012-07-02 07:52:36 -07:00
Guillermo Rauch
3a2b592398 test: added onopen and onclose to test 2012-07-02 07:43:15 -07:00
Guillermo Rauch
00f9738292 socket: added polling cycle force for fast upgrade 2012-07-02 07:34:02 -07:00
TJ Holowaychuk
e62db4c98e add history.md 2012-06-28 18:39:49 -07:00
Guillermo Rauch
050ad8ea19 Fixes failing test. 2012-06-28 18:39:10 -07:00
Guillermo Rauch
591f069f01 Added failing test 2012-06-28 18:39:10 -07:00
TJ Holowaychuk
13e19d5808 Release 0.0.2 2012-06-28 17:01:52 -07:00
Guillermo Rauch
8c2ad76ecd Merge pull request #445 from ajaxorg/master
Fix for calling open as a function while its a boolean
2012-06-27 21:22:22 -07:00
Ruben Daniels
9d0c0631f3 * Added fail safe for open not being a function error 2012-06-27 19:35:51 -07:00
Guillermo Rauch
8197a0c854 Merge pull request #929 from sjonnet19/patch-1
Update redis to support Node 0.8.x
2012-06-26 06:29:08 -07:00
Shawn Jonnet
2b91f1407f Update redis to support Node 0.8.x 2012-06-25 23:30:24 -03:00
Guillermo Rauch
b6aa5c0553 Merge pull request #428 from jdahlq/master
Enhance the dist files to work with CommonJS loaders
2012-06-19 20:30:18 -07:00
Guillermo Rauch
ce99f057a2 Fixed engine.io for 0.7 2012-06-05 15:05:19 +02:00
Yuval Carmel
53ff1a510d Fix disconnects when fallback to xhr-polling (heartbeat related) 2012-05-24 17:02:33 +03:00
Yuval Carmel
ae18a17cdf Fix reconnect issue when using the fallback mechanism of connect timeout 2012-05-24 17:00:14 +03:00
TJ Holowaychuk
d0743a4a30 Fixed .off() with .once()-registered callbacks 2012-05-21 21:31:09 -03:00
TJ Holowaychuk
bf6f07abc9 added test for emitter.once() and .off() 2012-05-21 21:28:42 -03:00
TJ Holowaychuk
441b438157 docs 2012-05-10 10:15:38 -07:00
TJ Holowaychuk
05d95f0470 Added Emitter#has(event) 2012-05-10 10:15:18 -07:00
TJ Holowaychuk
872de89f6c Added tests 2012-05-03 10:41:42 -07:00
Guillermo Rauch
3b9715e8e7 Merge pull request #869 from MrSwitch/master
Small change to demo copy
2012-05-03 06:24:15 -07:00
Joe Dahlquist
96e69a4430 Rebuild dev and prod dist files 2012-05-02 23:41:48 -07:00
Joe Dahlquist
cceafcc5bb CommonJS-compatible wrapper for dists
For non-node builds, wrap the dist code in an anonymous function. For
client-side CommonJS builds, set var io = module.exports.
2012-05-02 23:41:00 -07:00
Andrew Dodson
4e13cfb03e Update copy 2012-05-03 12:16:01 +10:00
Guillermo Rauch
39671e81a5 Merge pull request #868 from bodash/patch-1
I continued to have websocket connection issues in Safari when using SSL...
2012-05-02 12:21:24 -07:00
bodash
ffa8994a23 I continued to have websocket connection issues in Safari when using SSL that terminated at a load balancer. The shorthand logic that was here was nice and compact but didn't seem to work. Took the "intent" of the short hand and made it a bit more verbose and now it works. 2012-05-02 13:18:46 -06:00
TJ Holowaychuk
6b2240a13b changed name 2012-05-02 10:49:51 -07:00
TJ Holowaychuk
8f5c87082d docs 2012-05-02 10:49:14 -07:00
TJ Holowaychuk
d69fcf20b8 readme 2012-05-02 10:48:56 -07:00
TJ Holowaychuk
709deff363 Initial commit 2012-05-02 10:44:33 -07:00
Guillermo Rauch
6062a0620f Merge pull request #427 from ycarmel/master
Fix regression due to Pull Request #424 (no reconnect if handshake fail)
2012-05-02 02:48:41 -07:00
ycarmel
1d437b55c2 Update lib/socket.js 2012-05-02 11:22:09 +03:00
Guillermo Rauch
ebc31ab74c Merge pull request #426 from Nathanaela/master
Patch to fix iPod/iPad/iPhone browser from crashing when resuming on a sites using the websocket transport
2012-05-01 12:25:05 -07:00
Nathanael Anderson
8dc031d072 Fix for iPad/iPod/iPhone and websocket crash on browser resume. 2012-05-01 14:11:46 -05:00
Guillermo Rauch
c5bcceefcf Merge pull request #425 from ycarmel/master
Fix for Issue #430 - multiple connect on reconnect
2012-04-29 14:59:53 -07:00
ycarmel
d37ec4ed2f Fix for Issue #430 - multiple connect on reconnect 2012-04-30 00:47:53 +03:00
Guillermo Rauch
ecbd3fa9ed Merge pull request #424 from ycarmel/master
wfwef
2012-04-29 14:26:46 -07:00
ycarmel
4f63ba239d Fixing Issue#430 2012-04-30 00:24:13 +03:00
ycarmel
b712c1cf15 Fixing Issue #430 - mark socket as connecting before calling to handshake method (instead of calling it only when handshake completes) 2012-04-30 00:22:27 +03:00
Guillermo Rauch
de1afe1317 Merge pull request #857 from martinthomson/bug/856
Fix for ID generation vulnerability #856
2012-04-26 15:49:24 -07:00
Martin Thomson
aaad106b90 Adding node 0.4 backward compat for id gen 2012-04-26 15:08:19 -07:00
Martin Thomson
f850ddccd0 Removing more fixes for other bug 2012-04-26 14:35:17 -07:00
Martin Thomson
8d269aae4c Removing fixes for other bug 2012-04-26 14:33:37 -07:00
Martin Thomson
67b4eb9abd Making ID generation securely random 2012-04-26 14:28:00 -07:00
Chelsea Robb
a55ed9bf57 Renamed 'auto flush' option to manualFlush 2012-04-24 12:52:23 +10:00
Guillermo Rauch
fe6dd87443 Merge pull request #848 from mbrevoort/redisStoreRaceCondition
Fix Redis Store race condition in manager onOpen unsubscribe callback
2012-04-23 15:30:30 -07:00
Mike Brevoort
d9aeaa494f Fix Redis Store race condition in manager onOpen unsubscribe callback 2012-04-23 16:06:31 -06:00
Gabe Hollombe
76cf0b30cf added tests for auto and manual buffer flushing 2012-04-23 18:01:37 +07:00
Gabe Hollombe
afa76b4f23 add auto flush property (defaults to false) and a flushBuffer method to allow manual buffer flushing 2012-04-23 14:00:06 +07:00
Guillermo Rauch
2024d45383 Merge pull request #841 from TooTallNate/master
fix for EventEmitters always reusing the same Array instance for listeners
2012-04-19 13:30:13 -07:00
Nathan Rajlich
e1884859bc fix for EventEmitters always reusing the same Array instance for listeners
This fixes node v0.7.x.

The node commits that broke this old behavior is here:
  78dc13fbf9%5E...928ea564d16da47e615ddac627e0b4d4a40d8196
2012-04-19 13:18:22 -07:00
Guillermo Rauch
1254c2c291 Added note about clients and clientsCount 2012-04-18 11:12:32 -03:00
Guillermo Rauch
0242a2ddf3 Merge branch 'master' of github.com:LearnBoost/socket.io 2012-04-17 19:51:49 -03:00
Guillermo Rauch
dbe6d5f740 Release 0.9.6 2012-04-17 19:51:37 -03:00
Guillermo Rauch
f0e877da3c Release 0.9.6 2012-04-17 19:51:08 -03:00
Guillermo Rauch
bb9083aeb7 Merge branch 'master' of github.com:LearnBoost/socket.io-client
Conflicts:
	dist/socket.io.min.js
2012-04-17 19:50:32 -03:00
Guillermo Rauch
f8bc56da8b Release 0.9.6 2012-04-17 19:49:49 -03:00
Guillermo Rauch
e98fc7bc86 Fixed XSS in jsonp-polling. 2012-04-17 19:48:32 -03:00
Guillermo Rauch
9bbf17f31e Merge pull request #827 from crickeys/patch-4
Fixes when browser doesn't send origin header, defaults to empty string ...
2012-04-11 15:02:50 -07:00
crickeys
1a5a87af13 Fixes when browser doesn't send origin header, defaults to empty string instead of UNDEFINED (which would throw an error on the origin.match(/^https/) below 2012-04-11 14:41:07 -05:00
Guillermo Rauch
b5aba684df Merge pull request #21 from mixu/mixu/firefox-post-response-fix
Fix POST content type for Firefox.
2012-04-09 15:08:34 -07:00
Mikito Takada
0ad8a247a2 Fix POST content type for Firefox. Same as https://github.com/LearnBoost/socket.io/pull/806 but for Engine.io 2012-04-06 21:51:58 -07:00
Guillermo Rauch
2c50aaedb0 Merge pull request #412 from mreinsch/android_jsonp_fix
don't position the jsonp form off the screen
2012-04-06 07:23:31 -07:00
Michael Reinsch
57127544c8 don't position the jsonp form off the screen, this causes the default browser on some androids to actually extend the width of the document 2012-04-06 22:39:59 +09:00
Guillermo Rauch
a4e53a642b Release 0.9.5 2012-04-05 14:37:18 -03:00
Guillermo Rauch
ad6c1483d8 Release 0.9.5 2012-04-05 14:35:22 -03:00
Guillermo Rauch
6f36d8c2ff Added test for polling with connection close. 2012-04-05 14:32:10 -03:00
Guillermo Rauch
09fb16b443 Ensure close upon request close. 2012-04-05 14:31:50 -03:00
Guillermo Rauch
330407cc9d Fix disconnection reason being lost for polling transports. 2012-04-05 14:31:32 -03:00
Guillermo Rauch
2075307f23 Ensure that polling transports work with Connection: close 2012-04-05 14:31:13 -03:00
Guillermo Rauch
d7b06edaca Log disconnection reason 2012-04-05 14:31:01 -03:00
Guillermo Rauch
e91cc5a474 Merge pull request #18 from nicokaiser/master
polling: Remove the right listener in onDataRequest
2012-04-05 04:23:38 -07:00
Nico Kaiser
b566accb09 Remove the right listener in onDataRequest 2012-04-05 08:53:13 +02:00
Guillermo Rauch
c5cea61510 Update engine.io-client commit id. 2012-04-03 08:34:21 -03:00
Guillermo Rauch
7b0699b10f Added default resource to test URLs. 2012-04-03 08:18:11 -03:00
Guillermo Rauch
825a489e9e Added default resource to URLs. 2012-04-03 08:16:14 -03:00
Guillermo Rauch
b8cca35434 Added instrumentation to core 2012-04-03 08:16:05 -03:00
Guillermo Rauch
041662b140 Update docs. 2012-04-02 12:17:30 -03:00
Guillermo Rauch
4f689687e6 Implemented resource 2012-04-02 12:17:22 -03:00
Guillermo Rauch
b059331f50 Bumped debug 2012-04-02 11:43:02 -03:00
Guillermo Rauch
46fdcf00b3 Release 0.9.4 2012-04-01 01:50:50 -03:00
Guillermo Rauch
147b9bb941 Release 0.9.4 2012-04-01 01:49:51 -03:00
Guillermo Rauch
02a3da487c Merge branch 'master' of github.com:LearnBoost/socket.io 2012-04-01 01:48:25 -03:00
Guillermo Rauch
087c686ad0 Release 0.9.4 2012-04-01 01:48:13 -03:00
Guillermo Rauch
a426cb50ad Release 0.9.4 2012-04-01 01:45:44 -03:00
Guillermo Rauch
f50146e20b Fixes polling loop upon reconnect advice (fixes #438). 2012-04-01 01:44:11 -03:00
Guillermo Rauch
16205fc522 Merge pull request #809 from DanielBaulig/issue795-fix
Issue795 fix
2012-03-28 12:58:45 -07:00
Guillermo Rauch
9227c0b4dd Merge pull request #15 from nicokaiser/master
Wrong namespace in docs
2012-03-28 07:30:28 -07:00
Nico Kaiser
0a5304f534 update docs 2012-03-28 16:16:04 +02:00
Guillermo Rauch
49ff307d38 Release 0.9.3 2012-03-28 09:50:31 -03:00
Guillermo Rauch
779095a25e Fixed handshake transports / client options transports intersection. 2012-03-28 09:49:33 -03:00
Guillermo Rauch
a232159ce8 Release 0.9.3 2012-03-28 09:28:05 -03:00
Guillermo Rauch
dce9685d05 Merge pull request #385 from mixu/upstream/fix-xhr-check
Fix XHR.check, which was throwing an error and causing non-IE browsers to fall back to JSONP
2012-03-27 16:59:16 -07:00
Guillermo Rauch
b9c3255b7c Merge pull request #806 from mixu/upstream/fix-ff-xhr-post-syntax
Fix "syntax error" message on FF, resulting from FF trying to parse the POST result as XML due to it not having a response content-type
2012-03-27 16:54:29 -07:00
Mikito Takada
6f80ef14b7 Minor improvements to readability 2012-03-27 16:52:28 -07:00
Mikito Takada
d80010dcf0 Firefox will try to parse the response from POST requests, causing a syntax error message in the Web Console. Basically an addition to https://github.com/LearnBoost/socket.io/pull/501 2012-03-27 16:43:17 -07:00
Mikito Takada
b8c3f79936 Fix XHR.check, which was throwing an error transparently and causing non-IE browsers to fall back to JSONP 2012-03-27 16:37:05 -07:00
Daniel Baulig
00694a8a98 Fix issue #795 2012-03-19 22:03:31 +01:00
Daniel Baulig
da95094998 Add disconnect from namespace test-case for issue #795 2012-03-19 21:54:20 +01:00
Guillermo Rauch
53b5f3e6b4 Merge pull request #407 from zzzaaa/unload_fix
"on window close" disconnect. unload. beforeunload.
2012-03-16 05:59:07 -07:00
Alexey Raksha
edef56ee8e "on window close" correct disconnect 2012-03-16 14:49:23 +04:00
Guillermo Rauch
1e889b9a01 No growl. 2012-03-14 12:55:57 -03:00
Guillermo Rauch
e7d7582f84 Release 0.9.2 2012-03-13 11:00:50 -03:00
Guillermo Rauch
ecd752a7ea Release 0.9.2 2012-03-13 10:52:32 -03:00
Guillermo Rauch
df5f23d309 More sensible close timeout default (fixes disconnect issue) 2012-03-13 10:49:06 -03:00
Guillermo Rauch
f54ef033a2 Merge pull request #405 from zzzaaa/master
Transports order of preference
2012-03-12 07:46:11 -07:00
Alexey Raksha
3e5d3a3ab5 Transport order set by "options" 2012-03-12 17:42:42 +04:00
Guillermo Rauch
e018ba91eb Merge branch 'master' of github.com:LearnBoost/socket.io 2012-03-09 08:47:01 -03:00
Guillermo Rauch
c59aa6ff2c Getting ready for 1.0 2012-03-09 08:42:24 -03:00
Guillermo Rauch
9431709298 Merge pull request #787 from MatthewMueller/master
io.configure('development', function() {...}) will trigger if NODE_ENV is not defined.
2012-03-09 02:17:15 -08:00
Matt Mueller
a29525e043 NODE_ENV in configure now defaults to development, which is consistent with express 2012-03-09 02:10:58 -08:00
Guillermo Rauch
7b77bd613c Replaced 204 with 200 and added a response text.
I remember old versions of Firefox having issues with 200 responses
with no text.
2012-03-08 11:46:12 -03:00
Guillermo Rauch
e4ca71c84e Fixed ambiguous requirement. 2012-03-03 19:05:05 -03:00
Guillermo Rauch
2aaee23930 Fixed coverage generation. 2012-03-03 19:04:46 -03:00
Guillermo Rauch
1a48492a27 Added lib-cov/ to gitignore. 2012-03-03 18:49:08 -03:00
Guillermo Rauch
722ee5b5e4 Fixed parser reference. 2012-03-03 18:48:43 -03:00
Guillermo Rauch
ec576d48c4 Corrected path. 2012-03-03 18:42:41 -03:00
Guillermo Rauch
557907603f Added index.js to require the right engine-io 2012-03-03 18:42:32 -03:00
Guillermo Rauch
7784d48838 Fixed eio requirement to require lib-cov if needed. 2012-03-03 18:41:33 -03:00
Guillermo Rauch
bd19365452 Exposed parser. 2012-03-03 18:41:11 -03:00
Guillermo Rauch
67cb168b1d Added test-cov, lib-cov Makefile tasks. 2012-03-03 18:40:31 -03:00
Guillermo Rauch
6ebac5214a Added coverage.html to gitignore. 2012-03-03 18:40:12 -03:00
Guillermo Rauch
e8f710f2f0 Defined npm test. 2012-03-02 15:40:24 -03:00
Guillermo Rauch
afd9d58da1 Merge branch 'master' of github.com:/LearnBoost/engine.io 2012-03-02 15:38:35 -03:00
Guillermo Rauch
3bd00edacd Point to client on git for travis. 2012-03-02 15:38:12 -03:00
Guillermo Rauch
dbac4cf1c1 Merge pull request #13 from ruxkor/to_learnboost
add on('error') handler for websocket transport
2012-03-02 10:05:54 -08:00
Andor Goetzendorff
556995470a add on('error') handler for websocket transport 2012-03-02 17:59:37 +01:00
Guillermo Rauch
5312e154b3 Release 0.9.1-1 2012-03-02 08:41:17 -03:00
Guillermo Rauch
480b86f382 Bumped client with NPM dependency fix. 2012-03-02 08:40:41 -03:00
Guillermo Rauch
84de1cfed8 Release 0.9.1-1 2012-03-02 08:39:18 -03:00
Guillermo Rauch
aa8f2fae6c Fixed active-x-obfuscator dependency. 2012-03-02 08:37:31 -03:00
Guillermo Rauch
c0e2c3012f Release 0.9.1 2012-03-02 08:20:38 -03:00
Guillermo Rauch
1705acf556 Updated dependencies. 2012-03-02 08:13:00 -03:00
Guillermo Rauch
1d7bdb5ea2 Release 0.9.1 2012-03-02 08:12:22 -03:00
Guillermo Rauch
b1f5509b1a Expose transport as local to test runner app. 2012-03-02 08:10:06 -03:00
Guillermo Rauch
205790e63c Added warning within Firefox about webworker test in test runner. 2012-03-02 08:09:48 -03:00
Guillermo Rauch
a84002563e Added warning styles. 2012-03-02 08:09:36 -03:00
Guillermo Rauch
d4b1e480cb Compiled CSS 2012-03-02 08:00:46 -03:00
Guillermo Rauch
97b04c4152 Merge branch 'master' of github.com:LearnBoost/socket.io 2012-03-02 07:50:59 -03:00
Guillermo Rauch
5b8accb69d Merge pull request #394 from felixge/heartbeat
Implement client side heartbeat checks
2012-03-02 02:49:54 -08:00
Guillermo Rauch
6cf7a450ae Merge pull request #397 from einaros/patch-1
update ws dependency
2012-03-01 14:03:16 -08:00
Einar Otto Stangvik
bbb48d149c update ws dependency 2012-03-01 23:02:16 +01:00
Felix Geisendörfer
c9b54f20ca Clear heartbeat timer when closing socket 2012-02-29 15:19:23 +01:00
Guillermo Rauch
c8306e207d Temporarily removing node 0.4 from travis-ci 2012-02-29 11:01:11 -03:00
Felix Geisendörfer
c1b03531bf Set heartbeat timeout after every package
This way it also works for long-polling clients.
2012-02-29 14:51:33 +01:00
Guillermo Rauch
de5c0b3554 Merge pull request #771 from felixge/heartbeat
Make heartbeat timeout > heartbeat interval
2012-02-29 05:43:24 -08:00
Felix Geisendörfer
57a0b24060 Make heartbeat timeout > heartbeat interval
Otherwise clients would detect timeouts before a heartbeat has a chance
of reaching them. The new values themselves were suggested by @rauchg. I
myself think that the heartbeat timeout should probably only be ~10s larger
than the interval.
2012-02-29 14:15:37 +01:00
Felix Geisendörfer
0bcd25f03d Implement client side heartbeat checks
Fixes https://github.com/LearnBoost/socket.io/issues/635
2012-02-29 14:12:43 +01:00
Guillermo Rauch
db40b103e5 Merge pull request #374 from rizzoma/master
Xhr-based transports didn't close on "not handshaken" error and spammed server with "null".
2012-02-28 04:29:20 -08:00
Guillermo Rauch
b04239744a Merge pull request #392 from felixge/activex
Implement ActiveX obfuscation for minified dist
2012-02-28 02:32:14 -08:00
Felix Geisendörfer
1590242736 Move ActiveX obfuscation into own module
Also made it apply to both dist files, not just the minified one.
2012-02-28 11:09:47 +01:00
Felix Geisendörfer
9c006e1409 Implement ActiveX obfuscation for minified dist
Some coporate proxys/firewalls (such as Blue Coat) filter out JS files
that contain the string 'ActiveX' in them. This patch alters the Uglify
AST so that all occurences of the string are obfuscated, making
socket.io work in even the most hostile environments : ).
2012-02-27 22:22:26 +01:00
Guillermo Rauch
ba456d99cc Bumped websocket.io 2012-02-27 10:39:49 -03:00
Guillermo Rauch
0612d5a079 Shortened heading. 2012-02-27 09:01:13 -03:00
Guillermo Rauch
67992530bc Added engine.io. 2012-02-27 08:58:57 -03:00
Guillermo Rauch
4f8212ebac Added .travis.yml 2012-02-27 08:57:42 -03:00
Guillermo Rauch
4713aaab0b Updated readme. 2012-02-27 08:54:17 -03:00
Guillermo Rauch
204576c006 Make these 2 tests work both on 0.4 and 0.6 2012-02-26 21:51:22 -03:00
Guillermo Rauch
66ac425bf7 Release 0.9.0 2012-02-26 21:46:39 -03:00
Guillermo Rauch
a01e7e2256 Make tests pass on 0.4 2012-02-26 18:21:25 -03:00
Guillermo Rauch
1a35218003 Release 0.9.0 2012-02-26 17:41:31 -03:00
Guillermo Rauch
25d4677f9e Revert "Cross domain requests properly fall back with SSL"
This reverts commit 0ba168c9b6.
2012-02-26 17:39:45 -03:00
Guillermo Rauch
47cfa5aadf Fixed tests. All 250 passing. 2012-02-26 17:14:06 -03:00
Guillermo Rauch
ddd7f804af Fixed cross-domain xhr tests. 2012-02-26 17:11:52 -03:00
Guillermo Rauch
5b76f2d36d Merge branch 'master' of github.com:/LearnBoost/engine.io 2012-02-26 16:50:11 -03:00
Guillermo Rauch
5ed8ac95da Documented attach options. 2012-02-26 16:47:37 -03:00
Guillermo Rauch
97c84e5e4a Fixed indentation. 2012-02-26 16:47:25 -03:00
Guillermo Rauch
0a0095c267 Added DS_Store to gitignore. 2012-02-26 16:36:25 -03:00
Guillermo Rauch
22ba0e68e0 Updated depedencies. 2012-02-26 16:35:51 -03:00
Guillermo Rauch
8c396925ac Merge pull request #12 from kapouer/patch-2
Socket.ping() should be idempotent, if not race conditions can appear and connection closes.
2012-02-22 14:11:19 -08:00
Lal Jérémy
d1d35263b1 Socket.ping() should be idempotent, if not race conditions can appear and connection closes. 2012-02-22 15:13:01 +01:00
Guillermo Rauch
2d7d1debeb Fixes #11. Thanks @ruxkor 2012-02-22 09:59:52 -03:00
Guillermo Rauch
81e278872f Merge pull request #10 from kapouer/patch-1
Trivial fix in update lib/socket.js, fix wrong call of sendPacket
2012-02-21 15:26:05 -08:00
Lal Jérémy
b56354c84b Update lib/socket.js 2012-02-22 00:20:16 +01:00
Guillermo Rauch
b6e33239d7 Fix for #9 corrected. [ruxkor, kapouer] 2012-02-21 12:13:54 -03:00
Guillermo Rauch
2e596e7876 Fixed Makefile 2012-02-15 14:07:49 -03:00
Guillermo Rauch
f4d0badf5d Merge branch 'master' of github.com:/LearnBoost/engine.io 2012-02-15 14:04:34 -03:00
Guillermo Rauch
bbc988822b Fixed CORS for withCredentials (fixes #9) 2012-02-15 14:03:48 -03:00
Guillermo Rauch
224e3ecfc8 Bumped uglify 2012-02-13 20:45:16 -03:00
Guillermo Rauch
8c1c7a24ef Merge pull request #744 from ajaxorg/regexp-as-resource
make it possible to use a regexp to match the socket.io resource URL
2012-02-09 09:38:03 -08:00
Fabian Jakobs
09b130f4cf make it possible to use a regexp to match the
socket.io resource URL. We need this because we
have to prefix the socket.io URL with a variable
ID.
2012-02-09 17:17:55 +01:00
Guillermo Rauch
75a30f6e37 Merge pull request #380 from getify/patch-1
tweaking code so it doesn't throw an exception when used inside...
2012-02-06 10:00:44 -08:00
Guillermo Rauch
b662704b0b Merge pull request #737 from mixu/mixu/authfix2
Supplemental fix to gavinuhma/authfix, it looks like the same Access-Control-Origin logic is needed in the http and xhr-polling transports
2012-02-03 14:24:57 -08:00
Mikito Takada
304a4285ff Supplemental fix to gavinuhma/authfix, it looks like the same Access-Control-Origin logic is needed in the http and xhr-polling transports 2012-02-03 12:20:40 -08:00
Kyle Simpson
601b516818 tweaking code so it doesn't throw an exception when used inside a WebWorker in Firefox 2012-01-31 01:18:08 -08:00
Guillermo Rauch
18e5ca12ce Merge pull request #7 from einaros/master
Don't suggest more upgrades than are actually available
2012-01-26 10:45:52 -08:00
einaros
89a30ec268 avoid suggesting upgrades which arent enabled on the server 2012-01-26 09:28:35 -08:00
Guillermo Rauch
f47cdb06e8 Merge pull request #6 from einaros/master
Update tests to run with latest superagent
2012-01-25 13:25:10 -08:00
einaros
b983b1a063 fix tests for latest superagent 2012-01-25 13:14:32 -08:00
Vyacheslav Bazhinov
7b31a42886 Fixed error handling during connection process.
Xhr-based transports didn't close on "not handshaken" error and spammed server with "null".
2012-01-20 15:30:31 +07:00
Guillermo Rauch
208011937d Added missing qs decoding to jsonp transport. 2012-01-18 11:44:43 -08:00
Guillermo Rauch
337d709392 Updated polling callbacks variable. 2012-01-18 08:37:49 -08:00
Guillermo Rauch
3b1395013d Merge pull request #370 from crickeys/patch-1
#366 Do not rely on Array.prototype.indexOf
2012-01-17 13:57:58 -08:00
crickeys
6075167470 Do not rely on Array.prototype.indexOf as it breaks with pages that use the Prototype.js library. 2012-01-17 15:13:06 -06:00
Guillermo Rauch
dfb3e1fa1d Removed test for client ping interval awareness. 2012-01-17 09:57:21 -08:00
Guillermo Rauch
96aa932bea Fixed ping tests. 2012-01-17 09:55:57 -08:00
Guillermo Rauch
e305e16ad7 Stopped sending interval to client. 2012-01-17 09:51:44 -08:00
Guillermo Rauch
014cf6e26d Tweaked default timeout and interval values. 2012-01-17 09:51:31 -08:00
Guillermo Rauch
79d26badfb Fixed docs. 2012-01-16 13:26:39 -08:00
Guillermo Rauch
cf57b9a01a Empty packet data translates into empty message. 2012-01-16 09:25:34 -08:00
Guillermo Rauch
081e304d7d Refactored (now passing) upgrade test. 2012-01-15 22:21:49 -08:00
Guillermo Rauch
4e8b650561 Removed test no longer valid in 0.6 2012-01-15 22:21:39 -08:00
Guillermo Rauch
2e4dcbdaba Improve ws instrumentation 2012-01-15 22:21:26 -08:00
Guillermo Rauch
de514e6e62 Added WebSocket#onData to instrument it. 2012-01-15 22:21:03 -08:00
Guillermo Rauch
cf4691c494 Renamed ws instrumentation nsp. 2012-01-15 22:20:41 -08:00
Guillermo Rauch
44e8192ad2 Improved polling instr. 2012-01-15 22:20:27 -08:00
Guillermo Rauch
0d0ffef9d2 Improved polling instrumentation. 2012-01-15 22:19:57 -08:00
Guillermo Rauch
d6ee514fbb Documentation and fix for .close without a fn. 2012-01-15 22:19:24 -08:00
Guillermo Rauch
86adb61f28 Ensured Socket#flush checks for buffer length. 2012-01-15 22:19:07 -08:00
Guillermo Rauch
04723dd50c Re-implemented maybeUpgrade to consider upgrade packet. 2012-01-15 22:18:34 -08:00
Guillermo Rauch
18311196a2 Renamed Socket#upgrade to #maybeUpgrade 2012-01-15 22:17:54 -08:00
Guillermo Rauch
327aeee7bf Introduced upgradeTimeout. 2012-01-15 22:10:33 -08:00
Guillermo Rauch
54791e61e2 Fixed closing of polling transport callback. 2012-01-14 13:46:20 -08:00
Guillermo Rauch
cb22f219d7 Renamed close readyState to closed. 2012-01-14 11:43:33 -08:00
Guillermo Rauch
b2c249e7ef Slown down some tests since they were pretty extreme.
The blocking `console.error` behavior of debug was making the tests not
pass sometimes.
2012-01-14 11:36:16 -08:00
Guillermo Rauch
a6da7ef0ba Reset slow threshold 2012-01-14 10:22:41 -08:00
Guillermo Rauch
c0bb8c740d Started leveraging mocha bail. 2012-01-14 09:42:39 -08:00
Guillermo Rauch
aab09b04bc Refactored server tests with listen shortcut and sprintf. 2012-01-14 09:42:18 -08:00
Guillermo Rauch
fdd4faa180 Refactored tests with new listen, sprintf & fixed potential leaks of errors to different tests. 2012-01-14 09:41:44 -08:00
Guillermo Rauch
3f3da53491 Added listen utilit for ephemeral ports listening & sprintf. 2012-01-14 09:41:10 -08:00
Guillermo Rauch
9630a4fe69 Added sprintf util for testing. 2012-01-14 09:37:39 -08:00
Guillermo Rauch
3a0759fb89 Cleaned up WebSocket#send. 2012-01-14 09:37:14 -08:00
Guillermo Rauch
88cfa04de5 Implemented WebSocket#writable. 2012-01-14 09:36:32 -08:00
Guillermo Rauch
15d420d6b2 Added instrumentation to polling payloads. 2012-01-14 09:36:09 -08:00
Guillermo Rauch
2a93f06e27 Implemented draining and orderly close to polling. 2012-01-14 09:35:39 -08:00
Guillermo Rauch
5e9e167ed4 Fixed docs. 2012-01-14 09:35:07 -08:00
Guillermo Rauch
704312271b Added instrumentation to upgrade. 2012-01-14 09:34:57 -08:00
Guillermo Rauch
83c2711009 Implemented Socket buffering/flushing:
- Fires upon upgrade
- Fires when the transport is drained.
2012-01-14 09:34:29 -08:00
Guillermo Rauch
fba2a89b79 Implemented sendPacket API homologous to client API. 2012-01-14 09:34:03 -08:00
Guillermo Rauch
a2f498ac65 Started adding buffering to Socket. 2012-01-14 09:33:01 -08:00
Guillermo Rauch
496ce56f5f Fixed docs. 2012-01-14 09:32:52 -08:00
Guillermo Rauch
89d59598c8 Syntax cleanup. 2012-01-14 09:32:42 -08:00
Guillermo Rauch
45f5b2a113 Fixed debug namespace convention. 2012-01-13 15:32:28 -08:00
Guillermo Rauch
bd7d01a190 Avoid incorrect debug output order. 2012-01-13 15:30:15 -08:00
Guillermo Rauch
6074795b19 Updated express dep for windows compatibility. 2012-01-11 07:41:09 -08:00
Guillermo Rauch
a139809a97 Updated express dep for windows compatibility. 2012-01-11 07:40:44 -08:00
Guillermo Rauch
c005997f11 Merge pull request #361 from 3rd-Eden/ws
use @einaros ws module instead of the old crap one
2012-01-10 13:58:50 -08:00
Guillermo Rauch
0c79fcacbc Added starts of upgrade tests. 2012-01-09 08:35:39 -08:00
Guillermo Rauch
475826e69a Added messages ws tests 2012-01-04 17:56:03 -08:00
Guillermo Rauch
3cc7a69b4c Bumped ws.io 2012-01-04 17:53:54 -08:00
Guillermo Rauch
f2459424c1 Added tricky xhr-polling test. 2012-01-04 17:48:11 -08:00
Guillermo Rauch
593db7192f Added first message test 2012-01-04 17:47:52 -08:00
Guillermo Rauch
c2e5d6ff61 Gotta love websocket 2012-01-04 17:46:56 -08:00
Guillermo Rauch
70f8830b3c Added doClose callback for Polling 2012-01-04 17:21:06 -08:00
Guillermo Rauch
f2043f9590 Added callback support to Polling#send, and drain event. 2012-01-04 17:20:48 -08:00
Guillermo Rauch
f51d36f584 Added closing readyState and callback to Transport#doClose 2012-01-04 17:18:12 -08:00
Guillermo Rauch
26e3d1c546 Added closing readyState. 2012-01-04 17:17:58 -08:00
Guillermo Rauch
5587282215 Added more instrumentation to polling 2012-01-04 15:40:48 -08:00
Guillermo Rauch
615c555742 Improved instrumentation. 2012-01-04 15:40:36 -08:00
Guillermo Rauch
767d770e59 Added additional verification step: handshake is only over GET. 2012-01-04 15:40:21 -08:00
Guillermo Rauch
7a4e0c086a Added client close test for websocket. 2012-01-04 14:03:50 -08:00
Guillermo Rauch
38d644ef76 Added client close test. 2012-01-04 13:57:55 -08:00
Guillermo Rauch
4c7e6a675e Fixed data chunks aggregation. 2012-01-04 13:52:20 -08:00
Guillermo Rauch
001d80ac40 Fixed bind, I thought it took an array of arguments. 2012-01-04 13:52:05 -08:00
Guillermo Rauch
1a8b42debc Added missing Transport#onPacket method. 2012-01-04 13:41:38 -08:00
Guillermo Rauch
e4ee394dd5 Fixed; close packet is specific to xhr-polling transport 2012-01-04 13:41:23 -08:00
Guillermo Rauch
2fc784a145 Fixed test titles. 2012-01-04 10:41:58 -08:00
Guillermo Rauch
b098ccf450 Added forced close test for websocket 2012-01-04 10:36:17 -08:00
Guillermo Rauch
ed7d43053d Addded test for server forced close (xhr polling) 2012-01-04 10:29:58 -08:00
Guillermo Rauch
2d64c157c1 Make test faster. 2012-01-04 08:54:57 -08:00
Guillermo Rauch
3fb375d9bf Added ws for tests 2012-01-03 13:12:12 -08:00
Guillermo Rauch
0da0626a7b Added verificiation, handshake and open/close suits of tests 2012-01-03 13:11:41 -08:00
Guillermo Rauch
57c10d2265 Expose client globally to tests as eioc 2012-01-03 13:11:22 -08:00
Guillermo Rauch
28f7d4d715 Added instrumentation support for the client during tests. 2012-01-03 13:11:09 -08:00
Guillermo Rauch
c20bdadef4 Added default XML response for policy requests. 2012-01-03 13:10:42 -08:00
Guillermo Rauch
d640d3252d Finished JSONP#doWrite 2012-01-03 13:10:13 -08:00
Guillermo Rauch
81877af79b Added escaping to onData 2012-01-03 13:04:26 -08:00
Guillermo Rauch
fdc60ff476 Fixed style 2012-01-03 13:00:56 -08:00
Guillermo Rauch
adb373455b Implemented WebSocket#send and WebSocket#doClose 2012-01-03 13:00:35 -08:00
Guillermo Rauch
88c6a5364b Fixed WebSocket constructor. 2012-01-03 13:00:09 -08:00
Guillermo Rauch
1273fc4f10 Simplified XHR#doWrite 2012-01-03 12:59:40 -08:00
Guillermo Rauch
3aa755e9f9 Fixed style 2012-01-03 12:59:23 -08:00
Guillermo Rauch
e398000c0e Implemented Polling#doClose 2012-01-03 12:59:07 -08:00
Guillermo Rauch
397ce64e80 Implemented Polling#write. 2012-01-03 12:58:46 -08:00
Guillermo Rauch
144ae3ef54 Fixed docs 2012-01-03 12:58:34 -08:00
Guillermo Rauch
c1316e0a52 Implemented Polling#send 2012-01-03 12:58:16 -08:00
Guillermo Rauch
3875089c3b Fixed docs 2012-01-03 12:58:07 -08:00
Guillermo Rauch
d8194a5cf0 Implemented Polling#flush 2012-01-03 12:57:49 -08:00
Guillermo Rauch
8f837a5720 Refactored Polling#onData 2012-01-03 12:55:09 -08:00
Guillermo Rauch
00291ee50a Fixed docs 2012-01-03 12:54:58 -08:00
Guillermo Rauch
4c02b31425 Implemented onDataRequest. 2012-01-03 12:52:30 -08:00
Guillermo Rauch
a9ecdcf771 Fixed docs 2012-01-03 12:52:17 -08:00
Guillermo Rauch
fc70102f79 Added poll request handler 2012-01-03 10:43:47 -08:00
Guillermo Rauch
93d32fa925 Fixed docs 2012-01-03 10:43:08 -08:00
Guillermo Rauch
d02023212d Override onRequest to handle both GET and POST requests. 2012-01-03 10:42:48 -08:00
Guillermo Rauch
34d4892b1b Fixed style 2012-01-03 10:42:40 -08:00
Guillermo Rauch
df82cbad1c Regularized Polling constructor. Added debug scope 2012-01-03 10:41:58 -08:00
Guillermo Rauch
23e434f5b4 Refactored transports/index
- Transports now expose `upgradesTo`
- Moved polimorphic polling constructor here
2012-01-03 10:41:15 -08:00
Guillermo Rauch
b7a9919ec5 Fixed style 2012-01-03 10:41:01 -08:00
Guillermo Rauch
e266c4a718 Refactored Transport 2012-01-03 10:40:17 -08:00
Guillermo Rauch
cf0550ac67 Added defenses for onClose and close. 2012-01-03 10:39:48 -08:00
Guillermo Rauch
cce20d5e16 Refactored rasons for close 2012-01-03 10:39:29 -08:00
Guillermo Rauch
10cfe1bf86 Refactored clearTransport 2012-01-03 10:39:07 -08:00
Guillermo Rauch
8407a97aac Refactored setTransport. 2012-01-03 10:38:40 -08:00
Guillermo Rauch
a9bcf6be09 Fixed ping logic 2012-01-03 10:38:01 -08:00
Guillermo Rauch
f25a69e363 Added debug line 2012-01-03 10:37:50 -08:00
Guillermo Rauch
fdcaf361aa Added defense for packets after socket is closed 2012-01-03 10:37:23 -08:00
Guillermo Rauch
f66bd79eb4 Fixed handshake packet 2012-01-03 10:37:10 -08:00
Guillermo Rauch
61ec2d92dc Keep track of request that originated socket. 2012-01-03 10:36:49 -08:00
Guillermo Rauch
817ddee41f Initialized debug scope for Socket 2012-01-03 10:36:30 -08:00
Guillermo Rauch
8e9d163666 Refactored onWebSocket to consider the possibility of a websocket handshake. 2012-01-03 10:36:10 -08:00
Guillermo Rauch
b58a5e830b Refactored handshake to allow ws and non-ws handshakes. 2012-01-03 10:35:33 -08:00
Guillermo Rauch
fa7bea93b5 Refactored handleRequest 2012-01-03 10:35:17 -08:00
Guillermo Rauch
35fa0f76db Added debug to handleRequest 2012-01-03 10:34:52 -08:00
Guillermo Rauch
5fcac6e437 Added debug to Server#close 2012-01-03 10:34:30 -08:00
Guillermo Rauch
2d53e5fd85 Implemented Server#close 2012-01-03 10:34:08 -08:00
Guillermo Rauch
c801ff13d5 Make sure to not include non-digits in generated id. 2012-01-03 10:33:13 -08:00
Guillermo Rauch
12ccb6fcf1 Fixed Server#verify 2012-01-03 10:32:49 -08:00
Guillermo Rauch
ba3a85cd31 Simplified transport upgrade possibilities computation 2012-01-03 10:32:25 -08:00
Guillermo Rauch
2819a0c4cf Make Server inherit from EventEmitter 2012-01-03 10:32:06 -08:00
Guillermo Rauch
9c5384f44b Do not cache transport names to allow modification of object.
Added clientsCount property
2012-01-03 10:31:29 -08:00
Guillermo Rauch
fb121a9474 Added debug for debugging 2012-01-03 10:31:01 -08:00
Guillermo Rauch
5e0dd8bb35 Upon http server close, close all engine open clients (attach) 2012-01-03 10:30:23 -08:00
Guillermo Rauch
d7c1ff51c3 Documented client close event arguemnts. 2012-01-03 10:30:05 -08:00
Guillermo Rauch
3d97e1c45e Documented Socket properties. 2012-01-03 10:29:41 -08:00
Guillermo Rauch
32f2d57f7d Documented close event arguments 2012-01-03 10:29:27 -08:00
Guillermo Rauch
2d13524c6c Documented public Server methods 2012-01-03 10:29:13 -08:00
Guillermo Rauch
ff50d1d19f Added Server#clientsCount property 2012-01-03 10:28:49 -08:00
Guillermo Rauch
8a61a1c6b0 Added engine#Transport and engine#transports as public API 2012-01-03 10:28:28 -08:00
Arnout Kazemier
c32979051f version bump, windows support landed 2012-01-02 20:12:30 +01:00
Guillermo Rauch
7d28a1e362 Added socket interface. 2011-12-29 13:14:39 -05:00
Guillermo Rauch
3a980d9e67 Added Server (manager) interface. 2011-12-29 13:13:38 -05:00
Guillermo Rauch
150f848480 Fixed style 2011-12-29 13:13:22 -05:00
Guillermo Rauch
c0286cea4e Expose eio and superagent to all tests. 2011-12-29 13:12:57 -05:00
Guillermo Rauch
9abbf2d175 Added basic server tests. 2011-12-29 13:12:40 -05:00
Guillermo Rauch
c6966b6351 Added main engine.io tests. 2011-12-29 12:59:07 -05:00
Guillermo Rauch
7f764a7c73 Added raw http socket handling for flashsocket 2011-12-29 12:58:42 -05:00
Guillermo Rauch
fc65b94d84 refactored websocket upgrade handler in attach. 2011-12-29 12:58:21 -05:00
Guillermo Rauch
f27e66604f Fixed restoration of old listeners when attaching engine.io 2011-12-29 12:49:46 -05:00
Guillermo Rauch
7418142c0d Fixed style 2011-12-29 12:48:49 -05:00
Guillermo Rauch
c581ccad54 Fixed type checking of arguments for engine#listen 2011-12-29 12:48:26 -05:00
Guillermo Rauch
49f9adc208 Revamped exports 2011-12-29 12:47:18 -05:00
Guillermo Rauch
fe9316e6e9 Export protocol revision from main file 2011-12-29 12:44:55 -05:00
Guillermo Rauch
55a462a72a Added http dependency to engine.io 2011-12-29 12:44:23 -05:00
Arnout Kazemier
49afababe2 use @einaros ws module instead of the old crap one 2011-12-29 11:20:56 +01:00
Guillermo Rauch
7afe6a34e2 Added pointer to main file in package.json. 2011-12-23 22:15:09 -08:00
Guillermo Rauch
8a677a9d87 Simply simplifying 2011-12-23 13:42:57 -08:00
Guillermo Rauch
6f115fa078 Fixed require in README 2011-12-23 13:38:35 -08:00
Guillermo Rauch
c9d6a15595 Fixed handleRequest usage 2011-12-23 13:28:38 -08:00
Guillermo Rauch
109ab1b91a Added superagent - required for tests 2011-12-23 13:28:20 -08:00
Guillermo Rauch
fd2eee9849 Removed should mocha require 2011-12-23 13:28:05 -08:00
Guillermo Rauch
a46aa7c094 Added basic engine tests 2011-12-23 13:27:52 -08:00
Guillermo Rauch
884400e8d9 README Client API adjustment. 2011-12-23 11:26:15 -08:00
Guillermo Rauch
aade919c85 Deleted logger. 2011-12-22 21:18:58 -08:00
Guillermo Rauch
3f81f1fc57 Leverage the client parser.
In the same fashion that websocket.io leverages @einaros excellent
`ws` client module.
2011-12-22 18:58:52 -08:00
Guillermo Rauch
a9b3b9638f Fixed typo 2011-12-21 18:30:00 -08:00
Guillermo Rauch
40e7c626f0 Rename 2011-12-21 18:29:40 -08:00
Guillermo Rauch
70e64eafa7 Added expect.js 2011-12-21 18:02:23 -08:00
Guillermo Rauch
0d339536e3 Added common test files 2011-12-21 18:02:10 -08:00
Guillermo Rauch
94e1f49a45 Merge pull request #354 from vedratna/master
fix for broken setCloseTimeout and 'IE+xhr-polling' goes into infinite loop on network disconnection
2011-12-20 22:11:36 -08:00
vedratna-velani
816bf1d19c fix for broken closeTimeout and 'IE + xhr' goes into infinite loop on disconnection 2011-12-21 11:21:13 +05:30
Guillermo Rauch
ccae35a047 Merge pull request #328 from wackfordjf3/patch-1
Clears the timeout from reconnection attempt when there is a successful or failed reconnection
2011-12-20 19:28:33 -08:00
Guillermo Rauch
9879d8c224 Merge pull request #327 from diegovar/patch-1
Removed decoding of parameters when chunking the query string.
2011-12-20 19:28:08 -08:00
Guillermo Rauch
201a0eb1c2 Merge pull request #353 from dget/master
Fix connections between http/https in IE
2011-12-20 19:25:35 -08:00
Guillermo Rauch
13a87962f9 Merge pull request #346 from vedratna/master
disabled reconnection on error if reconnect option set to false on connect
2011-12-20 19:25:05 -08:00
Dan Getelman
0ba168c9b6 Cross domain requests properly fall back with SSL 2011-12-20 06:50:47 -05:00
Guillermo Rauch
8ff2edd79c Merge pull request #689 from bwillard/master
Improve performance of parser.decodePayload
2011-12-16 14:04:12 -08:00
Brian Willard
ebd25676ee combine two substr calls into one in decodePayload to improve performance 2011-12-16 15:31:48 -06:00
Guillermo Rauch
5b4b368912 Indicate that there's 3 interfaces to implementing a Server. 2011-12-15 11:21:43 -08:00
Guillermo Rauch
18a735c53c README improvements. 2011-12-15 11:08:39 -08:00
Guillermo Rauch
0234dbf94e Adapted package.json name, bumped ws.io 2011-12-15 10:29:55 -08:00
Guillermo Rauch
d9d529cb17 Merge pull request #683 from jherdman/documentation-fix
Minor documentation fix
2011-12-12 11:02:24 -08:00
James Herdman
b37666a8e8 Minor documentation fix 2011-12-12 11:10:25 -05:00
Guillermo Rauch
cc2270bb90 Merge pull request #622 from mattrobenolt/master
Location mismatch in Safari behind proxy
2011-12-05 14:04:57 -08:00
Matt Robenolt
36fc7b07ea Minor. Conform to style of other files. 2011-12-05 16:59:15 -05:00
Matt Robenolt
8eab3a87e7 Switching setting to 'match origin protocol' 2011-12-05 16:58:00 -05:00
vedratna
7155d84af9 disabled reconnection on error if reconnect option is set to false 2011-12-05 18:08:59 +05:30
Guillermo Rauch
425366528f Bumped mocha 2011-12-04 19:18:59 -08:00
Guillermo Rauch
c41baae1ac Updated client side API in README 2011-12-03 20:40:18 -08:00
Guillermo Rauch
66312a56e8 Fixed engine.io-client dependency. 2011-12-03 20:19:17 -08:00
Guillermo Rauch
de45d8d8f6 Fixed README for new client global. 2011-12-03 20:13:34 -08:00
Guillermo Rauch
94d513c85a Revert "Fixes leaking Redis subscriptions for #663. The local flag was not getting passed through onClientDisconnect()."
This reverts commit d5ab46d662.
2011-11-26 15:14:26 -08:00
Guillermo Rauch
70abe7aada Revert "Handle leaked dispatch:[id] subscription."
This reverts commit c110036f75.
2011-11-26 15:14:13 -08:00
Guillermo Rauch
9a8c1c4ae7 Merge pull request #667 from dshaw/patch/redis-disconnect
Patch/redis disconnect
2011-11-26 14:03:01 -08:00
Daniel Shaw
c110036f75 Handle leaked dispatch:[id] subscription. 2011-11-26 12:14:39 -08:00
Daniel Shaw
d5ab46d662 Fixes leaking Redis subscriptions for #663. The local flag was not getting passed through onClientDisconnect(). 2011-11-26 11:22:43 -08:00
Guillermo Rauch
eeaca6d9ac Merge pull request #662 from 3rd-Eden/leak
prevent memory leaking on uncompleted requests & add max post size limit...
2011-11-23 14:04:42 -08:00
Arnout Kazemier
a7f45fe6c0 prevent memory leaking on uncompleted requests & add max post size limitation 2011-11-23 22:28:38 +01:00
Guillermo Rauch
b59fd61d56 Merge pull request #661 from 3rd-Eden/travis
Fix for testcase
2011-11-22 14:52:36 -08:00
Arnout Kazemier
7948619609 Fix for testcase 2011-11-22 23:49:58 +01:00
Guillermo Rauch
6e8166d039 Merge pull request #660 from 3rd-Eden/travis
Assertvarnish
2011-11-22 14:43:21 -08:00
Arnout Kazemier
8fc3e37ca1 Merge branch 'master' of github.com:LearnBoost/socket.io into travis 2011-11-22 23:41:54 +01:00
Guillermo Rauch
17d0f4d489 Merge pull request #630 from gavinuhma/auth-fix
set Access-Control-Allow-Origin header to origin to enable withCredentials
2011-11-22 14:38:30 -08:00
Guillermo Rauch
e7fc25ebf3 Merge pull request #335 from gavinuhma/auth-fix
set withCredentials to true before xhr to fix authentication
2011-11-22 14:38:24 -08:00
Gavin Uhma
61e7e8955a Merge branch 'master' of git://github.com/LearnBoost/socket.io into auth-fix 2011-11-22 18:03:48 -04:00
Gavin Uhma
4c17f7f83b Set Access-Control-Allow-Credentials true, regardless of cookie 2011-11-22 18:03:25 -04:00
Arnout Kazemier
0f29d786b2 Remove assertvarnish from package as it breaks on 0.6 2011-11-22 21:18:15 +01:00
Guillermo Rauch
5ee6b43921 Merge pull request #659 from 3rd-Eden/travis
Added travis
2011-11-22 11:47:49 -08:00
Arnout Kazemier
f211f78019 Correct irc channel 2011-11-22 20:46:01 +01:00
Arnout Kazemier
eeb2a73f16 Added travis 2011-11-22 20:44:19 +01:00
Guillermo Rauch
3bbf02b11b Initial import 2011-11-18 10:08:08 -08:00
Guillermo Rauch
3887633e35 Merge pull request #440 from dylang/master
Updated package.json to reflect new repo location
2011-11-16 13:05:31 -08:00
Guillermo Rauch
db8cf7673b Merge pull request #634 from christopherobin/master
Fixing issue #432
2011-11-16 13:05:18 -08:00
Guillermo Rauch
dfb852151b Merge pull request #570 from 3rd-Eden/logger
Use tty to detect if we should add colors or not by default.
2011-11-16 13:04:51 -08:00
Guillermo Rauch
7b6c85030e Merge pull request #643 from einaros/master
Bug fixes, and for some reason a heap of whitespace cleanups
2011-11-14 09:09:58 -08:00
einaros
2d5dcc1a8a whitespace cleanup 2011-11-14 17:57:34 +01:00
einaros
2b28c46400 added proper return after reserved field error 2011-11-14 17:50:57 +01:00
einaros
27714d7286 fixes manager.js failure to close connection after transport error has happened 2011-11-14 17:40:16 +01:00
einaros
ffef944dd5 added implicit port 80 for origin checks. fixes #638 2011-11-14 09:45:44 +01:00
Christophe Robin
f4b434a6a5 Fixed bug #432 in 0.8.7 2011-11-11 11:06:56 +09:00
Gavin Uhma
336430a3be set withCredentials to true before xhr to fix authentication 2011-11-08 18:28:21 -04:00
Gavin Uhma
e4a9342e8b set Access-Control-Allow-Origin header to origin to enable withCredentials 2011-11-08 18:22:30 -04:00
Guillermo Rauch
3ed6b79781 Release 0.8.7 2011-11-05 13:50:53 -07:00
Guillermo Rauch
4375ef1344 Bump 2011-11-05 13:48:23 -07:00
Guillermo Rauch
d12e0714e9 Release 0.8.7 2011-11-05 13:47:31 -07:00
Matt Robenolt
6f2270add6 Adding configuration variable matchOriginProtocol
matchOriginProtocol is meant to be used when running socket.io behind a
proxy. matchOriginProtocol should be set to true when you want the
location handshake to match the protocol of the origin. This fixes
issues with terminating the SSL in front of Node and forcing location
to think it's wss instead of ws.
2011-11-03 15:34:24 -04:00
Matt Robenolt
220f8d5bf5 Fixes location mismatch error in Safari. 2011-11-03 01:35:18 -03:00
Guillermo Rauch
946418e70e Merge pull request #621 from einaros/master
Deals with a memleak in namespaces, and silently drops malformed websocket connections
2011-11-02 15:11:21 -07:00
wackfordjf3
3884959577 Clears the timeout from reconnection attempt when there is a successful or failed reconnection.
This fixes the issue of setTimeout's carrying over from previous reconnection and changing (skipping) values of self.reconnectionDelay in the newer reconnection.
2011-11-02 12:58:59 -07:00
Guillermo Rauch
2bb60ac40b Merge pull request #616 from thekiur/master
This patch will prevent some random memory leaking.
2011-11-02 11:25:19 -07:00
TJ Holowaychuk
e20777d21d Merge pull request #617 from sutiam/patch-2
add semicolon
2011-11-01 17:33:08 -07:00
sutiam
311ef7e7e7 add semicolon 2011-11-01 17:26:33 -07:00
Diego Varese
70b47d7dc1 Removed decoding of parameters when chunking the query string. This was used later on to construct the url to post to the socket.io server for connection and if we're adding custom parameters of our own to this url (for example for OAuth authentication) they were being sent decoded, which is wrong. 2011-11-01 15:27:15 -07:00
thekiur
9e92075cbb Removed useless object: closedA, probably fixed a memory leak 2011-11-01 23:31:58 +02:00
einaros
63043b3d5d fixes leak #608 2011-10-31 22:47:25 +01:00
einaros
92a3cce272 circumvents #602 .. although only a horribly malformed websocket connection could potentially cause this 2011-10-28 14:04:55 +02:00
Guillermo Rauch
8339c96e84 Merge pull request #596 from einaros/nodenext
Node v0.5+ compatibility
2011-10-28 01:30:18 -07:00
einaros
a125fcb1a4 further updates to chat example dependencies 2011-10-28 10:18:47 +02:00
einaros
97f634f18f further updates to irc example dependencies 2011-10-28 10:18:08 +02:00
einaros
82266cf202 updated stylus dependency in examples to node 0.5+ compatible version 2011-10-28 10:14:26 +02:00
einaros
be94641651 fixed irc example for nodenext 2011-10-28 10:12:52 +02:00
einaros
703d1d778e fixed chat example for nodenext 2011-10-28 10:10:45 +02:00
einaros
70c61fa84d Merge remote branch 'upstream/master' into nodenext 2011-10-28 10:10:26 +02:00
Guillermo Rauch
abd0326b06 Release 0.8.6 2011-10-27 20:10:18 +09:00
Guillermo Rauch
3e0b4488f8 Merge pull request #599 from 3rd-Eden/jsonptests
The server expects JSON.stringify'd packages
2011-10-27 02:44:50 -07:00
Arnout Kazemier
86908c3b4d The server expects JSON.stringify'd packages 2011-10-27 09:10:27 +02:00
Guillermo Rauch
5491c2798e Merge branch 'master' of github.com:LearnBoost/socket.io 2011-10-27 12:54:03 +08:00
Guillermo Rauch
a9def6e209 Merge pull request #598 from 3rd-Eden/utf8
charset=UTF8
2011-10-26 21:53:46 -07:00
Guillermo Rauch
c7a2dc45c8 Merge pull request #591 from einaros/master
Resubmission of: Minor potential issues corrected in websocket transports
2011-10-26 21:51:52 -07:00
Guillermo Rauch
cf76b13145 Added JSON decoding on jsonp-polling transport.
This is due to browser's buggy handling of outgoing \n
2011-10-27 12:45:19 +08:00
Guillermo Rauch
b6b90e8de6 Release 0.8.6 2011-10-27 12:40:30 +08:00
Guillermo Rauch
d51046339f Fixed test runner on IE6/7. Odd jquery bug 2011-10-27 12:27:26 +08:00
Guillermo Rauch
9a05dca2f9 Bumped jquery 2011-10-27 12:27:20 +08:00
Guillermo Rauch
c1de89007a Unicode snowman for you 2011-10-27 12:09:09 +08:00
Guillermo Rauch
3480429371 Fixed handling of \n by jsonp-polling 2011-10-27 12:08:06 +08:00
Guillermo Rauch
3d65f393d3 Fixed jsonp-polling feature detection.
JSONP-Polling can't run inside of a webworker.
2011-10-27 11:36:48 +08:00
Guillermo Rauch
ff6d17ff18 Added temporary hack for indicator detection in ff webworker.
We must add `util.ua.gecko` instead.
2011-10-27 11:32:59 +08:00
Guillermo Rauch
572296a7ff Added proper check for document in global. 2011-10-27 11:32:44 +08:00
Guillermo Rauch
e2e878787b Merge branch 'master' of github.com:LearnBoost/socket.io-client 2011-10-27 11:23:36 +08:00
Guillermo Rauch
dde633bc60 Merge pull request #321 from jscharlach/master
Checking connection state prior to resetting close timeout
2011-10-26 20:23:03 -07:00
Guillermo Rauch
ec5d96539c Fixed host discovery lookup [holic]. 2011-10-27 11:21:18 +08:00
Arnout Kazemier
db2a17f279 charset=UTF8 2011-10-26 11:48:41 +02:00
einaros
3a07cc29bd added return for clarity 2011-10-26 08:21:22 +02:00
einaros
89a5134b66 corrected whitespace 2011-10-25 23:46:36 +02:00
einaros
6ca42fdc8f well thats five minutes of my life ill never get back. thanks. 2011-10-25 22:53:37 +02:00
einaros
a9f81a59c2 ensure backwards compatibility 2011-10-25 22:12:55 +02:00
einaros
8a90bf5234 re-enabled flashsocket tests, after bugfixes in flashsocket transport 2011-10-25 21:26:57 +02:00
einaros
357a9cb870 fixed race condition and scoping bug 2011-10-25 21:25:44 +02:00
einaros
8253ed573a ignore exception on port change 2011-10-25 19:47:39 +02:00
einaros
3f55d82bf7 added node v4 client closing compatibility 2011-10-25 13:30:06 +02:00
einaros
08467d4e12 temporarily disabled flash policy server tests 2011-10-25 13:19:39 +02:00
einaros
cb70f7873f moved default error handler 2011-10-25 13:18:40 +02:00
einaros
57b0ce73c7 resolve race condition 2011-10-25 13:09:04 +02:00
einaros
25f97431d4 set nodelay 2011-10-25 13:08:49 +02:00
einaros
f931af5758 fixed xhr-polling tests, in a way similar to jsonp 2011-10-25 10:45:20 +02:00
einaros
c88ea9ed61 fixed websocket testing, removed seemingly irrelevant tests 2011-10-25 10:42:18 +02:00
einaros
2bdee1b28f use new agent 2011-10-25 10:41:58 +02:00
einaros
a1f0b6c361 manager tests now pass properly 2011-10-24 21:26:15 +02:00
jscharlach
172db2035f Adding a check to the close timeout reset so that it won't reset the timeout for a closed connection. This is necessary because the server sends a 'disconnect' message after the client runs a socket.disconnect() which causes the client to reset the close timeout and effectively hang until the the timeout occurs. 2011-10-24 13:26:05 -03:00
einaros
c1e64b90a4 added warning message from default error event handler 2011-10-23 23:03:23 +02:00
einaros
79c3d84a98 circumvent race condition due to changed http bits in 0.5 2011-10-23 14:21:22 +02:00
einaros
f6c376d087 another stab at proper 0.5 agent socket closing 2011-10-23 14:20:21 +02:00
einaros
bc15077ecc further checks to not close sockets that aren't there 2011-10-23 14:14:48 +02:00
einaros
28bf55e572 patched a few compatibility issues in node-websocket-server 2011-10-23 00:43:07 +02:00
einaros
f213d69e17 check that there's actually a socket to close 2011-10-22 14:39:59 +02:00
einaros
aa6f228ccf updated to use NODE_PATH rather than old expresso include argument 2011-10-22 14:39:33 +02:00
einaros
553b9e9d68 updated test to work with 0.5 2011-10-22 13:30:30 +02:00
einaros
ec6e43d7ee updated expresso dep 2011-10-22 13:30:12 +02:00
einaros
48140cf8a0 node 0.5 way of closing agent sockets 2011-10-22 13:29:57 +02:00
einaros
796bc9e95b capture error emitted by the server, which happens a lot with node 0.5+ 2011-10-22 13:28:54 +02:00
einaros
67495ad8a9 case-insensitive match for websocket upgrade, in all websocket transports 2011-10-22 10:21:10 +02:00
einaros
bee1efb11c fixes #555 2011-10-22 10:16:48 +02:00
Guillermo Rauch
c3e6fe3eef Merge pull request #307 from uoksana/master
Readme file fixes
2011-10-19 00:15:28 -07:00
Guillermo Rauch
bbdf68975c Merge branch 'master' into webworker 2011-10-19 00:13:33 -07:00
Guillermo Rauch
a935aeb20f Merge pull request #313 from Leonya/master
Google Closure Compiler shows a warning for this line of code
2011-10-19 00:12:20 -07:00
Guillermo Rauch
12f61cf122 Merge pull request #315 from danielbeardsley/disconnect_immediately
Remove closeTimeout wait between transport disconnect and socket.io disconnect
2011-10-19 00:11:24 -07:00
Guillermo Rauch
cd35cccfac Merge pull request #246 from 3rd-Eden/jsonppollingindicator
This hack kills the loading indicator in FF
2011-10-19 00:11:03 -07:00
Guillermo Rauch
c8d7246dff Merge pull request #267 from 3rd-Eden/fix/utf8
We totally missed the `ascii_only` option, so no more filty hacks
2011-10-19 00:10:47 -07:00
Guillermo Rauch
332e5d9c08 Build 2011-10-18 16:32:16 -07:00
Guillermo Rauch
7c2dbf3ba5 Added webworker 2011-10-18 16:31:53 -07:00
Guillermo Rauch
72a05035e0 Added webworker cs acceptance test 2011-10-18 16:31:28 -07:00
Guillermo Rauch
2f21c326d7 Exposed uri() global to access socket.io of currently running acceptance test. 2011-10-18 16:31:06 -07:00
Guillermo Rauch
ef0d5f86a2 Added webworker server side acceptance test. 2011-10-18 16:30:03 -07:00
Guillermo Rauch
241eda3d43 Fixed swfobject and web_socket.js to not assume window. 2011-10-18 16:29:21 -07:00
Guillermo Rauch
c7e107a19c Added reference to global object 2011-10-18 16:29:07 -07:00
Guillermo Rauch
4be456f65c Fixed CORS detection for webworker 2011-10-18 16:28:46 -07:00
Guillermo Rauch
6ffd18abe9 Fix defer for webkit in a webworker. 2011-10-18 16:28:19 -07:00
Guillermo Rauch
f8deca10e6 Fixed io.util.request to not rely on window. 2011-10-18 16:27:19 -07:00
Guillermo Rauch
d376099930 Fixed; find WebSocket in global instead of window 2011-10-18 16:26:53 -07:00
Guillermo Rauch
4300d8364f FIxed; use global instead of window and dont rely on document. 2011-10-18 16:26:26 -07:00
Guillermo Rauch
ab60690883 Fixed; JSON-P handshake if CORS is not available 2011-10-18 16:26:01 -07:00
Guillermo Rauch
8542fcda19 Fixed, use shortcut for options. 2011-10-18 16:25:38 -07:00
Guillermo Rauch
933874a906 Fixed; look up location in global object. 2011-10-18 16:25:11 -07:00
Guillermo Rauch
91de0cb7ad Leverage static middleware in mounted /test. 2011-10-18 14:00:51 -07:00
Guillermo Rauch
120924f626 Merge pull request #582 from chees/patch-1
Changed sockets.emit to io.sockets.emit to get the example working.
2011-10-16 10:00:20 -07:00
Christiaan
acdbacb25e Changed sockets.emit to io.sockets.emit to get the example working. 2011-10-16 14:59:14 +03:00
TJ Holowaychuk
cde6a38218 Merge pull request #580 from 3rd-Eden/performance
Added a benchmark runner + profile option
2011-10-15 12:12:14 -07:00
Guillermo Rauch
e69c185e17 Merge pull request #581 from dshaw/patch/520
Fixes #520. Updates to latest node_redis.
2011-10-15 11:47:41 -07:00
Daniel Shaw
8cab86af1c Fixes #520. Updates to latest node_redis. 2011-10-15 11:43:48 -07:00
Arnout Kazemier
00557f663a Added error and heartbeat decoding 2011-10-15 15:30:23 +02:00
Arnout Kazemier
54c22aea96 Added a benchmark runner + profile option 2011-10-15 15:10:35 +02:00
Guillermo Rauch
a9929c916f Merge pull request #578 from 3rd-Eden/performance
Use benchmark.js instead, so we can benchmark 0.5.9
2011-10-13 13:42:19 -07:00
Arnout Kazemier
1d66b6b5da Some tiny optimizations 2011-10-13 22:31:52 +02:00
Arnout Kazemier
a75670c1c2 Use benchmark.js instead, so we can benchmark 0.5.9 2011-10-13 21:00:59 +02:00
Guillermo Rauch
373c729e66 Merge pull request #573 from 3rd-Eden/performance
Parser performance boost
2011-10-12 15:10:19 -07:00
Arnout Kazemier
7800003c5e Returned the switch for the decoder, optimized the switch for the encoder 2011-10-12 22:03:46 +02:00
Arnout Kazemier
b662f2e14e Optimized the loop, so the most commen packets are checked first 2011-10-12 21:53:38 +02:00
Arnout Kazemier
709c172444 http://cl.ly/402t2C133B2a1P0g1K0h <--- before http://cl.ly/363W080c2j261l3A1m3y <--- after ;o 2011-10-12 21:44:09 +02:00
Tj Holowaychuk
6d5ffa0d33 remove vbench dev dep
so people dont need node-canvas
2011-10-11 21:38:31 -07:00
Tj Holowaychuk
f8c7ff2782 Added decode/encode benchmarks 2011-10-11 16:00:15 -07:00
Arnout Kazemier
d9049f69c1 Merge branch 'master' of github.com:LearnBoost/socket.io into logger 2011-10-11 20:01:05 +02:00
Arnout Kazemier
10ffbd59e9 Use tty to detect if we should add colors or not by default. 2011-10-11 20:00:30 +02:00
Guillermo Rauch
175fe8573b Merge pull request #563 from 3rd-Eden/logger
Logger
2011-10-11 08:18:16 -07:00
Guillermo Rauch
0224e4ac5f Merge pull request #569 from 3rd-Eden/blacklist
Blacklist events
2011-10-11 08:13:55 -07:00
Arnout Kazemier
ecd20b0e1f Added support for blacklisting events that are emitted from the client side.
Currently it's possible for a client do .emit('disconnect') and this will trigger
the disconnect event on the server.. Which can lead to major issues.

We should black list that by default. You can override or add more events by adding
them to the `blacklist` setting
2011-10-11 10:40:22 +02:00
Arnout Kazemier
b8f6dc7810 Inital stab at blacklisting client side events 2011-10-11 09:53:26 +02:00
Guillermo Rauch
0339e745fd Merge pull request #564 from 3rd-Eden/bug/538
fixes #538
2011-10-10 13:23:51 -07:00
Arnout Kazemier
b3740e9ab6 fixes #538 2011-10-10 21:52:16 +02:00
Arnout Kazemier
0b7ed64082 Fixed logging options, closes #540 2011-10-10 21:32:54 +02:00
Arnout Kazemier
07b84f4400 Added a test to ensure that etags do no mess up far future headers 2011-10-10 21:06:58 +02:00
Guillermo Rauch
59e4c3b46c Merge pull request #562 from 3rd-Eden/static
Hardcore caching for pro's
2011-10-10 11:20:38 -07:00
Arnout Kazemier
0e3bbd0e16 Whoops 2011-10-10 20:02:37 +02:00
Arnout Kazemier
763fdd1c4e Added more hardcore caching fixes #558
Added tests against it
Added vary header for gzip
2011-10-10 20:01:28 +02:00
Guillermo Rauch
61bd23f0f9 Merge pull request #561 from einaros/master
Proper websocket test fixes, after patching node-websocket-client
2011-10-09 01:33:13 -07:00
Arnout Kazemier
8107c1a1e2 Added support for HEAD requests, closes #557 2011-10-08 15:46:23 +02:00
Arnout Kazemier
fa5b518110 Merge branch 'master' of github.com:LearnBoost/socket.io into static 2011-10-08 15:42:21 +02:00
einaros
b3df2836e9 properly cleaned up async websocket / flashsocket tests, after patching node-websocket-client 2011-10-08 12:02:31 +02:00
einaros
08568ee49e patched to properly shut down when a finishClose call is made during connection establishment 2011-10-08 12:01:46 +02:00
einaros
aba2d5e0ef removed empty console.log 2011-10-08 12:00:55 +02:00
Guillermo Rauch
dfebed38ab Release 0.8.5 2011-10-07 11:25:39 -07:00
Guillermo Rauch
d7a9e9e3f7 Release 0.8.5 2011-10-07 11:22:41 -07:00
Guillermo Rauch
51782fc5d7 Fixed websocket tests. 2011-10-07 11:07:33 -07:00
Guillermo Rauch
11f1a7c491 Merge pull request #347 from 3rd-Eden/socket.transport
Expose socket.transport
2011-10-07 10:07:05 -07:00
Daniel Beardsley
283b0119d6 Make underlying Transport disconnection trigger immediate socket.io disconnection
This solves the frustration of a client being aable to tell it's connection has been severed.
2011-10-06 00:23:34 -07:00
Arnout Kazemier
5573f7fcdf First stab of adding Expires + cache control headers for #558 2011-10-05 20:16:20 +02:00
Guillermo Rauch
1d743cfc84 Merge branch 'master' of github.com:LearnBoost/socket.io 2011-10-04 21:21:31 -07:00
Guillermo Rauch
21c01558fd Added tip [getify] 2011-10-04 21:21:20 -07:00
Guillermo Rauch
6d57445167 Fixed readme [getify] 2011-10-04 21:18:02 -07:00
Guillermo Rauch
52f6a5b124 Merge pull request #554 from einaros/master
Fixes issue #553: Origin verification brought into the client
2011-10-02 10:59:41 -07:00
einaros
2c3c73f045 corrected origin header name in test 2011-10-02 16:37:14 +02:00
einaros
54fc513fc9 fixes #553 - (re)verify origin in websocket transport implementations 2011-10-02 16:34:09 +02:00
einaros
0b1e43cb87 added binary support to the hybi 07-12 parsers as well 2011-10-02 15:31:36 +02:00
einaros
c8dabb225c added binary support to hybi-16 parser, refactored hybi tests somewhat 2011-10-02 15:19:17 +02:00
einaros
245dc12ade added fixes from hybi-07-12 which also apply to 16 2011-10-02 00:09:21 +02:00
Guillermo Rauch
7a405232a5 Merge pull request #550 from einaros/master
HyBi-16 support, and a few bugfixes
2011-10-01 12:15:16 -07:00
einaros
00f7ca1d02 fixed incorrect space chars 2011-10-01 14:45:20 +02:00
einaros
f1cea7e788 Merge branch 'master' of github.com:einaros/socket.io 2011-10-01 14:42:07 +02:00
einaros
050fcf7a83 websocket draft HyBi-16 support 2011-10-01 14:39:27 +02:00
Leonid Khachaturov
da060de77a Fix warning when compressing with Google Closure Compiler:
WARNING - If this if/for/while really shouldnt have a body, use {}
    for (var j = arr.length, i = i < 0 ? i + j < 0 ? 0 : i + j : i || 0;
        ^
2011-09-29 11:12:57 +02:00
Guillermo Rauch
563ff5419a Merge pull request #298 from 3rd-Eden/EE
Stop throwing errors when error occures in node
2011-09-27 18:12:57 -07:00
Guillermo Rauch
dfa350bea7 Revert "Expanded 'How to Use' in readme"
This reverts commit ed7cedd78f.
2011-09-26 13:27:52 -07:00
Guillermo Rauch
e5d5b99f0e Merge pull request #539 from AlexChesser/alex.chesser
Expanded 'How to Use' in readme
2011-09-26 13:26:42 -07:00
Alex Chesser
ed7cedd78f Expanded 'How to Use' in readme 2011-09-26 15:35:37 -04:00
einaros
a22eb70cfb Merge remote branch 'upstream/master' 2011-09-26 10:21:09 +02:00
einaros
2a81b25a5b fixed websocket continuation bugs 2011-09-26 10:14:19 +02:00
Utyasheva Oksana
4f41c8f99a fixed README. 2011-09-24 07:48:56 -07:00
Guillermo Rauch
7db146df47 Merge pull request #457 from 3rd-Eden/ACAO
access-control-allow-origin
2011-09-20 15:04:59 -07:00
Guillermo Rauch
6182dfff39 Merge pull request #532 from einaros/master
Fixes issue 523, and (unreported?) issue where flashsocket identifies as websocket
2011-09-20 10:03:42 -07:00
einaros
1ccd8cea6b Merge remote branch 'upstream/master' 2011-09-20 18:56:08 +02:00
einaros
f9ea04eb6b redirect actual transport name (such as flashsocket), if present, to the websocket version being loaded 2011-09-20 18:53:04 +02:00
einaros
ab9a5a1578 added test to ensure that websocket still identifies as .. websocket 2011-09-20 18:51:36 +02:00
einaros
3364a73a97 added done() call to end test 2011-09-20 18:45:01 +02:00
einaros
d02a7f415b added test for flashsocket name, to catch issues with various websocket versions 2011-09-20 18:41:06 +02:00
einaros
1874fd7c30 added transport option to websocket test client (for flashsocket testing) 2011-09-20 18:40:43 +02:00
einaros
3c4a04ea02 fixes #523. private 'payload' method in transport used from manager.js, wasn't present in hybi parser 2011-09-20 17:56:32 +02:00
Guillermo Rauch
1468917743 Merge pull request #529 from dshaw/patch/redisstore
Fix RedisStore
2011-09-19 10:06:52 -07:00
Arnout Kazemier
6df152cc5d Merge branch 'master' of github.com:LearnBoost/socket.io into ACAO
Conflicts:
	lib/manager.js
2011-09-13 21:45:51 +02:00
Daniel Shaw
c6b3549b61 Minimal RedisClient configs. 2011-09-12 00:20:40 -07:00
Daniel Shaw
f80ab2aae8 Merge branch 'master' of https://github.com/LearnBoost/socket.io 2011-09-11 23:06:23 -07:00
Arnout Kazemier
165662cc96 Stop throwing errors when error occures in node 2011-09-10 12:57:11 +02:00
Guillermo Rauch
b2f9f19d99 Merge pull request #391 from 3rd-Eden/static
Static
2011-09-07 09:39:30 -07:00
Guillermo Rauch
cb7304837c Ensured parser#decodePayload doesn't choke.
This addresses the situation where malformed data is supplied to the parser.
Fixes #510
2011-09-07 08:31:46 -07:00
Guillermo Rauch
9e6f58fe27 Release 0.8.4 2011-09-06 07:48:14 -07:00
Guillermo Rauch
d34723812c Release 0.8.4 2011-09-06 07:47:17 -07:00
Guillermo Rauch
e3fb39da3d Corrected comment; (fixes #433) 2011-09-03 14:33:00 -07:00
Guillermo Rauch
43f9d29c41 Fixed xDomain detection (fixes #462 from socket.io). 2011-09-03 14:30:52 -07:00
Guillermo Rauch
27ed6ca98a Fixed flashsocket flash version check (fixes #2547) [firejune] 2011-09-03 14:12:24 -07:00
Guillermo Rauch
cc275813b5 Updated changelog 2011-09-03 14:06:05 -07:00
Guillermo Rauch
42e27e857c Added unicode tests. 2011-09-03 13:26:22 -07:00
Guillermo Rauch
9d57245d65 Release 0.8.3 2011-09-03 12:42:45 -07:00
Guillermo Rauch
79dfa54105 Release 0.8.3 2011-09-03 12:40:30 -07:00
Guillermo Rauch
9a05b3597e Fixed test for default flash port. 2011-09-03 12:34:36 -07:00
Guillermo Rauch
68dfb5216b Build 2011-09-03 12:25:57 -07:00
Guillermo Rauch
2a5c7b2c5b Added parser test for newline. 2011-09-03 12:24:52 -07:00
Guillermo Rauch
41f38b60e8 Added parser test for decoding newline. 2011-09-03 12:23:44 -07:00
Guillermo Rauch
85991d9e6a Added acceptance test for sending newlines. 2011-09-03 12:22:17 -07:00
Guillermo Rauch
cbca52d9c7 Fixed \n parsing for non-JSON packets. 2011-09-03 12:16:45 -07:00
Guillermo Rauch
a9bbc38919 Fixed \n parsing for non-JSON packets (fixes #479). 2011-09-03 12:14:07 -07:00
Guillermo Rauch
e282ab0e63 Fixed transport message packet logging.
Fixed style.
2011-09-03 12:13:50 -07:00
Guillermo Rauch
20f7100e08 Build 2011-09-03 10:58:17 -07:00
Guillermo Rauch
24c30177de Fixed; make Socket.IO XHTML doctype compatible (fixes #460 from server) 2011-09-03 10:57:49 -07:00
Guillermo Rauch
7a863e6cc8 Fixed support for Node.JS running socket.io-client. 2011-09-03 10:57:15 -07:00
Guillermo Rauch
546d5203d4 Added test case for #476 to prevent regressions. 2011-09-03 10:49:08 -07:00
Guillermo Rauch
69941e602b Fixed emission of error event resulting in an uncaught exception if unhandled (fixes #476). 2011-09-03 10:48:31 -07:00
Guillermo Rauch
7ac9c2e888 Fixed style 2011-09-03 10:48:23 -07:00
Guillermo Rauch
fa1f50d173 Fixed; allow for falsy values as the configuration value of log level (fixes #491). 2011-09-03 10:29:51 -07:00
Guillermo Rauch
20ddd5f11a Merge branch 'master' of github.com:LearnBoost/socket.io 2011-09-03 10:19:17 -07:00
Guillermo Rauch
e1891fd615 Fixed repository URI in package.json. Fixes #504. 2011-09-03 10:18:52 -07:00
Guillermo Rauch
fc53c5b2be Fixed latest commit; point repository to -client 2011-09-03 10:18:27 -07:00
Guillermo Rauch
58447ac365 Merge branch 'master' of github.com:LearnBoost/socket.io-client 2011-09-03 10:17:15 -07:00
Guillermo Rauch
314e335d6f Updated repository name. 2011-09-03 10:17:00 -07:00
Daniel Shaw
cc0a96a8d9 Wow, really. 2011-09-01 14:22:53 -07:00
Daniel Shaw
7b2b302022 merge learnboost/master 2011-09-01 14:00:17 -07:00
Guillermo Rauch
4d66f78ca2 Merge pull request #502 from einaros/master
Correction on previous pull req, which left out status code
2011-09-01 12:12:32 -07:00
einaros
6db6db41a2 corrected passing of status code for handshake error 2011-08-31 19:55:28 +02:00
Guillermo Rauch
0419213a74 Merge pull request #273 from 3rd-Eden/feature/policy
Feature/policy
2011-08-31 09:35:34 -07:00
Guillermo Rauch
713baa40e1 Merge pull request #455 from 3rd-Eden/update/package
Added socket.io-flashsocket default port
2011-08-31 09:32:16 -07:00
Guillermo Rauch
7c196f5b32 Merge pull request #501 from einaros/master
Fixes issue commented on in #377
2011-08-31 08:50:44 -07:00
einaros
bd360a15ef added text/plain content-type to handshake responses 2011-08-31 14:48:43 +02:00
einaros
ae7f25332a switched \u**** to \x** for single byte writes, as the former doesn't really make any sense 2011-08-30 11:17:32 +02:00
einaros
63fc15d276 style changes 2011-08-30 11:03:50 +02:00
Guillermo Rauch
d88575dadf Release 0.8.2 2011-08-29 17:07:29 -07:00
Guillermo Rauch
93c963e30f Release 0.8.1 2011-08-29 17:07:29 -07:00
einaros
72a79e5cec fixed utf8 bug in send framing 2011-08-29 17:07:29 -07:00
Markus Hedlund
140ed41907 Fixed typo. 2011-08-29 17:07:29 -07:00
einaros
12fc168516 fixed bug in send framing for over 64kB of data 2011-08-29 17:07:29 -07:00
einaros
2c3dc42ae8 corrected ping handling from websocket transport, and added warning output on parser error 2011-08-29 17:07:29 -07:00
einaros
48dadd8e10 joined compatible hybi protocol handlers and updated test reference 2011-08-29 17:07:29 -07:00
einaros
ce4c46b37d fixed Parser library path and did some code cleanup 2011-08-29 17:07:29 -07:00
Guillermo Rauch
c8938a99b2 Release 0.8.0 2011-08-29 17:07:29 -07:00
Guillermo Rauch
b7998e815a Renamed wsver/ -> websocket/ 2011-08-29 17:07:29 -07:00
Guillermo Rauch
444229a9dc Changed protocols require path. 2011-08-29 17:07:28 -07:00
einaros
b69dac6f4d added hybi07 tests 2011-08-29 17:07:28 -07:00
einaros
94fdbadaec added initial hybi07 protocol parser 2011-08-29 17:07:28 -07:00
Guillermo Rauch
c4b23246b4 Release 0.7.11 2011-08-29 17:07:28 -07:00
einaros
5186788969 cleanups and comments 2011-08-29 17:07:28 -07:00
Guillermo Rauch
169ad8245f Release 0.7.10 2011-08-29 17:07:28 -07:00
einaros
71e013a197 added test and support for really long messages, but capped by 32 bit 2011-08-29 17:07:28 -07:00
einaros
7e60d37171 minor cleanups 2011-08-29 17:07:28 -07:00
einaros
a9e9e64eab updated to work with two-level websocket versioning 2011-08-29 17:07:28 -07:00
einaros
39ae8d4629 added hybi10 close operation 2011-08-29 17:07:28 -07:00
einaros
a075870308 added hybi10 parser tests 2011-08-29 17:07:28 -07:00
einaros
186649102d added hybi10 support 2011-08-29 17:07:28 -07:00
einaros
bb2e100e7f Added http referrer verification to manager.js verifyOrigin + tests for origins setting 2011-08-29 17:07:28 -07:00
Guillermo Rauch
7b5335d1ed Merge pull request #286 from 3rd-Eden/FF6
Ff6
2011-08-29 12:34:17 -07:00
Arnout Kazemier
67f399263a Fixed merge fail 2011-08-29 21:32:44 +02:00
Arnout Kazemier
70d45aa8a9 Merge branch 'master' of github.com:LearnBoost/socket.io-client into FF6
Conflicts:
	lib/transports/websocket.js
2011-08-29 21:30:13 +02:00
Arnout Kazemier
ecb370e820 Removed '' 2011-08-29 21:28:00 +02:00
Guillermo Rauch
2c5fa40c0d Release 0.8.2 2011-08-29 10:36:23 -07:00
Guillermo Rauch
62feaa3ba8 Release 0.8.2 2011-08-29 10:33:41 -07:00
Guillermo Rauch
fcd2552a5a Style fixes
Rebuild
2011-08-29 10:32:17 -07:00
Guillermo Rauch
0b61eda84c Release 0.8.1 2011-08-29 09:42:16 -07:00
Guillermo Rauch
3a8943a817 Release 0.8.1 2011-08-29 09:39:01 -07:00
Guillermo Rauch
23ba929f3f Merge branch 'master' of github.com:LearnBoost/socket.io 2011-08-29 09:37:54 -07:00
einaros
a44da0fb74 javascript encoding issue 2011-08-29 11:51:57 +02:00
einaros
b9729a7679 fixed issue where websocket detection runs before flashsocket initialization, causing the latter not to work 2011-08-29 11:37:23 +02:00
einaros
13647075f2 fixed utf8 bug in send framing 2011-08-29 09:43:12 +02:00
Guillermo Rauch
4c9414c4c1 Merge pull request #486 from Znarkus/patch-1
Fixed typo.
2011-08-28 23:57:28 -07:00
Markus Hedlund
ec88f95722 Fixed typo. 2011-08-29 20:23:38 +03:00
einaros
f377cd631e fixed bug in send framing for over 64kB of data 2011-08-29 08:33:30 +02:00
einaros
e41aab84f8 corrected ping handling from websocket transport, and added warning output on parser error 2011-08-29 08:00:03 +02:00
einaros
0a6c78cbb8 joined compatible hybi protocol handlers and updated test reference 2011-08-29 07:56:40 +02:00
einaros
004130cb11 fixed Parser library path and did some code cleanup 2011-08-29 07:30:29 +02:00
Guillermo Rauch
a300223122 Release 0.8.0 2011-08-28 15:42:19 -07:00
Guillermo Rauch
0769c40368 Renamed wsver/ -> websocket/ 2011-08-28 15:41:55 -07:00
Guillermo Rauch
355203afdb Changed protocols require path. 2011-08-28 15:41:13 -07:00
Guillermo Rauch
2b416c25f6 Bump version. 2011-08-28 15:38:39 -07:00
Guillermo Rauch
f533ae5322 Release 0.8.0 2011-08-28 15:28:55 -07:00
Guillermo Rauch
4fdb7f73f7 Changed detection of WebSocket object.
Fixed; removed pollution of window.
2011-08-28 15:23:11 -07:00
einaros
a30aaf5a3e added mozilla MozWebSocket redirect 2011-08-28 11:36:22 +02:00
einaros
46bfcd0d83 Merge remote branch 'upstream/master' 2011-08-28 11:20:01 +02:00
einaros
46b2f86372 added hybi07 tests 2011-08-28 11:19:22 +02:00
einaros
e5c86178f5 added initial hybi07 protocol parser 2011-08-28 10:44:07 +02:00
Guillermo Rauch
0c31d6eabf Release 0.7.11 2011-08-27 15:29:33 -07:00
Guillermo Rauch
1f8e07d0d0 Release 0.7.11 2011-08-27 15:28:09 -07:00
einaros
0e08d67e48 cleanups and comments 2011-08-27 23:43:16 +02:00
Guillermo Rauch
42904cb3d7 Release 0.7.10 2011-08-27 11:42:55 -07:00
Guillermo Rauch
434a6c2965 Release 0.7.10 2011-08-27 11:38:19 -07:00
einaros
8efb1bc6e2 added test and support for really long messages, but capped by 32 bit 2011-08-27 19:21:01 +02:00
einaros
8bdf221935 minor cleanups 2011-08-27 18:42:17 +02:00
einaros
899fb7faa1 updated to work with two-level websocket versioning 2011-08-27 18:27:52 +02:00
einaros
34622b74ef added hybi10 close operation 2011-08-27 17:54:13 +02:00
einaros
d327976064 added hybi10 parser tests 2011-08-27 17:45:39 +02:00
einaros
07b9c4696d added hybi10 support 2011-08-27 17:41:49 +02:00
Daniel Shaw
dd30de3c5a Merge remote-tracking branch 'learnboost/master' 2011-08-16 15:26:30 -07:00
einaros
7a5913b8a6 Added http referrer verification to manager.js verifyOrigin + tests for origins setting 2011-08-16 07:46:57 +02:00
Guillermo Rauch
d376333828 Merge pull request #281 from 3rd-Eden/failingfail
Fix for failing fallback in websockets
2011-08-15 15:50:35 -07:00
Arnout Kazemier
cf6de27faf Fix for failing fallback in websockets 2011-08-16 00:39:54 +02:00
Guillermo Rauch
fbb268fbce Release 0.7.9 2011-08-12 10:19:18 -07:00
Guillermo Rauch
bef84f2082 Release 0.7.9 2011-08-12 10:17:29 -07:00
Guillermo Rauch
9f2a75970c Build 2011-08-12 10:16:09 -07:00
Guillermo Rauch
a3b3caa0b2 Removed test handler for removed test. 2011-08-12 10:13:51 -07:00
Guillermo Rauch
72e06aff1b Fixed socket namespace connect test.
Remove broken alternative namespace connect test.
2011-08-12 10:13:24 -07:00
Guillermo Rauch
0b6c3db573 Added check on Socket#onConnect to prevent double connect events on the main manager. 2011-08-12 10:12:42 -07:00
Guillermo Rauch
a31c267e83 Bumped version. 2011-08-12 06:56:26 -07:00
Guillermo Rauch
b82fd79f57 Updated package.json socket.io-client and bumped version. 2011-08-12 06:55:37 -07:00
Guillermo Rauch
fdcc8c74b8 Updated build with version. 2011-08-12 06:47:48 -07:00
Guillermo Rauch
e917aa0bbc Build 2011-08-12 06:46:22 -07:00
Guillermo Rauch
1771590dcf Merge pull request #276 from 3rd-Eden/bug/458
Fixes #458 #385
2011-08-12 06:36:58 -07:00
Arnout Kazemier
8fdf4e2cf5 Fixes #458 #385 2011-08-11 12:00:33 +02:00
Arnout Kazemier
e269fcaf0d Fixed semicolon 2011-08-10 22:58:13 +02:00
Arnout Kazemier
a8c61b0001 undo 2011-08-10 22:57:25 +02:00
Arnout Kazemier
4708480e7d Added access control for cross domain xhr handshakes 2011-08-10 22:35:30 +02:00
Arnout Kazemier
00b75759f1 Added socket.io-flashsocket default port 2011-08-09 19:33:27 +02:00
Arnout Kazemier
4f34905288 Merge branch 'master' of github.com:LearnBoost/socket.io-client into feature/policy 2011-08-09 19:21:28 +02:00
Arnout Kazemier
6609dee4db Added default socket.io-flashsocket port 2011-08-09 19:21:01 +02:00
Guillermo Rauch
f85ce74a1f Merge pull request #446 from 3rd-Eden/testsuite
Testsuite fixes
2011-08-08 12:07:07 -07:00
Daniel Shaw
30284944b1 Merge remote-tracking branch 'learnboost/master' 2011-08-08 11:08:28 -07:00
Guillermo Rauch
65f1399a44 Release 0.7.8 2011-08-08 08:06:30 -07:00
Guillermo Rauch
26ead25338 Release 0.7.5 2011-08-08 07:54:37 -07:00
Guillermo Rauch
f92b28cf41 Build 2011-08-08 07:44:05 -07:00
Guillermo Rauch
95c8b66864 Merge pull request #274 from 3rd-Eden/node
Node support
2011-08-07 15:00:11 -07:00
Arnout Kazemier
ef8be0e5b7 Merge branch 'bug/268/2' of github.com:3rd-Eden/Socket.IO into node 2011-08-07 23:50:16 +02:00
Arnout Kazemier
9ad05ab6d2 Passes test 2011-08-07 23:48:52 +02:00
Arnout Kazemier
00a8c52cc1 I did one undo to much before saving it. Fixed uniqueURI again 2011-08-07 23:38:44 +02:00
Arnout Kazemier
f544d5fb43 Completed refactor of #240 Fixes #208
Updated package.json
Fixed ineffecient document check
2011-08-07 23:30:59 +02:00
Arnout Kazemier
e0d3bdb4ac We decided to follow the inherit of node. So we only merge it for transport that
need it
2011-08-07 21:27:11 +02:00
Arnout Kazemier
f32832fed3 Added xhr-transport support on node 2011-08-07 20:30:09 +02:00
Arnout Kazemier
634fdaf2a7 Merge branch 'bug/268/2' of github.com:3rd-Eden/Socket.IO into node 2011-08-07 20:23:50 +02:00
Arnout Kazemier
f4e8abd4ec Inital checkin on Node support 2011-08-07 19:37:56 +02:00
Daniel Shaw
559d36601d Merge remote-tracking branch 'learnboost/master' 2011-08-06 19:07:27 -07:00
Arnout Kazemier
533b4f539f Fixed comment block 2011-08-06 20:04:13 +02:00
Arnout Kazemier
46f9733d4e Fixed small typo, and tested it with server intergration. Flash socket is answered
using the net server on a different port
2011-08-06 17:04:21 +02:00
Arnout Kazemier
7e57687ae9 Fixes #268 , without reconenct branch now <3 2011-08-05 21:21:30 +02:00
Arnout Kazemier
e664c716e6 Added support for different policy file ports without having to port forward 843
on the server side
2011-08-05 15:24:16 +02:00
Arnout Kazemier
6379e08655 code style 2011-08-05 12:33:40 +02:00
Arnout Kazemier
a39f2a1464 We totally missed the ascii_only option, so no more filty hacks 2011-08-05 12:29:47 +02:00
Arnout Kazemier
894ec9f84e Make sure we only do garbage collection when the server we receive
is actually ran.
2011-08-04 22:03:55 +02:00
Guillermo Rauch
d86ffcf06d Merge pull request #408 from 3rd-Eden/gc
Garbage collection
2011-08-04 11:50:39 -07:00
Arnout Kazemier
ab5beaff63 Fix 2011-08-04 20:32:49 +02:00
Arnout Kazemier
f0ef33b45f Merge branch 'master' of github.com:LearnBoost/socket.io into gc
Conflicts:
	lib/manager.js
2011-08-04 20:32:43 +02:00
Daniel Shaw
1fa158c663 Merge with learnboost/master 2011-08-03 13:22:36 -07:00
Guillermo Rauch
7fbf340c63 Fixed builder test 2011-08-03 12:01:19 -07:00
Guillermo Rauch
15ee167ca9 Changed util.inherit to replicate Object.create / __proto__ 2011-08-03 12:00:31 -07:00
Guillermo Rauch
1d4b9e3389 Merge pull request #265 from 3rd-Eden/query
Reverted a merge/upstream fail that removed a vital part of the implement
2011-08-02 16:03:31 -07:00
Guillermo Rauch
6392a40388 Merge pull request #266 from 3rd-Eden/bugs/ie8
Small test case clean up
2011-08-02 16:03:19 -07:00
Arnout Kazemier
0ab37174dd Reverted a merge/upstream fail that removed a vital part of the implementation 2011-08-03 00:41:32 +02:00
Guillermo Rauch
f441561a8d Merge pull request #228 from 3rd-Eden/query
Query
2011-08-02 15:36:03 -07:00
Arnout Kazemier
b235e709de Merge branch 'master' of github.com:LearnBoost/socket.io-client into query
Conflicts:
	support/test-runner/app.js
	test/socket.test.js
2011-08-03 00:27:07 +02:00
Arnout Kazemier
6cf4577a90 seems like this would work.. 2011-08-02 23:16:02 +02:00
Arnout Kazemier
846b3b3e40 Typo and removed the throw error 2011-08-02 22:49:57 +02:00
Guillermo Rauch
dd0b3b9d53 Fixed; make counter local so that acceptance tests can be run multiple times. 2011-08-02 11:02:21 -07:00
Guillermo Rauch
d277188422 Removed TRANSPORT from Makefile otherwise it's not overrideable. 2011-08-02 11:00:10 -07:00
Guillermo Rauch
dd60febd55 Build 2011-08-02 10:55:18 -07:00
Guillermo Rauch
66925b26f6 Merge branch 'master' of github.com:LearnBoost/socket.io-client
Conflicts:
	support/test-runner/app.js
2011-08-02 10:54:57 -07:00
Guillermo Rauch
0f434dfb41 Build 2011-08-02 10:54:13 -07:00
Guillermo Rauch
15414cba65 Added test encoding a payload test 2011-08-02 10:53:56 -07:00
Guillermo Rauch
89506b324f Commented out forced transports from test runner
Added additional test
2011-08-02 10:53:33 -07:00
Dylan Greene
a51fe07420 Updated the package location. 2011-08-01 14:44:11 -03:00
Arnout Kazemier
a631f86b3b Merged with upstream master 2011-07-31 10:22:54 +02:00
Guillermo Rauch
a4ec5aafa6 Merge pull request #363 from dvv/489bc860d2f050a7925e602a6d16c428f2784b40
small cleanup
2011-07-30 20:32:39 -07:00
Guillermo Rauch
984639ba67 Merge pull request #381 from 3rd-Eden/alias
Added alias for to to in and in to to
2011-07-30 20:27:30 -07:00
Guillermo Rauch
9923c1dee9 Merge branch 'master' of github.com:LearnBoost/socket.io 2011-07-30 20:23:35 -07:00
Guillermo Rauch
1b0a4849df Added test (fixes #380). 2011-07-30 20:21:13 -07:00
Guillermo Rauch
4fc43f322f Changed; make sure sio#listen passes options to both HTTP server and socket.io manager.
Added docs for sio#listen.
2011-07-30 20:20:31 -07:00
Guillermo Rauch
5c0f78ab02 Added options parameter support for Manager constructor. 2011-07-30 20:19:38 -07:00
Guillermo Rauch
d8c7060cc8 Merge pull request #396 from 3rd-Eden/xxs
Potential fix for #372
2011-07-30 18:49:47 -07:00
Guillermo Rauch
b0335b0a61 Merge pull request #339 from 3rd-Eden/333
Don't require redis by default
2011-07-30 18:47:41 -07:00
Guillermo Rauch
a1797ccd4b Merge pull request #337 from 3rd-Eden/handshakeData
Expose path and querystring in handshakeData
2011-07-30 18:47:12 -07:00
Guillermo Rauch
a1c997bc58 Merge pull request #401 from Pita/master
Send response once we got all POST data, not immediately
2011-07-30 18:36:08 -07:00
Guillermo Rauch
0b9b28d251 Merge pull request #409 from 3rd-Eden/bug/407
Fix for #407
2011-07-30 17:59:06 -07:00
Guillermo Rauch
a79b2fa761 Added memory leaks tests. 2011-07-30 17:53:35 -07:00
Guillermo Rauch
195eba74de Added assertvanish dev dependency. 2011-07-30 17:53:22 -07:00
Guillermo Rauch
3edebe5d61 Added test-leaks Makefile task. 2011-07-30 17:53:14 -07:00
Guillermo Rauch
b56389fbc8 Removed auto npm-linking from make test. 2011-07-30 14:46:54 -07:00
Guillermo Rauch
203293db0b Merge pull request #413 from 3rd-Eden/update/package
updated package.json with new build of policyfile and redis
2011-07-30 14:33:09 -07:00
Guillermo Rauch
2b7ea448c4 Merge pull request #416 from 3rd-Eden/test/374
Added testcase to prevent #374 from happening again
2011-07-30 14:32:51 -07:00
Guillermo Rauch
c627f1b7d0 Merge pull request #421 from 3rd-Eden/bug/heartbeat
Make sure that you can disable heart beats
2011-07-30 14:32:34 -07:00
Guillermo Rauch
39348defe7 Merge pull request #250 from DanielBaulig/issue-247
Fix for Issue 247
2011-07-29 21:09:13 -07:00
Guillermo Rauch
1ccd77a97c Merge pull request #253 from 3rd-Eden/bug/252
fix for #252 only the last response was send to the server
2011-07-29 21:07:13 -07:00
Guillermo Rauch
d261c892ff Merge pull request #254 from 3rd-Eden/update/package
Update/package
2011-07-29 21:06:47 -07:00
Daniel Shaw
831f1baa4a Merge remote-tracking branch 'learnboost/master' 2011-07-28 16:38:48 -07:00
Guillermo Rauch
9c30c315e6 Merge pull request #258 from 3rd-Eden/test/transports
Added the ability to specify the transport that needs to be tested
2011-07-28 11:10:00 -07:00
Arnout Kazemier
cb1816f4a2 Added the ability to specify the transport that needs to be tested 2011-07-28 19:58:27 +02:00
Arnout Kazemier
eccb04dcd2 small code clean up 2011-07-28 15:15:46 +02:00
Guillermo Rauch
298c7443a6 Fixed #426 2011-07-27 12:32:47 -07:00
Guillermo Rauch
4c20afd4b7 Merge pull request #346 from ericz/patch-1
Change `;` typo to `,` in first example
2011-07-26 01:48:22 -07:00
Arnout Kazemier
573e1d61c8 Added test case for encoding issue 2011-07-26 10:35:13 +02:00
Arnout Kazemier
c92d02c430 code cleanup 2011-07-26 10:16:17 +02:00
Arnout Kazemier
f090fafb0f Fix for https://github.com/LearnBoost/socket.io/issues/422 2011-07-26 10:14:14 +02:00
Arnout Kazemier
a50b83996f updated uglify to latest version 2011-07-26 09:42:47 +02:00
Arnout Kazemier
6e8325e78f fix for #252 only the last response was send to the server 2011-07-25 22:53:53 +02:00
Arnout Kazemier
f689434f61 Make sure that you can disable heart beats 2011-07-25 22:12:48 +02:00
Arnout Kazemier
b694ee68c9 Added testcase to prevent #374 from happening again 2011-07-24 13:21:30 +02:00
Guillermo Rauch
8b22ca2ffd Merge pull request #415 from 3rd-Eden/bug/rooms
Bug/rooms
2011-07-24 02:30:36 -07:00
Arnout Kazemier
5c50c4844f fixed missing done() that cuased the suite to timeout 2011-07-24 11:27:43 +02:00
Arnout Kazemier
4fcad6e4bc updated package.json with new build of policyfile and redis 2011-07-23 22:59:32 +02:00
Arnout Kazemier
3b2316e0d8 Fixed rooms memory leak 2011-07-23 22:55:29 +02:00
Daniel Baulig
15fbf0eb21 Fixed namespaces not reconnecting after disconnect 2011-07-22 23:32:48 +02:00
Daniel Baulig
1919425c5b Fixed builder LOC test case 2011-07-22 23:29:39 +02:00
Arnout Kazemier
a821cce390 Fix for #407 2011-07-22 22:52:20 +02:00
Arnout Kazemier
abe142ac66 Merge branch 'master' of github.com:LearnBoost/socket.io into gc 2011-07-22 21:42:09 +02:00
Arnout Kazemier
5eff0e5ca7 Small clean up, so the the code makes a bit more sense 2011-07-22 21:37:13 +02:00
Guillermo Rauch
c06242efd3 Merge pull request #383 from AD7six/feature/no-duplicate-clients-in-rooms
prevent duplicate references in rooms - probable fix for #379
2011-07-22 07:51:54 -07:00
Guillermo Rauch
7f2d69f6d8 Merge pull request #241 from 3rd-Eden/depends
CodeStyle fixes and added xhr-polling as JSONP dependency
2011-07-21 13:54:55 -07:00
Arnout Kazemier
964be4cd7a Fixed spelling mistake 2011-07-21 00:42:33 +02:00
Arnout Kazemier
bad600fb1f This hack kills the loading indicator in FF 2011-07-21 00:40:05 +02:00
Guillermo Rauch
c4b5b89626 Merge pull request #245 from 3rd-Eden/wtfshizzle
Another stab at https://github.com/LearnBoost/socket.io/issues/274
2011-07-20 13:40:36 -07:00
Arnout Kazemier
59df51f05a Another stab at https://github.com/LearnBoost/socket.io/issues/274 2011-07-20 22:33:03 +02:00
Peter 'Pita' Martischka
f69f387e1d Send response once we got all POST data, not immediately 2011-07-20 17:29:26 +01:00
Arnout Kazemier
6dfa2a331f Added FF6 support 2011-07-20 10:18:17 +02:00
Guillermo Rauch
f5c10aec7f Merge pull request #395 from 3rd-Eden/bug/376
Fix for bug #376
2011-07-18 14:12:15 -07:00
Arnout Kazemier
34bd9d9092 Fix for bug #376
Also added unit test to prevent it from happening in the future
2011-07-18 23:06:48 +02:00
Andy Dawson
c30151d03a Remove unused Cl (client) variable.
This test doesn't use any real clients.
2011-07-18 13:22:08 -07:00
Arnout Kazemier
f784c477f0 Potential fix for #372 2011-07-18 22:02:03 +02:00
Arnout Kazemier
0d3441d8b3 Added gzip to the options list and fixed a typo 2011-07-18 00:20:05 +02:00
Arnout Kazemier
2b4d7c8d15 Merge branch 'master' of github.com:LearnBoost/socket.io-client into query
Conflicts:
	lib/io.js
2011-07-17 23:52:25 +02:00
Arnout Kazemier
23e14223bd Added more test cases and allow a more flexible constructor for adding content 2011-07-17 23:50:06 +02:00
Arnout Kazemier
9b697942c2 CodeStyle fixes and added xhr-polling as JSONP dependency 2011-07-17 20:43:49 +02:00
Arnout Kazemier
4b94f2b8bf Passes all 14 tests 2011-07-17 20:21:08 +02:00
Arnout Kazemier
f88eedc3c8 More tests 2011-07-17 11:13:12 +02:00
Arnout Kazemier
5c24bf8c1d Removed old testcases from manager and tiny fix for Static 2011-07-17 01:24:21 +02:00
Arnout Kazemier
9cd51b1f6b Passes test suite 2011-07-17 00:10:43 +02:00
Arnout Kazemier
2f8eb63557 Added support for automatic generation of socket.io files
Added support for custom socket.io files based on path structure

For example socket.io+websocket+xhr-polling.js will create a dedicated build with
only support for websockets and xhr-polling.
2011-07-16 21:55:06 +02:00
Arnout Kazemier
4bdc30734c Fixed small typos 2011-07-15 23:59:10 +02:00
Arnout Kazemier
4743744efc Expose the constructor in socket.io and have the Manager use the new API 2011-07-15 22:31:03 +02:00
Arnout Kazemier
c2d98bde72 Add now stores the request details and has returns the details for static content 2011-07-15 22:10:51 +02:00
AD7six
c899c98f31 prevent duplicate references in rooms 2011-07-15 01:13:41 +02:00
Arnout Kazemier
9e97e6c691 Added more comments 2011-07-15 00:30:25 +02:00
Arnout Kazemier
afdfdb815e Finished the write function setup 2011-07-15 00:24:57 +02:00
Arnout Kazemier
d043c33351 Added the write and answer fn 2011-07-15 00:13:54 +02:00
Arnout Kazemier
53f0f4d66d Added alias for to to in and in to to 2011-07-14 21:31:55 +02:00
Arnout Kazemier
168b207c6d Inital draft of gzip support 2011-07-14 21:24:26 +02:00
Arnout Kazemier
f6ebb7b8d6 API structure 2011-07-14 20:54:40 +02:00
Guillermo Rauch
c826fadb9f Fixed roomClients definition (#378). 2011-07-13 18:30:24 -03:00
Guillermo Rauch
d43ed6aa81 Fixed default port for secure connections. 2011-07-12 20:53:10 -03:00
Daniel Shaw
dfebed6c2f Fix typo. Also mentioned in @dluxemburg's #341. 2011-07-12 02:56:48 -07:00
Daniel Shaw
3a2545b497 merge 2011-07-12 01:22:54 -07:00
Guillermo Rauch
097094cd7a Updated dep [thanks @3rd-Eden] 2011-07-12 05:11:03 -03:00
Guillermo Rauch
c3fa1bf5af Release 0.7.7 2011-07-12 05:05:49 -03:00
Guillermo Rauch
df4f763350 Release 0.7.4 2011-07-12 04:59:16 -03:00
Guillermo Rauch
8798cfbced Merge pull request #340 from 3rd-Eden/291
It was emitting uknown room, so the messages where never send
2011-07-12 00:55:49 -07:00
Arnout Kazemier
81d71ebb08 Fixed port number 2011-07-12 09:52:53 +02:00
Guillermo Rauch
e8c50dbd5e Merge pull request #224 from 3rd-Eden/of
Added test suite + of method on the namespace so we have a simular api on
2011-07-12 00:49:20 -07:00
Guillermo Rauch
074e74c6c5 Added test for emitting to closed clients to prevent regression. 2011-07-12 04:35:07 -03:00
Guillermo Rauch
65b8272724 Merge branch 'master' of github.com:LearnBoost/socket.io 2011-07-12 04:29:56 -03:00
Guillermo Rauch
ca3f3379cb Fixed race condition in redis test. 2011-07-12 04:29:30 -03:00
Guillermo Rauch
faad10baee Changed Transport#end instrumentation. 2011-07-12 04:29:11 -03:00
Guillermo Rauch
d3eac92eaa Leveraged $emit instead of emit internally. 2011-07-12 04:28:55 -03:00
Guillermo Rauch
fb5b9bc0b1 Made tests faster. 2011-07-12 03:42:05 -03:00
Guillermo Rauch
34505071f4 Fixed double disconnect events. 2011-07-12 03:41:43 -03:00
Guillermo Rauch
0a2d0b9d0b Fixed disconnect logic 2011-07-12 03:41:15 -03:00
Guillermo Rauch
4495f5987a Simplified remote events handling in Socket. 2011-07-11 23:51:42 -03:00
Guillermo Rauch
aad29d5d92 Fixed double dispatch handling. 2011-07-11 23:51:24 -03:00
Guillermo Rauch
ad8452035d Fixed; increased timeout. 2011-07-11 23:51:08 -03:00
Daniel Shaw
ffa17e1205 Merge remote-tracking branch 'learnboost/master' 2011-07-11 00:16:07 -07:00
Daniel Shaw
59e250b186 Run initStore on store setting change. Fixes #367. 2011-07-11 00:14:37 -07:00
Arnout Kazemier
b2ffed891b Fixed typo 2011-07-11 00:12:27 -07:00
Daniel Shaw
9bf10ed051 Updated to the latest redis release. Lots of important patches. 2011-07-10 17:11:08 -07:00
Guillermo Rauch
c274187364 Merge pull request #234 from 3rd-Eden/flood
When you disconnect before the connection timeout is called, you will cre
2011-07-10 12:15:57 -07:00
Guillermo Rauch
0babfeb9b1 Merge pull request #222 from dvv/master
honor document.location.protocol
2011-07-10 12:15:20 -07:00
Arnout Kazemier
4028c21d57 When you disconnect before the connection timeout is called, you will create a flood
of unaccepted messages
2011-07-10 21:08:40 +02:00
Guillermo Rauch
7f6382d973 Merge pull request #231 from 3rd-Eden/flashblock
Fixed issue #223 where flashblock exposed a bug in our connection timeout
2011-07-10 11:08:41 -07:00
Arnout Kazemier
7c88d3f774 Removed console.log statement 2011-07-10 12:29:42 +02:00
Arnout Kazemier
7cf47f9f3a Fixed issue #223 where flashblock exposed a bug in our connection timeout code 2011-07-10 12:25:03 +02:00
Guillermo Rauch
ad92038686 Merge pull request #230 from 3rd-Eden/parser
Fixed a nasty IE bug where it's unable to parse the unicode characture wh
2011-07-09 15:50:36 -07:00
Arnout Kazemier
34ab001a28 Fixed a nasty IE bug where it's unable to parse the unicode characture when it's
looked up using data[0]. It will return undefined instead the actual char.

But luckly charAt does return the correct characture
2011-07-10 00:43:26 +02:00
Arnout Kazemier
31a89ac232 Updated to count messages and connects 2011-07-08 00:16:33 +02:00
Arnout Kazemier
bbb80cbb5b Added testcase for query string sending / getting 2011-07-07 23:50:08 +02:00
Arnout Kazemier
9f5c1e7406 Missing = in the code 2011-07-07 20:29:45 +02:00
Arnout Kazemier
4aaa4137a0 Work in progress of adding query string support, it should be availble in all
transports
2011-07-07 20:24:56 +02:00
Arnout Kazemier
826c496787 Working in progress of adding querystring support to the client
Also fixed some missing semicolons, bug in reconnect and add reconnect limit
2011-07-06 00:39:05 +02:00
Arnout Kazemier
9cfdb8ed97 Expose socket.transport 2011-07-06 00:10:25 +02:00
ericz
27ab98dca4 Fixed typo 2011-07-05 14:26:46 -07:00
Eric Zhang
a8ca11cb47 Change ; typo to , in first example 2011-07-05 14:22:55 -07:00
Arnout Kazemier
d39d1401c4 Fixed broken test suite 2011-07-05 00:59:31 +02:00
Arnout Kazemier
159c75096d Removed console statement 2011-07-05 00:38:24 +02:00
Arnout Kazemier
a70347b15f Fixed #285 2011-07-05 00:37:19 +02:00
Arnout Kazemier
1a2c8aa31f It was emitting uknown room, so the messages where never send fixes #291 2011-07-05 00:17:02 +02:00
Arnout Kazemier
15e1e68cfd Merge branch 'master' of github.com:LearnBoost/socket.io into 333 2011-07-04 22:53:20 +02:00
Arnout Kazemier
167da44211 Fixes #333 2011-07-04 22:51:00 +02:00
Arnout Kazemier
1372838092 Expose path and querystring in handshakeData 2011-07-04 19:26:22 +02:00
Arnout Kazemier
ca5d229508 Added test suite + of method on the namespace so we have a simular api on the client
as we would have on the server.
2011-07-03 22:32:59 +02:00
Guillermo Rauch
7257e1ec36 Merge pull request #329 from 3rd-Eden/remoteAddress
.address() returned server ip >_<, solved with this patch and adjusted th
2011-07-03 05:43:48 -07:00
Arnout Kazemier
af5960bc28 address.remoteAddress -> address.address just like node's 2011-07-02 19:50:18 +02:00
Arnout Kazemier
206cfdf9c6 Merge branch 'master' of github.com:LearnBoost/socket.io into remoteAddress
Conflicts:
	lib/manager.js
2011-07-02 17:52:09 +02:00
Arnout Kazemier
65d7229079 .address() returned server ip >_<, solved with this patch and adjusted the test
suite
2011-07-02 17:49:32 +02:00
Guillermo Rauch
c18aa40ba6 Merge pull request #328 from coolbloke1324/master
Client IP instead of server IP for connectionAddress.
2011-07-02 08:41:33 -07:00
coolbloke1324
249f33da16 Updated Manager.prototype.handshakeData to provide connection.remoteAddress instead of .address() because .address() was returning server IP and .remoteAddress returns client IP. 2011-07-02 08:30:18 -07:00
Guillermo Rauch
b9a7c8be90 Merge pull request #325 from 3rd-Eden/ssl
See https://github.com/joyent/node/issues/1055
2011-07-01 12:41:02 -07:00
Arnout Kazemier
e4ac72a316 Unfucked space 2011-07-01 21:26:43 +02:00
Arnout Kazemier
dff9cbfe1b See https://github.com/joyent/node/issues/1055 2011-07-01 21:24:51 +02:00
Vladimir Dronnikov
b3a156885b honor document protocol, unless overriden 2011-07-01 21:02:17 +04:00
Vladimir Dronnikov
489bc860d2 cleanup 2011-07-01 09:50:37 -07:00
Vladimir Dronnikov
6f4566ac12 Merge branch 'master' of github.com:LearnBoost/socket.io-client 2011-07-01 19:00:28 +04:00
Guillermo Rauch
f41d213f4d Merge pull request #221 from 3rd-Eden/uglify
Forgot to commit package.json + builder adjustment
2011-07-01 03:22:24 -07:00
Arnout Kazemier
f0ce6e8120 Forgot to commit package.json + builder adjustment 2011-07-01 12:21:22 +02:00
Guillermo Rauch
665818dabc Merge pull request #220 from 3rd-Eden/uglify
Removed bloat from repo, use uglify as dependency, and updated package.js
2011-07-01 02:59:33 -07:00
Arnout Kazemier
3afe88904c Removed bloat from repo, use uglify as dependency, and updated package.json
And removed old builder
2011-07-01 10:45:27 +02:00
Guillermo Rauch
29a8fff576 Removed transports definition in chat example. 2011-06-30 18:59:52 -03:00
Guillermo Rauch
e66a68f0fa Fixed room cleanup 2011-06-30 18:59:35 -03:00
Guillermo Rauch
4058eacbd4 Fixed; make sure the client is cleaned up after booting. 2011-06-30 18:58:55 -03:00
Guillermo Rauch
8cbd1544b9 Make sure to mark the client as non-open if the connection is closed. 2011-06-30 18:58:29 -03:00
Guillermo Rauch
f302744fec Removed unneeded buffer declarations. 2011-06-30 18:58:06 -03:00
Guillermo Rauch
a3ba4e2c10 Fixed; make sure to clear socket handlers and subscriptions upon transport close. 2011-06-30 18:19:41 -03:00
Guillermo Rauch
a483f9cafd Release 0.7.6 2011-06-30 15:32:22 -03:00
Guillermo Rauch
b43c82f3db Fixed general dispatching when a client has closed. 2011-06-30 14:03:43 -03:00
Vladimir Dronnikov
15dbe74fc7 Merge branch 'master' of github.com:LearnBoost/socket.io-client 2011-06-30 20:21:21 +04:00
Guillermo Rauch
84f0099c1d Release 0.7.5 2011-06-30 12:57:44 -03:00
Guillermo Rauch
c6a883c8a9 Fixed dispatching to clients that are disconnected. 2011-06-30 12:56:42 -03:00
Guillermo Rauch
af2d9f285b Release 0.7.4 2011-06-30 12:48:00 -03:00
Guillermo Rauch
40c1f8da2b Fixed; only clear handlers if they were set. [level09] 2011-06-30 12:47:02 -03:00
Guillermo Rauch
9b40977616 Release 0.7.3 2011-06-30 10:38:03 -03:00
Guillermo Rauch
56ddb4e7a8 Release 0.7.3 2011-06-30 10:30:59 -03:00
Guillermo Rauch
5efc281a53 Build 2011-06-30 10:26:15 -03:00
Guillermo Rauch
c5d11cba7a Merge pull request #219 from dvv/patch-1
acks: automatic for .send and manual for .emit
2011-06-30 06:22:40 -07:00
Guillermo Rauch
964f040b58 Merge pull request #318 from dvv/patch-1
normalize SocketNamespace local eventing
2011-06-30 06:22:26 -07:00
Guillermo Rauch
b6177c70ac Build 2011-06-30 10:20:39 -03:00
Vladimir Dronnikov
44919189ec normalize SocketNamespace local eventing 2011-06-30 03:12:55 -07:00
Guillermo Rauch
6c4cc5113f Merge pull request #315 from 3rd-Eden/intentional
disconnect
2011-06-29 13:23:45 -07:00
Arnout Kazemier
06e29fef67 Use packet.reason or default to 'packet' 2011-06-29 21:58:13 +02:00
Arnout Kazemier
16518c0715 Added a small indicator + test suite so you can see how a user is disconnected 2011-06-29 21:45:14 +02:00
Guillermo Rauch
09a713da18 Merge pull request #314 from nyxtom/master
Issue #313 TypeError: Object #<CleartextStream> has no method 'address'
2011-06-29 10:52:56 -07:00
Thomas Holloway
3e0239ed07 Quick fix to issues #313 to check if an address exists on a connection 2011-06-29 12:29:00 -05:00
Vladimir Dronnikov
8ce05bc68c acks: automatic for .send and manual for .emit 2011-06-29 08:33:08 -07:00
Vladimir Dronnikov
3eaf15e4c7 Merge branch 'master' of github.com:LearnBoost/socket.io-client 2011-06-29 19:19:36 +04:00
Guillermo Rauch
d3d2a70944 Added MemoryStore expiration tests. 2011-06-29 11:38:28 -03:00
Guillermo Rauch
1bcf87eb14 Added RedisStore expiration tests. 2011-06-29 11:38:18 -03:00
Guillermo Rauch
f9c210c11c Added expiration support to RedisStore.Client#destroy through EXPIRE command. 2011-06-29 11:37:58 -03:00
Guillermo Rauch
06421dd008 Added expiration support to MemoryStore.Client#destroy. 2011-06-29 11:37:26 -03:00
Guillermo Rauch
af7c7141f0 Changed; for consistency across stores, undefined becomes null. 2011-06-29 11:36:14 -03:00
Guillermo Rauch
def5498f61 Added expiration parameters to Store#destroyClient and Store#destroy 2011-06-29 11:35:44 -03:00
Guillermo Rauch
494b2d4487 Added Socket#has
Added `Socket#del`
2011-06-29 11:35:13 -03:00
Guillermo Rauch
ba3b854190 Changed; make sure to cache a reference to the client object so that it can be
referenced after its destroying and before the data expires.
2011-06-29 11:33:54 -03:00
Guillermo Rauch
abc3723b54 Changed; make sure to pass client store expiration to Store#destroyClient. 2011-06-29 11:33:24 -03:00
Guillermo Rauch
ba10280071 Added a client store expiration option with a 15 seconds default. 2011-06-29 11:32:47 -03:00
Guillermo Rauch
27be7ac6e3 Merge pull request #218 from 3rd-Eden/namespace.auth
Namespace.auth
2011-06-29 04:32:35 -07:00
Guillermo Rauch
fc95d340ef Merge pull request #306 from 3rd-Eden/namespace.auth
Namespace.auth
2011-06-29 04:14:29 -07:00
Arnout Kazemier
d47bcd51ba Merge branch 'master' of github.com:LearnBoost/socket.io into namespace.auth 2011-06-29 13:10:23 +02:00
Guillermo Rauch
be7f56b819 Merge branch 'master' of github.com:LearnBoost/socket.io 2011-06-29 07:55:21 -03:00
Guillermo Rauch
6a83d6879c Added redis store tests 2011-06-29 07:54:26 -03:00
Guillermo Rauch
56f5911b60 Added memory store tests 2011-06-29 07:54:13 -03:00
Guillermo Rauch
2fd38866d2 Finished redis store 2011-06-29 07:53:51 -03:00
Guillermo Rauch
4398271ff5 Added MemoryClient#has, MemoryClient#del
Refactored MemoryClient#destroy
2011-06-29 07:51:54 -03:00
Guillermo Rauch
6ce89b80ef Added Store#destroyClient
Refactored Store#destroy
2011-06-29 07:51:21 -03:00
Guillermo Rauch
1449b18681 Added docs 2011-06-29 07:50:23 -03:00
Guillermo Rauch
f921164bf8 Removed Store instrumentation 2011-06-29 07:50:04 -03:00
Guillermo Rauch
ea1f5822ae Removed Store#log since they're manager-independent. 2011-06-29 07:49:47 -03:00
Guillermo Rauch
2fd406f7b2 Fixed; make sure to clean up store upon client disconnect. 2011-06-29 07:49:22 -03:00
Guillermo Rauch
34d0cbdbf0 Merge pull request #310 from 3rd-Eden/websocket.write
Having a stab at issue #295
2011-06-29 03:20:49 -07:00
Arnout Kazemier
2110bac72d Having a stab at issue #295 2011-06-29 12:17:20 +02:00
Arnout Kazemier
1966441bcc Removed console.log + added \n 2011-06-29 09:55:44 +02:00
Arnout Kazemier
2342133e7e Merge branch 'namespace.auth' of github.com:3rd-Eden/Socket.IO into namespace.auth 2011-06-29 09:50:22 +02:00
Arnout Kazemier
e8e92268c5 Style fixes + don't init on each check & clear the flashsocket tasks on close 2011-06-29 09:49:19 +02:00
Arnout Kazemier
299e097fa7 Added storage for socket.handshake & updated test suite to check for it 2011-06-28 23:50:33 +02:00
Arnout Kazemier
eecc0f115e Added test suite 2011-06-28 22:22:07 +02:00
Arnout Kazemier
a1963fcf7d Added missing test suite 2011-06-28 21:49:45 +02:00
Arnout Kazemier
8abe712294 Passes test suite 2011-06-28 21:41:46 +02:00
Guillermo Rauch
df21bea4df Fixed store references 2011-06-28 16:32:40 -03:00
Arnout Kazemier
45f2718954 Cleaned up the websocket test 2011-06-28 21:05:53 +02:00
Guillermo Rauch
24aef9e40b Merge branch 'master' of github.com:LearnBoost/Socket.IO-node 2011-06-28 15:50:19 -03:00
Guillermo Rauch
a00ce7eee6 Fix for client side namespaces. 2011-06-28 15:49:48 -03:00
Guillermo Rauch
17dd94e3c9 Merge pull request #300 from 3rd-Eden/static.write
Create a new branch for fixing #287
2011-06-28 11:45:40 -07:00
Guillermo Rauch
81fe9e0117 Merge pull request #302 from 3rd-Eden/readme
Readme fixes
2011-06-28 11:45:05 -07:00
Arnout Kazemier
c9bf814580 Readme fixes 2011-06-28 20:43:24 +02:00
Arnout Kazemier
78b546e185 Incorporated feedback from @guille 2011-06-28 20:37:58 +02:00
Arnout Kazemier
e7deb32a6f Create a new branch for fixing #287 2011-06-28 20:23:13 +02:00
Guillermo Rauch
4e4199c15e Added test for SocketNamespace#clients 2011-06-28 13:33:09 -03:00
Guillermo Rauch
fb79657476 Added SocketNamespace#clients 2011-06-28 13:33:01 -03:00
Vladimir Dronnikov
c9f62d680b Merge branch 'master' of github.com:LearnBoost/Socket.IO 2011-06-28 18:53:48 +04:00
Guillermo Rauch
f2212f6962 Make handshake data extensible 2011-06-28 09:27:07 -03:00
Guillermo Rauch
c9d21c5ff5 Fixed tests 2011-06-28 08:29:42 -03:00
Guillermo Rauch
6b6f17b098 Added handshakeData#address
Added handshakeData#secure
2011-06-28 08:29:00 -03:00
Guillermo Rauch
9740b42866 Added test for Socket#handshake. 2011-06-28 07:37:25 -03:00
Guillermo Rauch
2a1b2bd37e Added Socket#handshake data getter. 2011-06-28 07:37:15 -03:00
Guillermo Rauch
b58c2e4afe Added handshake data normalizer function.
Changed; Make sure we store the `handshake data` in the hash of connected clients.
2011-06-28 07:36:35 -03:00
Guillermo Rauch
a2f8fb4970 Implemented RedisStore.Client#get and RedisStore.Client#set 2011-06-27 16:21:32 -03:00
Guillermo Rauch
a4ef10d6a2 Added missing redis require. 2011-06-27 16:14:47 -03:00
Guillermo Rauch
06052d2b84 Merge pull request #217 from fat/rebuild
rebuild dist files!
2011-06-27 12:04:33 -07:00
Guillermo Rauch
91e43064f3 Added Redis store.
- Simply leverages pub/sub for nodes communication
  - Makes sure own node doesn't consume its own messages
  - Optionally uses msgpack to encode data for higher speed than JSON
  - Opens two connections per node (one in pub/sub mode, one for normal redis)
2011-06-27 15:55:33 -03:00
Guillermo Rauch
76e6b9ea6f Removed comments in xhr-polling test. 2011-06-27 15:53:15 -03:00
Guillermo Rauch
a517efcaca Fixed signature of Socket#join in tests
Fixed style
2011-06-27 15:52:35 -03:00
Guillermo Rauch
8f6860b155 Make sure to close websocket clients on session tests 2011-06-27 15:52:17 -03:00
Guillermo Rauch
72283a9078 Removed comments from tests 2011-06-27 15:51:59 -03:00
Guillermo Rauch
c9d87ebb98 Fixed xhr polling transport name 2011-06-27 15:51:44 -03:00
Guillermo Rauch
4a591f191f Fixed xhr polling constructor to take request as parameter 2011-06-27 15:51:26 -03:00
Guillermo Rauch
779816ded7 Added req to websocket transport constructor. 2011-06-27 15:50:46 -03:00
Guillermo Rauch
2b90edb3a2 Added req parameter to jsonp-polling constructor. 2011-06-27 15:50:24 -03:00
Guillermo Rauch
a99016df79 Make sure to take request as parameter in the http constructor 2011-06-27 15:50:08 -03:00
Guillermo Rauch
78c7a55ce4 Make sure to take request as parameter in the polling constructor 2011-06-27 15:49:37 -03:00
Guillermo Rauch
3fbce85315 Make sure to take request as parameter in the htmlfile constructor 2011-06-27 15:49:13 -03:00
Guillermo Rauch
9aa5320730 Fixed Flashsocket constructor 2011-06-27 15:48:20 -03:00
Guillermo Rauch
2fb28c8843 Removed Transport#subscribe and Transport#unsubscribe 2011-06-27 15:47:55 -03:00
Guillermo Rauch
767ca4f100 Fixed .end signature 2011-06-27 15:47:43 -03:00
Guillermo Rauch
733569ae68 Added Transport#discard. Mostly useful for when request/response cycles are load
balanced into different nodes.
2011-06-27 15:47:14 -03:00
Guillermo Rauch
f736302b97 Refactored Transport#end
Removed concept of transport pausing as we no longer have async buffers.
2011-06-27 15:46:43 -03:00
Guillermo Rauch
7bfcf54f90 Publish transport close event. 2011-06-27 15:45:58 -03:00
Guillermo Rauch
fa5ef9ff2d Removed forced parameter from .end call from disconnect 2011-06-27 15:45:37 -03:00
Guillermo Rauch
df457440fd Refactored onMessage to leverage subscriptions 2011-06-27 15:45:18 -03:00
Guillermo Rauch
375cbf49de Important fix for hearbeats 2011-06-27 15:45:09 -03:00
Guillermo Rauch
2c66814b82 Applied new .end signature 2011-06-27 15:44:50 -03:00
Guillermo Rauch
2a4e4e1300 Added handler for dispatch subscription 2011-06-27 15:44:38 -03:00
Guillermo Rauch
6f12de98fc Added handler for heartbeat clear subscription 2011-06-27 15:44:28 -03:00
Guillermo Rauch
73ea4dd13f Removed the .end method to disregard whether it was forced or not 2011-06-27 15:43:46 -03:00
Guillermo Rauch
772afe897d Refactored Transport to leverage subscriptions. 2011-06-27 15:43:24 -03:00
Guillermo Rauch
0b75d09090 Refactored Memory.Client 2011-06-27 15:42:49 -03:00
Guillermo Rauch
95e787dcc5 Removed all transport-specific methods from Memory store
Added publish/subscribe placeholders that basically do nothing.
2011-06-27 15:40:32 -03:00
Guillermo Rauch
5342dd6d76 Refactored Socket
- initialize options in constructor
  - inherit from EventEmitter always
  - added generic Socket#client
2011-06-27 15:37:30 -03:00
Guillermo Rauch
195e227393 Refactored Socket#disconnect to intelligently decide whether the disconnection has
to be forced or just destroy the storage, so that a re-opening of the transport is
not possible.
2011-06-27 15:36:20 -03:00
Guillermo Rauch
c28a85e520 Refacotred Socket#set and Socket#get 2011-06-27 15:36:08 -03:00
Jacob Thornton
558d12e70f rebuild dist files! 2011-06-27 11:35:57 -07:00
Guillermo Rauch
bf8b1e6879 Added Socket#dispatch, in charge of intelligently determining whether the packet
has to be relied to other nodes to handle, handle it internally, or discarding it
if it's volatile from the local buffer provided the transport is not open.
2011-06-27 15:35:09 -03:00
Guillermo Rauch
240cf3fde6 Leverage Socket#dispatch to dispatch a message. 2011-06-27 15:34:46 -03:00
Guillermo Rauch
d40cde8503 Refactored Socket#leave 2011-06-27 15:34:31 -03:00
Guillermo Rauch
db9d81971d Refactored Socket#join 2011-06-27 15:34:20 -03:00
Guillermo Rauch
54d2c0111d Changed; Socket#store now returns the client store. 2011-06-27 15:32:44 -03:00
Guillermo Rauch
cfd5315b1e Removed disconnect subscription per-socket (added unnecessary overhead with multiple
namespaces).
2011-06-27 15:32:19 -03:00
Guillermo Rauch
cbc12ecdcf Make sure to leave rooms upon disconnection of a namespace (fixes some bug). 2011-06-27 15:31:44 -03:00
Guillermo Rauch
9aa650e430 Removed the join callback, since it's not necessary (TCP based pub/sub guarantees
proper total ordering).
2011-06-27 15:30:47 -03:00
Guillermo Rauch
f06fefab14 Added handleDisconnect method to emit the disconnect event when the socket is
disconnected due to network reasons, making sure we don't emit it on non-connected
namespaces.
2011-06-27 15:30:02 -03:00
Guillermo Rauch
5b6efb784f Simplified global message dispatching by leveraging subscriptions. 2011-06-27 15:28:24 -03:00
Guillermo Rauch
c210241379 Refactored handshake 2011-06-27 15:27:58 -03:00
Guillermo Rauch
8594d684ef Fixed style 2011-06-27 15:27:44 -03:00
Guillermo Rauch
970621d5ee Refactored client request handling:
- removed the concept of async handshake, since we now keep track of open/closed
   clients and handshakes across all nodes (replication)
 - when a client closes temporarily, before the disconnection is triggered and before
   the transport is reopened in any node, we buffer messages in all nodes. We therefore
   remove the need for a complex message queue with a memory tradeoff (buffer redundancy).
2011-06-27 15:21:50 -03:00
Guillermo Rauch
c9d9c2e8b3 Added initStore and subscription handlers. 2011-06-27 15:21:01 -03:00
Guillermo Rauch
8f44f026ee Removed usage of Store#disconnect, replaced with a simple subscription. 2011-06-27 15:20:35 -03:00
Guillermo Rauch
c369073a72 Moved id generation method into the manager. 2011-06-27 15:18:37 -03:00
Guillermo Rauch
b700f0546d Added call to initStore to initialize subscriptions. 2011-06-27 15:16:54 -03:00
Guillermo Rauch
0701408061 Added redis client dependency.
Removed >= from policy.
2011-06-27 15:14:53 -03:00
Arnout Kazemier
9da035d356 WIP @ namespace.auth, still needs test-acceptance 2011-06-27 17:06:48 +02:00
Vladimir Dronnikov
546abff3d4 Merge branch 'master' of github.com:LearnBoost/Socket.IO 2011-06-24 19:05:32 +04:00
Guillermo Rauch
969743c8d1 Merge pull request #213 from fat/new-io.connect
add support for new io.connect & new io.Connect...
2011-06-23 18:27:51 -07:00
Jacob Thornton
0c864cab47 add support for new io.connect... 2011-06-23 18:26:14 -07:00
Vladimir Dronnikov
bf4d0168b0 Merge branch 'master' of github.com:LearnBoost/Socket.IO 2011-06-23 19:37:35 +04:00
Guillermo Rauch
bafb347e4a Changed console.error to console.log. 2011-06-22 23:56:14 -03:00
Guillermo Rauch
802da70bf7 Fixed; bind both servers at the same time do that the test never times out. 2011-06-22 22:18:51 -03:00
Guillermo Rauch
f2711daa37 Merge pull request #282 from 3rd-Eden/master
304
2011-06-22 15:49:56 -07:00
Arnout Kazemier
7200dfed84 Output the correct name 2011-06-23 00:48:06 +02:00
Arnout Kazemier
b348f4de99 Style 2011-06-23 00:23:18 +02:00
Arnout Kazemier
6452602603 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO-node 2011-06-23 00:20:55 +02:00
Arnout Kazemier
6f93bb2ec7 Added 304 support 2011-06-23 00:20:28 +02:00
Guillermo Rauch
ffd3e8bc96 Removed Transport#name for abstract interface. 2011-06-22 18:40:26 -03:00
Guillermo Rauch
bdea4b11a7 Merge pull request #281 from 3rd-Eden/master
Lazy load http / https modules & fix for crash in memory store
2011-06-22 13:49:54 -07:00
Arnout Kazemier
041b5655f9 Delete they client instead of setting it to null. And make sure the client exists
before we do .disconnect
2011-06-22 22:43:39 +02:00
Arnout Kazemier
080676bf6e Lazy require http and https module only when needed 2011-06-22 21:40:02 +02:00
Guillermo Rauch
80cf622ced Merge pull request #205 from 3rd-Eden/master
Fixed double connect events
2011-06-22 12:11:39 -07:00
Arnout Kazemier
270c10c4a5 Style fix 2011-06-22 21:08:25 +02:00
Arnout Kazemier
20de0b7a60 Fixed double connect events 2011-06-22 21:03:41 +02:00
Guillermo Rauch
2e7076abcc Merge pull request #273 from 3rd-Eden/master
merge fail
2011-06-22 01:27:43 -07:00
Arnout Kazemier
b87e51bae3 Refixed merge fail 2011-06-22 10:26:39 +02:00
Guillermo Rauch
cc5bc44ef0 Merge pull request #265 from 3rd-Eden/master
Better naming in the logging
2011-06-22 01:25:30 -07:00
Arnout Kazemier
4672ab65d7 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO-node
Conflicts:
	lib/transports/http-polling.js
2011-06-22 10:24:35 +02:00
Guillermo Rauch
a7e1a34d6b Fixed reconnection with jsonp-polling maintaining old sessionid. [franck34] 2011-06-22 05:03:39 -03:00
Guillermo Rauch
331e6e85b9 Release 0.7.2 2011-06-22 04:15:01 -03:00
Guillermo Rauch
f2df40aa02 Bumped client version.
Bumped version
2011-06-22 04:12:26 -03:00
Guillermo Rauch
7a8e785f73 Release 0.7.2 2011-06-22 04:10:45 -03:00
Guillermo Rauch
abe9ac43b8 Added noop message type. 2011-06-22 04:09:35 -03:00
Guillermo Rauch
36ecd49ad2 Updated tests. 2011-06-22 04:09:19 -03:00
Guillermo Rauch
aef5027640 Make sure to write a packet (of type noop) when closing a poll. This solves a problem
with cross-domain requests being flagged as aborted and reconnection being triggered.
2011-06-22 04:08:28 -03:00
Guillermo Rauch
4933cf1a9e Added noop message type. 2011-06-22 04:08:11 -03:00
Arnout Kazemier
28b396c3fc Merge branch 'master' of https://github.com/LearnBoost/Socket.IO-node 2011-06-22 08:58:33 +02:00
Guillermo Rauch
81a02aaaf0 Release 0.7.1 2011-06-21 21:08:00 -03:00
Guillermo Rauch
c425724bd2 Release 0.7.1 2011-06-21 21:05:11 -03:00
Guillermo Rauch
0b9bc61ff1 Added CORS test to xhr-polling suite. 2011-06-21 21:02:22 -03:00
Guillermo Rauch
3bab44506b Added header override support in test client. 2011-06-21 21:02:11 -03:00
Guillermo Rauch
aeac79faa9 Fixed; restored headers in POST responses. 2011-06-21 20:34:20 -03:00
Guillermo Rauch
903f7ec9ff Fixed cross-domain POST XHR requests for Firefox. 2011-06-21 20:17:24 -03:00
Arnout Kazemier
808e794ec5 Merge branch 'master' of github.com:3rd-Eden/Socket.IO-node 2011-06-21 21:35:42 +02:00
Arnout Kazemier
cb7aa0a79c Merge branch 'master' of https://github.com/LearnBoost/Socket.IO-node 2011-06-21 21:35:26 +02:00
Arnout Kazemier
1bddfc45dd Added client handler to the options, just for the sake of consistency 2011-06-21 21:09:41 +02:00
Vladimir Dronnikov
e53f05d539 Merge branch 'master' of github.com:LearnBoost/Socket.IO
Conflicts:
	dist/socket.io.js
	dist/socket.io.min.js
2011-06-21 18:20:34 +04:00
Vladimir Dronnikov
bdfcec39b8 hz 2011-06-21 18:20:00 +04:00
Guillermo Rauch
ea1134212d Added socket.io to devDependencies. 2011-06-21 09:39:23 -03:00
Guillermo Rauch
1e848778be Build 2011-06-21 09:38:56 -03:00
Guillermo Rauch
b323e67674 Merge pull request #200 from 3rd-Eden/master
Better error handling for test suite
2011-06-21 03:57:34 -07:00
Arnout Kazemier
a470c6a7c7 Changed the check for xdomain, as the first argument is a reference to the socket 2011-06-21 12:19:20 +02:00
Arnout Kazemier
d2bff866e9 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO 2011-06-21 11:58:28 +02:00
Arnout Kazemier
836eb1d1c2 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO-node 2011-06-21 11:55:24 +02:00
Guillermo Rauch
338719d5dd Fixed readme 2011-06-21 06:30:53 -03:00
Guillermo Rauch
159ad73ba3 Fixed readme 2011-06-21 06:30:11 -03:00
Guillermo Rauch
2838f252cf Some readme fixes. Broadcast clarification, added rooms. 2011-06-21 06:22:11 -03:00
Guillermo Rauch
8ab2ad2c34 Added new contributor extraordinaire. 2011-06-21 06:14:15 -03:00
Guillermo Rauch
e5266b54dc Added new contributor extraordinaire. 2011-06-21 06:13:52 -03:00
Guillermo Rauch
4232629a5e Build 2011-06-21 06:03:46 -03:00
Guillermo Rauch
a7021b4985 Fix for IE6. 2011-06-21 06:03:29 -03:00
Guillermo Rauch
e4a779b9d9 Fixed should.js in IE 2011-06-21 05:22:10 -03:00
Guillermo Rauch
c90bcecd80 Build. 2011-06-21 05:16:46 -03:00
Guillermo Rauch
3820fa30fe Fixed; made injecting scripts extremely reliable.
Fix for disconnection loop.
2011-06-21 05:12:11 -03:00
Arnout Kazemier
4c5dfd53f0 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO-node 2011-06-21 10:03:20 +02:00
Arnout Kazemier
a62bced081 this.name > prototype.name 2011-06-21 10:00:13 +02:00
Guillermo Rauch
962736a47a Reverting to more lightweight htmlfile framing. 2011-06-21 04:59:29 -03:00
Arnout Kazemier
d0f7cd0ceb Merge branch 'master' of https://github.com/LearnBoost/Socket.IO 2011-06-21 09:45:05 +02:00
Arnout Kazemier
397dfbc51d Naming 2011-06-21 09:44:26 +02:00
Guillermo Rauch
25e945774d Build. 2011-06-21 04:38:01 -03:00
Guillermo Rauch
191d498521 The cake was a lie. 2011-06-21 04:37:42 -03:00
Guillermo Rauch
90b9c00e6b Build 2011-06-21 04:10:19 -03:00
Guillermo Rauch
b7eed5fe32 JSON support for should 2011-06-21 04:09:59 -03:00
Arnout Kazemier
3efab507e1 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO 2011-06-21 09:07:18 +02:00
Guillermo Rauch
e1e11dd309 Fixed more compatibility issues for should.js. Maybe I should publish this. Remind
me to ask TJ.
2011-06-21 03:51:41 -03:00
Guillermo Rauch
a5b53f036c Fix for polling close. 2011-06-21 03:38:58 -03:00
Guillermo Rauch
0b7751232f Make sure we prevent GH- 264 in acceptance tests for xhr-polling. 2011-06-21 01:52:39 -03:00
Guillermo Rauch
39f60fd805 Call onClose before clearing xhr to make sure we update .open state in the
callbacks. See previous commit.
2011-06-21 01:50:23 -03:00
Guillermo Rauch
13c9e4813f Prevent endless loop of .get upon Socket#disconnect. 2011-06-21 01:50:01 -03:00
Guillermo Rauch
54ead36e40 Implemented new payload API for XHR. 2011-06-21 01:49:46 -03:00
Guillermo Rauch
b05319dad6 Implemented setBuffer in XHR transports. 2011-06-21 01:49:27 -03:00
Guillermo Rauch
a4614146e7 Implemented WebSocket#payload, to avoid artificial framing on top of the WebSocket
protocol.
2011-06-21 01:48:44 -03:00
Guillermo Rauch
6c34ddc6da Changed; leverage setBuffer in WebSocket transport. 2011-06-21 01:48:24 -03:00
Guillermo Rauch
facf772126 Changed; leverage new setBuffer from jsonp-polling. 2011-06-21 01:48:03 -03:00
Guillermo Rauch
c7296b9008 Fixed; keep track of open readyState in Transport. 2011-06-21 01:47:38 -03:00
Guillermo Rauch
5743360c02 Make sure to restore the close timeout upon getting data. 2011-06-21 01:47:13 -03:00
Guillermo Rauch
417b7f12f1 Fixed; make sure to close the transport upon disconnection. 2011-06-21 01:46:54 -03:00
Guillermo Rauch
6588c1aad1 Fixed connect and heartbeat timeout mismatch. 2011-06-21 01:46:41 -03:00
Guillermo Rauch
885511161e Implemented better Socket#send buffering. 2011-06-21 01:46:22 -03:00
Guillermo Rauch
47055988c1 Make sure to call XHR#close from HTMLFile#close 2011-06-21 01:45:41 -03:00
Guillermo Rauch
57d33a4a97 Remove graceful close, as web implementations don't need it. 2011-06-21 01:09:11 -03:00
Guillermo Rauch
5518f8cb2c Added support for CORS of POST requests. 2011-06-21 01:08:25 -03:00
Guillermo Rauch
f49e6f12c7 Fixed issues with defineProperty on Firefox. 2011-06-20 19:34:11 -03:00
Arnout Kazemier
dc46c8b072 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO 2011-06-21 00:23:01 +02:00
Guillermo Rauch
aa8e4c4489 Fixed Socket#publish for IE. 2011-06-20 19:23:01 -03:00
Guillermo Rauch
3022c50452 Merge branch 'master' of github.com:LearnBoost/Socket.IO 2011-06-20 19:20:28 -03:00
Guillermo Rauch
7f045f3d77 Fixed should.js for IE 2011-06-20 19:20:04 -03:00
Guillermo Rauch
92e00b474b Fixed should.js for IE 2011-06-20 19:19:25 -03:00
Guillermo Rauch
d8964061f3 Fixed; added console.log support to test runner. 2011-06-20 19:17:51 -03:00
Arnout Kazemier
165150cd32 Added on("error") checks to each test case, none of these test should emit an error
event
2011-06-21 00:04:29 +02:00
Guillermo Rauch
f4615f9fbf Merge pull request #199 from 3rd-Eden/master
breaks
2011-06-20 14:40:38 -07:00
Arnout Kazemier
d6361f733a added missing breaks; the ack packet also emitted the onerror 2011-06-20 23:38:11 +02:00
Guillermo Rauch
e55c5e91fb Fix for htmlfile 2011-06-20 17:50:26 -03:00
Guillermo Rauch
ae5ace723e Merge branch 'master' of github.com:LearnBoost/Socket.IO-node 2011-06-20 17:34:40 -03:00
Guillermo Rauch
191d68d85f Workaround for race condition 2011-06-20 17:34:16 -03:00
Guillermo Rauch
ac2c1c5f82 Merge pull request #198 from 3rd-Eden/master
.close
2011-06-20 13:22:41 -07:00
Arnout Kazemier
f00f7e379f Merge branch 'master' of https://github.com/LearnBoost/Socket.IO 2011-06-20 22:22:08 +02:00
Arnout Kazemier
5916e325e3 this.open trigges popups.. changed to self.open. But disabled the reopen delay for
0.7 because it's not realy for production usage yet
2011-06-20 22:19:00 +02:00
Guillermo Rauch
334f1baaab Added proper charset for xhr POST. 2011-06-20 17:17:55 -03:00
Arnout Kazemier
e4f6cbe759 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO 2011-06-20 21:24:43 +02:00
Guillermo Rauch
d145258d13 Added XHR#close. 2011-06-20 16:19:43 -03:00
Arnout Kazemier
3136ae3c4f Merge branch 'master' of https://github.com/LearnBoost/Socket.IO 2011-06-20 21:13:53 +02:00
Arnout Kazemier
093a6876bb Added support for flashsockets 2011-06-20 21:13:29 +02:00
Arnout Kazemier
63d40941ff XHR now has a close method 2011-06-20 21:13:01 +02:00
Guillermo Rauch
8cdd60d9f7 Fixed double insertion. 2011-06-20 16:01:19 -03:00
Guillermo Rauch
1e50a661c6 Fixed closeTimeout and heartbeatTimeout. 2011-06-20 15:51:08 -03:00
Guillermo Rauch
245a61c205 Build 2011-06-20 15:31:16 -03:00
Guillermo Rauch
5615e5a896 Merge branch 'master' of github.com:LearnBoost/Socket.IO 2011-06-20 15:31:02 -03:00
Guillermo Rauch
c68e80c2d0 Build 2011-06-20 15:30:43 -03:00
Guillermo Rauch
d88da380d5 Merge pull request #197 from 3rd-Eden/master
Utils & shizzle
2011-06-20 10:50:20 -07:00
Guillermo Rauch
6fead979c8 Fixed behavior of onerror for XDomainRequest. 2011-06-20 14:35:26 -03:00
Guillermo Rauch
ce6ed96189 Redone name assignment for transports. 2011-06-20 14:34:40 -03:00
Arnout Kazemier
f85d68fcae +io 2011-06-20 14:59:58 +02:00
Arnout Kazemier
d5b9c0f004 added window 2011-06-20 14:59:09 +02:00
Arnout Kazemier
771ba9c3c7 Incorporated feedback from @dvv 2011-06-20 14:52:53 +02:00
Arnout Kazemier
d9f61298b2 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO 2011-06-20 14:20:09 +02:00
Arnout Kazemier
4651444075 Use util instead of this for merging 2011-06-20 14:19:21 +02:00
Guillermo Rauch
9ce50b9c59 Merge branch 'master' of github.com:LearnBoost/Socket.IO 2011-06-20 09:01:57 -03:00
Guillermo Rauch
6d46ccd8c7 Build 2011-06-20 09:01:27 -03:00
Guillermo Rauch
bd84609fa3 Merge pull request #196 from 3rd-Eden/master
Load swf based on the connection options
2011-06-20 02:42:27 -07:00
Arnout Kazemier
f0d85b5a3f Merge branch 'master' of https://github.com/LearnBoost/Socket.IO 2011-06-20 11:38:48 +02:00
Arnout Kazemier
becc612279 Fixed url generation 2011-06-20 11:38:12 +02:00
Guillermo Rauch
1c8b8000de Merge branch 'master' of github.com:LearnBoost/Socket.IO 2011-06-20 06:17:18 -03:00
Guillermo Rauch
3fda1e6d35 Fixes cross domain XHR on IE8/9 2011-06-20 06:16:50 -03:00
Guillermo Rauch
0c7f44fc28 Merge pull request #195 from 3rd-Eden/master
prepareURL fixes
2011-06-20 01:54:20 -07:00
Arnout Kazemier
e97d414439 Removed console.log 2011-06-20 10:53:13 +02:00
Guillermo Rauch
35610dfd8c Merge pull request #260 from 3rd-Eden/master
chat example
2011-06-20 01:26:46 -07:00
Arnout Kazemier
043b5e8063 Only require flashpolicy when the we create a function
Fixes for handshakes
2011-06-20 10:04:01 +02:00
Arnout Kazemier
09d80164c3 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO 2011-06-20 08:49:58 +02:00
Guillermo Rauch
90641c1f34 Added test for emitting an event to server and sending back data. 2011-06-19 23:12:13 -03:00
Guillermo Rauch
0408725373 Added test for emitting an event from server and ACKing back data. 2011-06-19 23:08:16 -03:00
Guillermo Rauch
af258f48d9 Added test for emitting an event to server. 2011-06-19 23:05:46 -03:00
Guillermo Rauch
5e3d88d082 Added test for emitting an event from server. 2011-06-19 22:51:34 -03:00
Guillermo Rauch
57eedc0184 Added test for sending json from client. 2011-06-19 22:40:12 -03:00
Guillermo Rauch
883cddac0d Added test for sending json from server. 2011-06-19 22:30:40 -03:00
Guillermo Rauch
1f81e60c8c Added test for namespaces disconnection 2011-06-19 22:09:27 -03:00
Guillermo Rauch
28e6886ca1 Make sure to disconnect socket. 2011-06-19 21:41:26 -03:00
Guillermo Rauch
79b337125e Added Socket namespaces tests. Passes smoothly :D 2011-06-19 21:18:15 -03:00
Guillermo Rauch
93ed4954e1 Build. 2011-06-19 21:08:35 -03:00
Guillermo Rauch
bb9f6d9ed1 Added test for server-sent acks. 2011-06-19 21:08:24 -03:00
Guillermo Rauch
b399db0b95 Added client side ack test. 2011-06-19 20:59:41 -03:00
Guillermo Rauch
96a4a49ccd Added server sid ack test. 2011-06-19 20:59:31 -03:00
Guillermo Rauch
c2a5958c1d Fixed tests race condition when re-running a same instance. 2011-06-19 20:57:10 -03:00
Guillermo Rauch
67c9d02a93 Fixed ack handling for regular messages. 2011-06-19 20:55:09 -03:00
Arnout Kazemier
3742c76c90 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO 2011-06-20 00:58:10 +02:00
Arnout Kazemier
98811fdbc2 Fixed cross port connection issues, and simplified the prepareURL stuff 2011-06-20 00:55:51 +02:00
Guillermo Rauch
6b7dd5ff5c Build. 2011-06-19 19:55:33 -03:00
Guillermo Rauch
bbf4b061de Added test for sending messages from browser. 2011-06-19 19:55:00 -03:00
Guillermo Rauch
0ba64df737 Merge pull request #194 from 3rd-Eden/master
Handle errors and advice
2011-06-19 15:46:48 -07:00
Arnout Kazemier
59355dd877 Handle reconnect advice 2011-06-20 00:42:47 +02:00
Arnout Kazemier
8115cbacee Added reconnect advice from broken handshakes + deadcode removal 2011-06-20 00:14:36 +02:00
Guillermo Rauch
412341f713 Fixed builder test 2011-06-19 19:12:26 -03:00
Guillermo Rauch
0aeac333da Removed dead code 2011-06-19 19:11:41 -03:00
Guillermo Rauch
98a5792bf7 Build conflict. 2011-06-19 18:25:58 -03:00
Guillermo Rauch
401966ddd6 Build. 2011-06-19 18:25:32 -03:00
Guillermo Rauch
42676b1972 Added client side integation test for messages reception. 2011-06-19 18:25:16 -03:00
Guillermo Rauch
4c23b01666 Added integration test for messages emission. 2011-06-19 18:24:59 -03:00
Guillermo Rauch
ea234f31d5 Fixed port assignment for socket.io servers creation. 2011-06-19 18:24:20 -03:00
Guillermo Rauch
82925b092c Fixed style. 2011-06-19 18:24:12 -03:00
Guillermo Rauch
2766f777db Changed; expose CORS feature detection from util. 2011-06-19 18:23:43 -03:00
Guillermo Rauch
d392d132c0 Fixed; before we were handling a forced client disconnection as a transport
disconnection, which is conceptually wrong as the connection was healthy.
2011-06-19 18:23:02 -03:00
Guillermo Rauch
e8bea5cc1e Fixed; avoid reconnection on forced client disconnections (both for when the server
kicks a client and the client disconnects itself.
2011-06-19 18:22:09 -03:00
Guillermo Rauch
e6e34d461e Added Socket#disconnectSync private function. 2011-06-19 18:21:51 -03:00
Guillermo Rauch
a96df88297 Changed; make sure to attach a reason to forced client disconnection to attach a reason to forced client disconnection 2011-06-19 18:21:23 -03:00
Guillermo Rauch
ba96bff4f0 Removed sync logic from main disconnect function. 2011-06-19 18:21:01 -03:00
Guillermo Rauch
565974b651 Removed sync option from Socket#disconnect. 2011-06-19 18:20:13 -03:00
Guillermo Rauch
cfad7509ec Fixed style. 2011-06-19 18:19:58 -03:00
Guillermo Rauch
7080cd0145 Fixed sync disconnect packet, as it can only be done for non-cross domain situations
and browsers with CORS (XDomainRequest does not allow for sync requests).
2011-06-19 18:19:12 -03:00
Guillermo Rauch
0c49ee9ef0 Fixed json and message packets. 2011-06-19 18:18:46 -03:00
Guillermo Rauch
c5b7222866 Fixed; disconnect packet for namespace '' means total socket disconnection, and
otherwise we just fire the `disconnect` event for the namespace.
2011-06-19 18:16:26 -03:00
Guillermo Rauch
6075360235 Changed; handled connect packet type separately on socket namespaces. 2011-06-19 18:16:02 -03:00
Guillermo Rauch
5a2ff26d5e Added missing SocketNamespace#disconnect. 2011-06-19 18:15:27 -03:00
Guillermo Rauch
fc95f0bf4d Removed test-runner package.json. This is now taken care by devDependencies of
the main `package.json`. Thanks V1.
2011-06-19 18:14:44 -03:00
Arnout Kazemier
32bf6fecd4 Return instead of wrapping code in a big if statement 2011-06-19 22:33:15 +02:00
Arnout Kazemier
dea523465a Removed my peanuts 2011-06-19 22:29:53 +02:00
Arnout Kazemier
5032cb25d0 clean up 2011-06-19 22:28:13 +02:00
Guillermo Rauch
1ef8e529c8 Merge pull request #193 from whit537/master
The multiple sockets example said "chat" when it meant "news."
2011-06-19 13:26:03 -07:00
Guillermo Rauch
e87577cdec Merge pull request #192 from 3rd-Eden/master
Allow a options in io.connect
2011-06-19 13:23:05 -07:00
Chad Whitacre
33539dfd56 Fix minor type in README.md. 2011-06-19 16:06:50 -04:00
Arnout Kazemier
db7b2a01a9 Fixed io.connect, should take argument 2011-06-19 22:06:22 +02:00
Arnout Kazemier
aeb8832c1d Only emit discconect if the user actually has a nickname 2011-06-19 21:42:53 +02:00
Guillermo Rauch
96231d4987 Merge pull request #191 from 3rd-Eden/master
socket.json.*
2011-06-19 11:11:36 -07:00
Arnout Kazemier
9d4d06c5a6 Fixed socket.json.send and socket.json.emit 2011-06-19 20:08:53 +02:00
Guillermo Rauch
ee9dc67fb8 Added npm link to test-acceptance Makefile rule. 2011-06-19 14:53:32 -03:00
Guillermo Rauch
5f2092aa98 Merge pull request #190 from 3rd-Eden/develop
Styling + bugfix
2011-06-19 10:46:39 -07:00
Arnout Kazemier
1509fbcb19 Removed option.host, it should be provided by default in the constructor 2011-06-19 19:40:09 +02:00
Arnout Kazemier
6363b62f43 Fixed #188 and fixed a bug where secure wasn't correctly set 2011-06-19 19:27:07 +02:00
Arnout Kazemier
0b2ee0849f Styling 2011-06-19 19:10:14 +02:00
Guillermo Rauch
08c8ece68a Updated dev dependencies. 2011-06-19 13:46:01 -03:00
Guillermo Rauch
fb2bce672c Merge pull request #187 from 3rd-Eden/develop
Fixes
2011-06-19 05:15:48 -07:00
Arnout Kazemier
52e578d410 Fixed json and messages, we should have used $emit 2011-06-19 12:16:26 +02:00
Arnout Kazemier
1fc0c3cf29 Fixed stylus typo 2011-06-19 12:00:29 +02:00
Arnout Kazemier
ed70375e9d Added more devDependencies 2011-06-19 11:58:32 +02:00
Arnout Kazemier
e9bb2e732c Merge branch 'master' of https://github.com/LearnBoost/Socket.IO-node 2011-06-19 11:12:34 +02:00
Arnout Kazemier
a5315c80b8 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO into develop 2011-06-19 11:12:27 +02:00
Guillermo Rauch
ca7383096d Build 2011-06-18 19:12:01 -03:00
Guillermo Rauch
9503c04a58 Merge branch 'master' of github.com:LearnBoost/Socket.IO 2011-06-18 19:08:47 -03:00
Guillermo Rauch
3cdb331221 Adapted test. 2011-06-18 19:05:34 -03:00
Guillermo Rauch
b05092b567 Added helper for creation of client-side sockets.
Added globals for state of suite and case.
2011-06-18 19:04:52 -03:00
Guillermo Rauch
15b752d6d2 Expose socket.io ports for each test. 2011-06-18 19:04:40 -03:00
Guillermo Rauch
1a45fd8159 Added socket.io server creator that matches servers. 2011-06-18 19:04:13 -03:00
Guillermo Rauch
b545744617 Merge pull request #186 from 3rd-Eden/develop
indexOf + don't emit handshake errors during reconnect
2011-06-18 13:58:45 -07:00
Arnout Kazemier
1450f9d3a1 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO into develop 2011-06-18 22:55:11 +02:00
Guillermo Rauch
7b7c3d2d36 Added first integration test. Disabled for node until we have node transports. 2011-06-18 17:46:42 -03:00
Guillermo Rauch
9ccd67fd0a Added socket.test.js to list of tests to run. 2011-06-18 17:46:17 -03:00
Guillermo Rauch
e1d135bd05 Fixed style 2011-06-18 17:35:56 -03:00
Arnout Kazemier
c35b8405d1 use indexOf instead of array.indexOf because thats not supported in IE 2011-06-18 22:28:30 +02:00
Arnout Kazemier
f79c625657 Added error handling, and output details to console 2011-06-18 22:17:58 +02:00
Arnout Kazemier
2d84ede3e4 don't emit errors when we are reconnecting 2011-06-18 22:17:33 +02:00
Guillermo Rauch
75f54a56e1 Merge pull request #259 from 3rd-Eden/master
Update unit test + send buffers instead of strings
2011-06-18 12:45:06 -07:00
Arnout Kazemier
78285af72f Fix for encoding of the static serve and we should send buffers instead of strings 2011-06-18 21:37:54 +02:00
Guillermo Rauch
c2c6e47e28 Build 2011-06-18 16:35:11 -03:00
Guillermo Rauch
d90014f4ee Merge pull request #258 from 3rd-Eden/master
Improved static serving
2011-06-18 12:20:38 -07:00
Arnout Kazemier
32db05d178 Passes test suite + 2 new tests 2011-06-18 21:12:11 +02:00
Guillermo Rauch
9b1e8bde13 Changed error detecting to throw upon finding a global leak. 2011-06-18 15:36:12 -03:00
Guillermo Rauch
6c14460c9f Removed old globals. 2011-06-18 15:36:02 -03:00
Guillermo Rauch
95025dcf97 Added flash socket globals to globals whitelist. 2011-06-18 15:35:35 -03:00
Guillermo Rauch
34634edf31 Fixed error handling. 2011-06-18 15:35:21 -03:00
Guillermo Rauch
1eba604dc1 Refactored if node static analysis test. 2011-06-18 15:34:18 -03:00
Guillermo Rauch
515e1e500b Leveraged better should idioms. 2011-06-18 15:33:43 -03:00
Guillermo Rauch
6a72bd17f9 Fixed error handling (to test for null).
Leveraged `should.strictEqual`.
2011-06-18 15:32:51 -03:00
Guillermo Rauch
962b31d6ab Removed legacy tests. 2011-06-18 15:31:59 -03:00
Guillermo Rauch
cb944140ef Removed assert dependency from builder test.
Added should dependency.
2011-06-18 15:30:41 -03:00
Guillermo Rauch
7e176219ee Fixed style in builder common file. 2011-06-18 15:29:23 -03:00
Guillermo Rauch
ea468d922b Fixed should Assertion#contain. 2011-06-18 15:28:53 -03:00
Arnout Kazemier
dba93a1bb3 lib/ 2011-06-18 20:28:13 +02:00
Guillermo Rauch
24d1236097 Fix should exports in require with workaround. 2011-06-18 15:24:48 -03:00
Guillermo Rauch
dd12179756 Fixed order of exports for node in should. 2011-06-18 15:22:53 -03:00
Guillermo Rauch
7f5e870b6e Default port to 443 in node 2011-06-18 15:22:16 -03:00
Guillermo Rauch
ef1e6e4283 Fixed; default error to null instead of undefined.
TODO: fix style.
2011-06-18 15:21:43 -03:00
Arnout Kazemier
567140e183 -- console.dir 2011-06-18 20:15:55 +02:00
Arnout Kazemier
b1837f348e Improved static serving of content 2011-06-18 20:14:58 +02:00
Guillermo Rauch
d6b45929d7 Added should dev dependency. 2011-06-18 14:29:05 -03:00
Guillermo Rauch
2b9b5493d0 Fixed; made removeAllListeners behavior with no arguments consistent between
browser and node 0.4.
2011-06-18 13:37:34 -03:00
Guillermo Rauch
570c41806e Fixed style. 2011-06-18 12:41:03 -03:00
Guillermo Rauch
3499620cb0 Changed; make builder is now make build. 2011-06-18 12:31:06 -03:00
Guillermo Rauch
ce5a6458c1 Merge pull request #180 from 3rd-Eden/develop
Develop
2011-06-18 08:29:50 -07:00
Arnout Kazemier
e51368cdc4 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO into develop 2011-06-18 17:24:48 +02:00
Guillermo Rauch
895569693f Fixed tests I broke. 2011-06-18 12:23:17 -03:00
Guillermo Rauch
bd51fc923b Fixed should i() representation <3. 2011-06-18 12:22:58 -03:00
Arnout Kazemier
bf8609f6a9 Because mine > @rauchg's 2011-06-18 16:57:00 +02:00
Arnout Kazemier
4a17931d37 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO into develop
Conflicts:
	dist/socket.io.js
	dist/socket.io.min.js
2011-06-18 16:56:51 +02:00
Arnout Kazemier
d8f983d45f Added the .swf files to the dist folder for easy file serving in socket.io 2011-06-18 16:43:12 +02:00
Guillermo Rauch
65d31b5f6a Build 2011-06-18 11:41:47 -03:00
Guillermo Rauch
3707c5d7a9 Added custom client serving to serve the local repository. 2011-06-18 11:35:42 -03:00
Guillermo Rauch
0559f0e7c0 Adapted tests to have different defaults for server and client side. 2011-06-18 11:31:51 -03:00
Guillermo Rauch
2c0f966728 Added default port as 443 if the port is specified but the uri protocol is secure
and the page is not being transmitted over SSL.
2011-06-18 11:30:24 -03:00
Arnout Kazemier
fc4b8c382e Include flashsocket above the websocket fallback so we can disable the
AUTO-INITIALIZE before the code gets executed, preventing a double init call
2011-06-18 16:18:22 +02:00
Guillermo Rauch
fe2ae1fa6c Fixed situation where there's a location.port but we're using https://, in which
case we want to do 443.
2011-06-18 11:09:54 -03:00
Arnout Kazemier
6a9207369c Added flashsocket to the /transports.
The transport check now sends the socket instance so we can leverage methods
of that inside the check.
Updated the builder to also include flashsocket
2011-06-18 16:07:05 +02:00
Guillermo Rauch
b5e7e41a15 Build. 2011-06-18 10:33:31 -03:00
Guillermo Rauch
41eef0e619 Added test-acceptance rule to Makefile. 2011-06-18 10:32:59 -03:00
Guillermo Rauch
b0147f3af8 Merge branch 'master' of github.com:LearnBoost/Socket.IO-node 2011-06-18 10:14:05 -03:00
Guillermo Rauch
13e7f4087a Exports WSClient 2011-06-18 10:13:38 -03:00
Guillermo Rauch
de1b62c75c Merge pull request #257 from 3rd-Eden/master
Call the init for the correct transport
2011-06-18 06:06:32 -07:00
Arnout Kazemier
0400a51b91 Should init the transport with the init function
not the flashsocket each time
2011-06-18 11:17:16 +02:00
Guillermo Rauch
4079da41f3 Changed; simplified flash socket client by inheriting from websocket test client.
Removed usage of assert
Improved usage of should.js
 - leveraged should.include.string for strings `indexOf`
 - leveraged should.contain for arrays `indexOf`
 - removed usage of `ok` and `!!`
 - added better error checks
Fixed style.
2011-06-18 04:45:14 -03:00
Guillermo Rauch
2be18c8324 Fixed style.
Changed; make sure logging is lowercase.
2011-06-18 04:43:23 -03:00
Guillermo Rauch
b928e77fd1 Changed non-socket.io scope requests logging since it was confusing users. 2011-06-18 04:43:01 -03:00
Guillermo Rauch
c2e48f36b2 Changed; attempt to initialize all transports. 2011-06-18 04:42:33 -03:00
Guillermo Rauch
54e78277c0 Changed nickname in irc example. 2011-06-18 04:42:04 -03:00
Guillermo Rauch
3116b8b091 Merge pull request #256 from 3rd-Eden/master
flashsocket
2011-06-17 18:49:45 -07:00
Arnout Kazemier
9a98a3ed21 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO into develop 2011-06-18 01:19:57 +02:00
Arnout Kazemier
ab0c0d110c Added tests for the policy file server
Changed `update:` back to `set:` because it's more pretty
2011-06-18 01:13:44 +02:00
Guillermo Rauch
86b48908ce Whitespace fix 2011-06-17 19:33:12 -03:00
Arnout Kazemier
26a30c5863 Added WIP flashsocket 2011-06-17 23:10:23 +02:00
Arnout Kazemier
78ccafaf25 new build 2011-06-17 22:41:26 +02:00
Arnout Kazemier
a67e909a0a Removed console.log 2011-06-17 22:39:41 +02:00
Guillermo Rauch
e16f1832ac Merge branch 'master' of github.com:LearnBoost/Socket.IO-node 2011-06-17 16:14:40 -03:00
Guillermo Rauch
2a3e10f95d Updated jsonp-polling testing client POST. 2011-06-17 15:51:12 -03:00
Guillermo Rauch
72936ef1c5 Changed; JSONP flagged for POST url decoding. 2011-06-17 15:50:53 -03:00
Guillermo Rauch
ad8f7866cb Added support for urlencoded POST. 2011-06-17 15:50:40 -03:00
Guillermo Rauch
d203aea337 Changed; made framing shorter for json-p iframe POST. 2011-06-17 14:54:58 -03:00
Guillermo Rauch
0c324e0030 Fixed json-p polling comment header. 2011-06-17 14:47:21 -03:00
Arnout Kazemier
ee7d4e6a9f better websocket detection + sniffing for WebSocket fallback 2011-06-17 11:19:47 +02:00
Arnout Kazemier
6ff99cd9f5 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO into develop 2011-06-17 11:08:13 +02:00
Guillermo Rauch
b69d5e5ccb Fixed opera stateChange() 2011-06-17 01:52:13 -03:00
Guillermo Rauch
5e2ab3926f Merge pull request #253 from 3rd-Eden/master
Updated notifications
2011-06-16 14:45:33 -07:00
Arnout Kazemier
070d76d1d5 Added test suite, updated set to update and enabled it in enable and disable commands 2011-06-16 22:51:25 +02:00
Arnout Kazemier
7646e09a1d receive updates of config changes 2011-06-16 22:31:53 +02:00
Arnout Kazemier
96a45713bc Merge branch 'master' of https://github.com/LearnBoost/Socket.IO into develop 2011-06-16 22:29:19 +02:00
Guillermo Rauch
27325a56a7 Fix for op precedence. 2011-06-16 16:37:09 -03:00
Guillermo Rauch
c6bdadcf05 Fixed XHR on opera. 2011-06-16 16:02:58 -03:00
Guillermo Rauch
67980da371 Removed unneeded check. 2011-06-16 16:02:42 -03:00
Guillermo Rauch
49c532f6bb Fixed style (85 cols). 2011-06-16 15:50:18 -03:00
Guillermo Rauch
e47c94bdd2 Changed; delete reference to function upon ack. 2011-06-16 15:49:22 -03:00
Guillermo Rauch
ef3ab9bd15 Fixed #125. Weird error on IE8 under certain circumstances. 2011-06-16 15:35:10 -03:00
Guillermo Rauch
cddae4226c Fixed drained setting in the HTMLFile transport. 2011-06-16 14:52:52 -03:00
Guillermo Rauch
1a3fc57ba4 Fixed WebSocket#flush.
Fixed style.
2011-06-16 14:52:34 -03:00
Guillermo Rauch
b94320fb97 Changed; improved instrumentation for setting request. 2011-06-16 13:59:01 -03:00
Guillermo Rauch
99ab97af6d Changed; custom browser client handler is now a middleware-like function.
Changed; client can be disabled altogether.
Changed; made client minification optional.
Changed; made client etag serving optional.
Added appropriate new tests.
2011-06-16 13:37:26 -03:00
Guillermo Rauch
32d50f77c7 Added Manager#configure callbacks scope test. 2011-06-16 13:37:00 -03:00
Guillermo Rauch
81dedf11d2 Fixed; keep scope for Manager#configure. 2011-06-16 13:34:01 -03:00
Guillermo Rauch
028487a013 Changed; leveraged .get instead of .set with one argument. 2011-06-16 13:28:48 -03:00
Guillermo Rauch
d6a01b56f5 Added new browser client options. 2011-06-16 13:28:14 -03:00
Guillermo Rauch
b16d8e96b1 Make MemoryStore#set fn parameter optional. 2011-06-16 11:10:47 -03:00
Guillermo Rauch
9f19145c4d Fixed style. 2011-06-16 11:05:52 -03:00
Arnout Kazemier
fda43153c9 Don't error if the io.connect() is called multiple times 2011-06-15 20:27:06 +00:00
Arnout Kazemier
cad92b900a Emit changes using one single method to both Socket and all namespaces 2011-06-15 21:51:27 +02:00
Arnout Kazemier
f84c4d51b3 Handle onConnect 2011-06-15 21:49:46 +02:00
Arnout Kazemier
842b30a735 fixed version require 2011-06-15 21:08:40 +02:00
Arnout Kazemier
225f81b554 Force local, or NPM is going to bitch about global installs 2011-06-15 21:00:46 +02:00
Arnout Kazemier
088a048290 Merge branch 'develop' of github.com:3rd-Eden/Socket.IO into develop 2011-06-15 20:01:37 +02:00
Arnout Kazemier
72af658510 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO into develop
Conflicts:
	dist/socket.io.min.js
2011-06-15 20:00:46 +02:00
Guillermo Rauch
c245cf3eb3 JSON fix for IE 2011-06-14 07:44:38 -03:00
Arnout Kazemier
361b9e5804 set col 80 ;D 2011-06-13 18:35:36 +00:00
Arnout Kazemier
22e96df6cb revert my change 2011-06-13 19:19:16 +02:00
Arnout Kazemier
a2adbd0d85 new build 2011-06-13 19:15:22 +02:00
Arnout Kazemier
b525871a97 Merge branch 'master' of https://github.com/LearnBoost/Socket.IO into develop
Conflicts:
	dist/socket.io.js
2011-06-13 19:14:54 +02:00
Guillermo Rauch
ed8971b2fb Added IRC example. 2011-06-13 14:14:12 -03:00
Arnout Kazemier
c151b78fc6 Merge branch 'develop' of https://github.com/LearnBoost/Socket.IO into develop
Conflicts:
	dist/socket.io.js
	dist/socket.io.min.js
2011-06-13 19:10:59 +02:00
Arnout Kazemier
bb13b50119 fixed path 2011-06-13 19:09:19 +02:00
Guillermo Rauch
70270f9aad Make sure running tests installs the npm dev dependencies. 2011-06-13 12:36:27 -03:00
Guillermo Rauch
5706456b08 Build 2011-06-13 12:31:32 -03:00
Guillermo Rauch
f2cad28b93 Added packet buffering capabilities to Socket#packet. 2011-06-13 12:30:53 -03:00
Guillermo Rauch
d5b809d414 Build. 2011-06-13 12:19:18 -03:00
Guillermo Rauch
1e7b4a596d Changed; trigger open in XHR transports right after starting polling. 2011-06-13 12:18:16 -03:00
Guillermo Rauch
7ec45b516a Added; process buffer after opening socket. 2011-06-13 12:17:54 -03:00
Guillermo Rauch
9218020111 Fixed; make sure to send connect packet after opening sub-socket. 2011-06-13 12:13:56 -03:00
Guillermo Rauch
240b2cd094 Added buffer and namespaces data structures initialization to Socket constructor. 2011-06-13 12:13:35 -03:00
Guillermo Rauch
bd2ce6ecf3 Fixed propagation of packets through SocketNamespace. 2011-06-13 12:10:23 -03:00
Guillermo Rauch
aafbf857dc Trading vim highlighting with pretty github highlighting. 2011-06-13 03:31:13 -03:00
Guillermo Rauch
005f251c69 Trying out GH highlighting. 2011-06-13 03:28:39 -03:00
Guillermo Rauch
94bc2bc05b Trying out GH highlighting. 2011-06-13 03:27:34 -03:00
Guillermo Rauch
c227426f7e Added Readme clarification. 2011-06-13 03:25:59 -03:00
Guillermo Rauch
f06af4f1a3 Updated build 2011-06-13 03:22:59 -03:00
Guillermo Rauch
292bd8ddb4 Added readme clarification 2011-06-13 03:22:11 -03:00
Guillermo Rauch
33e474de46 Trimming fat from repository. 2011-06-13 03:17:14 -03:00
Guillermo Rauch
32f216d2f7 Leveraged npm devDependencies for server. 2011-06-13 03:16:51 -03:00
Guillermo Rauch
0e64f6f746 Removed legacy client 2011-06-13 03:11:12 -03:00
Guillermo Rauch
ad059c7d86 Added chat example. 2011-06-13 03:06:27 -03:00
Guillermo Rauch
ea8cfc5c8f Fixed problem with multiple request handling.
Added proper cleanup
2011-06-13 02:58:10 -03:00
Guillermo Rauch
8fefeb7bd3 Added missing util#toArray. 2011-06-13 02:25:37 -03:00
Guillermo Rauch
838c5ed6f8 Removed automatic transport opening upon creation. 2011-06-12 21:45:29 -03:00
Guillermo Rauch
80c78de852 Fixed style and added TODO for Transport#onData handling. 2011-06-12 21:44:55 -03:00
Guillermo Rauch
f09ba3ba94 Removed onConnect upon socket open. 2011-06-12 21:34:44 -03:00
Guillermo Rauch
80e9edc6a7 Removed onConnect call in handshake since we now have connect packets for all
namespaces, including `''`.
Changed; style fixes
2011-06-12 21:31:10 -03:00
Guillermo Rauch
d931496aa6 Added missing ACK support to message, json and event packets.
Added ACK handling.
2011-06-12 21:30:14 -03:00
Guillermo Rauch
50640cd571 Added ack function to SocketNamespace packet handling. 2011-06-12 21:29:47 -03:00
Guillermo Rauch
ae3be33977 Fixed SocketNamespace signature. 2011-06-12 21:29:06 -03:00
Guillermo Rauch
138a6fb2ae Changed; perform default host/port setting in io#connect. 2011-06-12 21:27:19 -03:00
Guillermo Rauch
c6185ebb0d Adapted tests. 2011-06-12 19:50:40 -03:00
Guillermo Rauch
cecd0296af Added instrumentation for websocket packets. 2011-06-12 19:50:22 -03:00
Guillermo Rauch
d80a5f37a0 Added instrumentation for xhr packets. 2011-06-12 19:50:12 -03:00
Guillermo Rauch
1743baba29 Changed behavior of end and close events, and introduced swapped semaphore. 2011-06-12 19:49:50 -03:00
Guillermo Rauch
9cc1e775c1 Added handshaken instrumentation 2011-06-12 19:49:39 -03:00
Guillermo Rauch
b9ab031f0e Added callback to io.listen.
Removed race condition in websocket room tests (for real this time)
2011-06-12 12:35:18 -03:00
Guillermo Rauch
7d2efd99ab Added timeout for room messages. 2011-06-12 09:03:44 -03:00
Guillermo Rauch
4bd5805a32 Removed 2 extra tests (manual ACKs with .send) 2011-06-12 08:38:20 -03:00
Guillermo Rauch
e7b4d6a38d Fixed race condition in tests. 2011-06-12 08:38:06 -03:00
Guillermo Rauch
e77a363c3c Changed; .send ACK always automatic. 2011-06-12 08:37:40 -03:00
Guillermo Rauch
1db72e17f3 Simplified acks. 2011-06-12 08:37:27 -03:00
Guillermo Rauch
f40e9bde23 Fixed xhr-polling tests. 2011-06-12 07:58:35 -03:00
Guillermo Rauch
32cd5d7d55 Fixed ugly hack. 2011-06-12 07:58:05 -03:00
Guillermo Rauch
e574ba4a5c Fixed; added echo connect packet for all namespaces connections. 2011-06-12 07:53:46 -03:00
Guillermo Rauch
6583e9eac7 Simulate a connect packet when connecting to socket, to trigger the connect event
on '' namespace transparently.
2011-06-12 07:53:17 -03:00
Guillermo Rauch
50a8d2d50a Revert. 2011-06-11 22:56:55 -03:00
Guillermo Rauch
19a0fb6912 Always store consumer function. 2011-06-11 18:24:08 -03:00
Guillermo Rauch
2066aef41a Changed; minor thingies. 2011-06-11 18:22:29 -03:00
Guillermo Rauch
66c1d5fece Added right Content-Type header for JSONP handshake. 2011-06-11 18:18:55 -03:00
Guillermo Rauch
442f9d9522 Fixed JSON-p handshake error reporting (need tests!) 2011-06-11 18:14:18 -03:00
Guillermo Rauch
addf31ab26 Adapted client encoder/decoder for event spec change. 2011-06-11 18:10:38 -03:00
Guillermo Rauch
1db340aad5 Adapted server encoder/decoder for event spec change. 2011-06-11 18:10:03 -03:00
Guillermo Rauch
baa8056b41 Added coverage analysis flag to Makefile. 2011-06-11 17:37:38 -03:00
Guillermo Rauch
7433e58908 Adapted xhr-polling tests. 2011-06-11 17:34:20 -03:00
Guillermo Rauch
3091490cc2 Fixed style. 2011-06-11 17:34:10 -03:00
Guillermo Rauch
50413024bc Adapted jsonp-polling tests. 2011-06-11 16:41:51 -03:00
Guillermo Rauch
19c62c1f7b Fixed; force disconnection can still happen even with temporarily closed transports. 2011-06-11 16:41:28 -03:00
Guillermo Rauch
1e50ac91b9 Removed re-used socket transport validation concept, as it might mis-authorizse a socket
when more than one io.Socket is used in a browser.
2011-06-11 16:40:05 -03:00
Guillermo Rauch
a5a7ec4dbd Adapted websocket tests for connect packet. 2011-06-10 18:16:37 -03:00
Guillermo Rauch
b9e138dc34 Added optimization to write one buffer.
Fixed bug where relying on the `drain` event when there's nothing to drain would
prevent volatile messages from ever being sent.
Added websocket write instrumentation.
2011-06-10 18:14:31 -03:00
Guillermo Rauch
3a22ab097e Adapted htmlfile tests. 2011-06-10 12:07:37 -03:00
Guillermo Rauch
13e9727e5c Remove connection event upon socket initialization, this is now handled by the Manager. 2011-06-10 12:06:55 -03:00
Guillermo Rauch
9087d32c74 Make sure to resume() as soon as the count is registered.
Echo back connect packet upon first connection.
2011-06-10 12:03:55 -03:00
Guillermo Rauch
50f6645e0b Renamed Manager#for with Manager#of in tests. 2011-06-09 19:46:44 -03:00
Guillermo Rauch
bcb00306b2 Renamed Manager#for with Manager#of. 2011-06-09 19:46:31 -03:00
Guillermo Rauch
81dd623773 Renamed Manager#for with Manager#of in examples. 2011-06-09 19:46:09 -03:00
Arnout Kazemier
605e92b8e1 Made the io.tranports dynamic based on the transports that are available 2011-06-09 21:17:05 +02:00
Arnout Kazemier
ed9dae89a6 moved builder tests 2011-06-09 20:30:54 +02:00
Arnout Kazemier
f0e57b86c4 Added builder again 2011-06-09 19:46:04 +02:00
Arnout Kazemier
aef8ed5409 Merge branch 'develop' of https://github.com/LearnBoost/Socket.IO into develop
Conflicts:
	Makefile
	test/index.html
2011-06-09 19:44:12 +02:00
Guillermo Rauch
d3916bcfca Clarified style license 2011-06-09 13:53:31 -03:00
Guillermo Rauch
1b70eb186a Added express app to perform browser testing. 2011-06-09 13:31:56 -03:00
Guillermo Rauch
5686f42af4 Added symlink to lib/io by the name of the project. 2011-06-09 13:31:27 -03:00
Guillermo Rauch
696869643f Added node_modules to gitignore 2011-06-09 13:31:14 -03:00
Guillermo Rauch
822c90bcde Added my own adapted version of should.js that works on the browser and doesn't rely
on getters, but a tree of objects.
2011-06-09 13:30:36 -03:00
Guillermo Rauch
629f2a189d Added new common.js tests (expresso-like), with browser-compliant should(). 2011-06-09 13:30:13 -03:00
Guillermo Rauch
579d816bac Removed old qunit tests. 2011-06-09 13:30:01 -03:00
Guillermo Rauch
d0b59ec0fc Added devDependencies to package.json 2011-06-09 13:28:59 -03:00
Guillermo Rauch
debafe5a54 Fixed io.util.request.
Removed fixed 80 port for node (must review this).
2011-06-09 13:28:19 -03:00
Guillermo Rauch
582c233a39 Fixed typo. 2011-06-09 13:28:07 -03:00
Guillermo Rauch
8a11d1adf8 Added server-side test running to Makefile. 2011-06-09 13:27:51 -03:00
Guillermo Rauch
e2476be2c7 Added support to npmignore 2011-06-09 13:27:40 -03:00
Guillermo Rauch
4f18b59737 Added test runner node_modules to gitignore 2011-06-09 13:27:29 -03:00
Arnout Kazemier
651dbda054 Updated the io to include the builder
Updated Make file to do node bin/builder.js
2011-06-09 14:49:27 +02:00
Guillermo Rauch
a4cac1e423 Fixed client serving once it's been cached.
Fixed style.
2011-06-09 08:49:15 -03:00
Guillermo Rauch
f306870246 Added failing test: serving the client once it's been cached. 2011-06-09 08:49:02 -03:00
Guillermo Rauch
4db20e870a Added client require to manager.js
Removed clientVersion access from parent exports.
2011-06-09 08:31:15 -03:00
Guillermo Rauch
9cf9f1e9e0 Point to client.dist to access dist/ directory location. 2011-06-09 08:15:35 -03:00
Arnout Kazemier
e113083bfa Updated the make file to run a the test suite 2011-06-09 10:43:23 +02:00
Arnout Kazemier
a42496dd3c Added test suite for the builder 2011-06-09 10:35:11 +02:00
Arnout Kazemier
6dd7120b71 Moved the comment block for node inside the ifstatement, so it get's removed after compilation 2011-06-09 10:13:50 +02:00
Arnout Kazemier
d2d6558f8f Fixed the test suite again after someone, *cough* @rauchg *cough* delete all the qunit files and moved the files to a /dist folder 2011-06-09 10:06:05 +02:00
Arnout Kazemier
32a112bb87 Added the builder to the make file,
updated the builder to choose if we want to remove // node if statements
updated to the new file locations
disabled unfinished transports, need to be re-enabled once they are completed
2011-06-09 09:58:12 +02:00
Arnout Kazemier
8ddca3b7af Added builder 2011-06-09 09:47:58 +02:00
Guillermo Rauch
e05b9ce990 Added other necessary io public properties. 2011-06-08 20:49:46 -03:00
Guillermo Rauch
e8640d6713 Changed; leveraged npm socket.io-client module from io. 2011-06-07 20:15:33 -03:00
Guillermo Rauch
c007ab89f9 Added node_modules to gitignore 2011-06-07 20:15:17 -03:00
Guillermo Rauch
c004ec92ba Changed; package.json now server-side *and* browserify compatible. 2011-06-07 20:14:18 -03:00
Guillermo Rauch
294d55a43f Implemented dist/ directory in builder. 2011-06-07 20:14:09 -03:00
Guillermo Rauch
e34906c650 Added dist/ directory. 2011-06-07 19:29:45 -03:00
Guillermo Rauch
8438dcf309 Adjusted package.json 2011-06-07 19:12:55 -03:00
Guillermo Rauch
a4568290a6 Changed package.json
- added socket.io-client dependency
- added homepage
2011-06-07 19:10:14 -03:00
Guillermo Rauch
35e1d9b0f6 Removed old client. 2011-06-07 19:06:24 -03:00
Guillermo Rauch
49c0a0e7e8 Added .npmignore 2011-06-07 17:56:35 -03:00
Guillermo Rauch
a9573b061f Added .gitignore 2011-06-07 17:56:24 -03:00
Guillermo Rauch
15fefa0664 Changed; Transport#send is now only concerned with strings. 2011-06-07 17:13:18 -03:00
Guillermo Rauch
688497239f Changed; style fixes. 2011-06-07 17:13:08 -03:00
Guillermo Rauch
631ad0ddad Added Transport#packet.
Changed; Transport#onHeartbeat now leverages Transport#Packet.
2011-06-07 17:12:41 -03:00
Guillermo Rauch
56c67784d4 Added Socket#packet.
Removed Socket#send.
2011-06-07 17:11:54 -03:00
Guillermo Rauch
caa61e1f60 SocketNamespace#packet now calls Socket#packet. 2011-06-07 17:11:39 -03:00
Guillermo Rauch
2ccda648b4 Removed old tests location. 2011-06-07 17:00:48 -03:00
Guillermo Rauch
4df16105b1 Merge pull request #174 from 3rd-Eden/develop
Heartbeats and connect
2011-06-07 12:19:52 -07:00
Arnout Kazemier
5be17ed500 Connect event should now fire again.. 2011-06-07 21:15:22 +02:00
Arnout Kazemier
343779bb1b Don't double encode.. Removed .packet and just updated heartbeat to do a .send instead 2011-06-07 20:53:06 +02:00
Arnout Kazemier
87e8f7888e Fixed missing .packet method 2011-06-06 22:41:04 +02:00
Guillermo Rauch
d4788e7e2a Replaced testing files. 2011-06-06 13:22:15 -03:00
Guillermo Rauch
c83764f99f Fixed error and disconnect handling for subsockets.
Added onConnect call in onOpen.
2011-06-06 12:36:19 -03:00
Guillermo Rauch
4926211566 Fixed decodePacket reference. 2011-06-06 12:31:48 -03:00
Guillermo Rauch
c5ccaa9adc Added missing packet parameter. 2011-06-06 12:25:10 -03:00
Guillermo Rauch
c9e674ab51 Merge pull request #173 from dvv/develop
Second chunk of fixes, cumulative with #170
2011-06-06 07:39:31 -07:00
Vladimir Dronnikov
ca4e2f5dcf WS#prepareUrl should override Transport#prepareUrl 2011-06-06 08:16:10 -04:00
Vladimir Dronnikov
2ddd53d46c WS#connect -> WS#open 2011-06-06 08:02:17 -04:00
Vladimir Dronnikov
55b98e282e Merge branch 'develop' of github.com:3rd-Eden/Socket.IO into develop 2011-06-06 07:44:42 -04:00
Vladimir Dronnikov
0c52c5c3b2 cleanup 2011-06-06 07:40:41 -04:00
Arnout Kazemier
2c4350afbd Merge branch 'develop' of git://github.com/dvv/Socket.IO into develop 2011-06-06 13:40:16 +02:00
Vladimir Dronnikov
3be0ff1043 rebuilt minified 2011-06-06 07:29:22 -04:00
Vladimir Dronnikov
e365ae8ec7 typo. Socket#onConnect() is given use 2011-06-06 07:28:09 -04:00
Arnout Kazemier
07e3605f92 Websocket so send error to socket.onError not to websocket.onError which will cause a loop 2011-06-06 13:20:06 +02:00
Vladimir Dronnikov
21e730fe60 Merge branch 'develop' of github.com:3rd-Eden/Socket.IO into develop 2011-06-06 07:17:46 -04:00
Arnout Kazemier
979f692921 Renamed this.socket to this.websocket as it clashes with the Socket instance in the tranport.. which is also called this.socket 2011-06-06 13:10:54 +02:00
Vladimir Dronnikov
4e5f83587a Merge branch 'develop' of github.com:3rd-Eden/Socket.IO into develop 2011-06-06 04:52:24 -04:00
Arnout Kazemier
f864d2ec72 Fixes wrong inhert & mixin arguments + added io.sockets 2011-06-06 10:46:00 +02:00
Vladimir Dronnikov
c260ad8756 Merge branch 'develop' of github.com:3rd-Eden/Socket.IO into develop
Conflicts:
	lib/transports/websocket.js
	socket.io.min.js
2011-06-06 03:47:42 -04:00
Vladimir Dronnikov
d1f1ce4575 this typos 2011-06-06 03:40:31 -04:00
Arnout Kazemier
02ba0d7db8 Updated to the correct position of the parsers 2011-06-05 21:38:33 +02:00
Arnout Kazemier
e04f5e36b2 Use native JSON if it's supported
Updated reference in transport to the new location of the parser
Updated the test suite to use the io.JSON
2011-06-05 21:32:38 +02:00
Arnout Kazemier
0dae527615 Small refactor of the test suite to use equal instead of ok 2011-06-05 21:14:35 +02:00
Arnout Kazemier
766f5d595e Added qunit test suite for the parser 2011-06-05 20:58:53 +02:00
Arnout Kazemier
c8c2c6ede4 add all parse methods under the parser namespace 2011-06-05 19:34:55 +02:00
Arnout Kazemier
478894bc35 new builds 2011-06-02 22:41:47 +02:00
Arnout Kazemier
6451fd6b2c Added util qunit test 2011-06-02 22:41:20 +02:00
Arnout Kazemier
e2a5ff8fbe fancy pancy redcarpet highlight 2011-06-02 22:39:20 +02:00
Arnout Kazemier
796506f91a Fixed uniqueUri as parseUri doesn't return :// for protocols
it https should default to port 443 instead of port 80

the merge function now allows deep merges without chocking on recursion
2011-06-02 22:33:35 +02:00
Guillermo Rauch
e0da36e944 Fixed old listeners calls. 2011-06-02 16:55:32 -03:00
Guillermo Rauch
f8697e22ff Fix json-p handshake. 2011-06-02 16:43:13 -03:00
Arnout Kazemier
4d87a8ccd6 Only check for complete, loaded indicates that the DOM is loaded, and not the page and all its resources 2011-06-02 20:57:07 +02:00
Arnout Kazemier
08e19abff6 Use native Array.isArray where possible 2011-06-02 20:52:23 +02:00
Arnout Kazemier
2de0561073 Added qunit test suite in /tests/qunit/qunit
Added io.qunit.js
Added event.qunit.js which follows the tests of the Node.js event emitter
2011-06-02 20:18:31 +02:00
Arnout Kazemier
78b5c80a95 Changed the 'undefined' === module check as in the qunit test suite module is a function and this caused allot errors; 2011-06-02 20:12:23 +02:00
Arnout Kazemier
e04fb5e9f7 added alias for addListener as the EventEmitter also supports this 2011-06-02 20:11:49 +02:00
Guillermo Rauch
4570b1e3e1 Merge pull request #166 from dvv/develop
Fixed typos
2011-06-02 05:49:05 -07:00
Vladimir Dronnikov
e71b2b5644 here we go again -- typos mostly 2011-06-02 08:20:07 -04:00
Vladimir Dronnikov
c6d938babe another portion of typos 2011-06-02 06:57:57 -04:00
Vladimir Dronnikov
824282d382 typos 2011-06-02 06:34:41 -04:00
Guillermo Rauch
6fe5043ea4 Updated README 2011-05-30 12:39:44 -03:00
Guillermo Rauch
6ab0a4cea5 Updated tests for jsonp callback format. 2011-05-30 11:38:36 -03:00
Guillermo Rauch
abde1ca389 Updated jsonp callback format. 2011-05-30 11:38:19 -03:00
Guillermo Rauch
76bec7bc7e Faster websocket parsing (thanks mraleph) 2011-05-30 11:37:59 -03:00
Guillermo Rauch
7970815a54 Updated default timeouts.
Added error handling for JSONP handshake.
2011-05-30 11:37:20 -03:00
Guillermo Rauch
1c9db6c902 Updated builder 2011-05-30 11:31:51 -03:00
Guillermo Rauch
49816ac6c1 Added new io namespace. 2011-05-30 11:31:37 -03:00
Guillermo Rauch
6267a02056 Refactored Socket 2011-05-30 11:31:24 -03:00
Guillermo Rauch
e809856d84 Refactored Transport 2011-05-30 11:31:12 -03:00
Guillermo Rauch
3524463831 Refactored HTMLFile 2011-05-30 11:31:01 -03:00
Guillermo Rauch
d1a119d9c3 New EventEmitter 2011-05-30 11:30:51 -03:00
Guillermo Rauch
e6c49ea102 Now bundling (non-global non-obstrusive) JSON. 2011-05-30 11:30:31 -03:00
Guillermo Rauch
5650e91ecb Added new parser. 2011-05-30 11:30:25 -03:00
Guillermo Rauch
f78a874a3a Refactored JSONP polling transport. 2011-05-30 11:30:12 -03:00
Guillermo Rauch
c0c7b92387 Refactored websocket transport. 2011-05-30 11:30:01 -03:00
Guillermo Rauch
f2724ede6c Removed non-standard transports. 2011-05-30 11:29:50 -03:00
Guillermo Rauch
74fd94f2c5 Refactored XHR-polling transport. 2011-05-30 11:29:25 -03:00
Guillermo Rauch
7879f35f1e Refactored XHR transport. 2011-05-30 11:29:12 -03:00
Guillermo Rauch
4ee1d5d94b Added new utilities, refactored others. 2011-05-30 11:28:51 -03:00
Guillermo Rauch
39c6307850 Added SocketNamespace interface. 2011-05-30 11:28:36 -03:00
Guillermo Rauch
81e1c44be1 Updated client API. 2011-05-30 07:42:21 -03:00
Guillermo Rauch
9cf4008c99 Fixes for README
- Added broadcast example
- Restored code snippets since the autodetection was working but vim didn't color it
  nicely.
2011-05-29 18:36:28 -03:00
Guillermo Rauch
14c96c143c Removed console.log statements 2011-05-25 01:29:15 -07:00
Guillermo Rauch
bd1970606c Adjusted timeouts in websocket tests to avoid race conditions. 2011-05-25 01:27:01 -07:00
Guillermo Rauch
e472483bb1 Make sure to retain packet.endpoint for socket messsages. 2011-05-25 01:26:46 -07:00
Guillermo Rauch
faa00b8b2d Added test for broadcasting events in rooms. 2011-05-25 00:57:37 -07:00
Guillermo Rauch
62d3e6341e Added test for broadcasting json to a room. 2011-05-25 00:54:57 -07:00
Guillermo Rauch
7678acc8e6 Added broadcast with to test. 2011-05-25 00:51:10 -07:00
Guillermo Rauch
5f1d5e30dc Reverted back to the room flag for Socket. This way we can call SocketNamespace#in
when we relay a packet to the namespace, instead of overriding the endpoint acting
directly on SocketNamespace#flag. In addition, the room is only useful for broadcasting,
and it has no effect on the client, so `endpoint` should remain untouched.
2011-05-25 00:49:43 -07:00
Guillermo Rauch
d2d481ca8b Added test for broadcasting an event. 2011-05-25 00:33:01 -07:00
Guillermo Rauch
9f4f52beb4 Added test for broadcasting json.
Removed unnecessary connections counter in broadcast tests.
2011-05-25 00:28:54 -07:00
Guillermo Rauch
3ba715eb49 Added support for the Socket#broadcast getter in Socket#packet
Added Socket#setFlags for consistency with SocketNamespace.
2011-05-25 00:22:41 -07:00
Guillermo Rauch
4427b3e64b Added SocketNamespace#except flag setter.
Added; keep track of exceptions (list of session ids) as part of flags, that then
get reset.
Fixed JSON double encoding.
2011-05-25 00:21:51 -07:00
Guillermo Rauch
41ab26b202 Added broadcast test. 2011-05-25 00:21:42 -07:00
Guillermo Rauch
be21ca2f19 Added test for sending json to all clients in a namespace. 2011-05-24 23:55:15 -07:00
Guillermo Rauch
60dec3dd83 Add test for sending json to a room. 2011-05-24 23:52:54 -07:00
Guillermo Rauch
0f0abab380 Added test for emitting an event to a room. 2011-05-24 23:50:18 -07:00
Guillermo Rauch
c3936cb5f9 Add test for sending to all clients in a given room. 2011-05-24 23:47:41 -07:00
Guillermo Rauch
aac298d212 Fixed Socket#to and Socket#join. Make sure that the name of the room preserves the
namespace as prefix, unless the namespace is ''. This prevents collisions between
rooms of the '' endpoint with other arbitrary endpoints.
2011-05-24 23:46:59 -07:00
Guillermo Rauch
3f030bd3fb Fixed SocketNamespace#in, editing the endpoint flag directly instead of creating
`room`.
2011-05-24 23:46:31 -07:00
Guillermo Rauch
5dc8ddcda8 Added missing socket id to Store#join call. 2011-05-24 23:34:28 -07:00
Guillermo Rauch
aa4ffff9f9 Fixed broken reference to SocketNamespace object in Socket#join. 2011-05-24 23:33:24 -07:00
Guillermo Rauch
4e2941fc05 Added test for SocketNamespace#emit. 2011-05-24 23:30:09 -07:00
Guillermo Rauch
d29c0bce7b Added test for SocketNamespace#send. 2011-05-24 23:27:13 -07:00
Guillermo Rauch
be8e6ab05e Make sure to auto-join client to '' when handshaking.
Renamed internal clients dictionary to clientsMap to avoid collisions with
Store#clients.
2011-05-24 23:26:32 -07:00
Guillermo Rauch
7c6da424c0 Added new broadcast flag to Socket.
Added `Socket#to` for targeting rooms when broadcasting.
2011-05-24 23:25:48 -07:00
Guillermo Rauch
6e76229eb9 Make sure to encode packets in SocketNamespace#packet. 2011-05-24 23:25:30 -07:00
Guillermo Rauch
d1dfcf4172 Fixed test jsonp handshake parser. 2011-05-24 22:53:53 -07:00
Guillermo Rauch
1726da4ca3 Added support for json-p handshake. 2011-05-24 22:53:42 -07:00
Guillermo Rauch
71ed07d458 Added missing tests for Socket#emit ACK callbacks with endpoint ''. 2011-05-24 22:45:40 -07:00
Guillermo Rauch
a08b791cb8 Fixed Socket#emit with function as last argument (event packet with ACK) 2011-05-24 22:31:29 -07:00
Guillermo Rauch
2083fca33a Fixed event data ack for endpoint test. 2011-05-24 22:31:06 -07:00
Guillermo Rauch
11c1dda0c8 Fixed test for data acks from the client for endpoint messages. 2011-05-24 22:26:03 -07:00
Guillermo Rauch
3593916578 Fixed test for automatic client acknowledgements to an endpoint. 2011-05-24 22:21:41 -07:00
Guillermo Rauch
8c302fc323 Fixed test for manual data acks with events associated with an endpoint. 2011-05-24 22:17:15 -07:00
Guillermo Rauch
28c9d03dfa Fixed manual data ack test with endpoint. 2011-05-24 22:11:32 -07:00
Guillermo Rauch
5a93d72e9c Make sure automatic endpoints preserve endpoint. 2011-05-24 22:09:03 -07:00
Guillermo Rauch
a4b6e2850b Fixed test for endpoint acknowledgements. 2011-05-24 22:08:40 -07:00
Guillermo Rauch
8545d452bf Fixed test mechanics for volatile events sent from endpoint in the context of a
xhr-polling request/response cycle. See 2295ab92ae.
2011-05-24 21:49:03 -07:00
Guillermo Rauch
93729be50a Fixed test mechanics of volatile messages sent from an endpoint in the context of a
xhr-polling cycle. See 2295ab92ae.
2011-05-24 21:45:52 -07:00
Guillermo Rauch
2295ab92ae Fixed volatile endpoint message test. The connection event of a custom endpoint
fires when the `connect` packet type is received, but at that point no request-
response cycle was open.
2011-05-24 21:38:41 -07:00
Guillermo Rauch
d5721a6177 Fixed broken done reference in test. 2011-05-24 21:30:56 -07:00
Guillermo Rauch
54bc13e686 Fixed test expectation in server sent events with data. 2011-05-24 21:25:20 -07:00
Guillermo Rauch
756e319466 Fixed endpoint expectation in server sent events test. 2011-05-24 21:23:40 -07:00
Guillermo Rauch
8e13926804 Fixed endpoint expectation in json endpoint test. 2011-05-24 21:22:16 -07:00
Guillermo Rauch
6f3e59878f Fixed test expectation, added missing socket disconnect handler, fixed POST. 2011-05-24 21:20:03 -07:00
Guillermo Rauch
2a202f90d2 Fied typo in test, clarified test title, fixed expectation, fixed POST request. 2011-05-24 21:17:04 -07:00
Guillermo Rauch
bfabd6eadf Renamed Socket#packets ACK packets count to ackPackets for clarity. 2011-05-24 21:16:45 -07:00
Guillermo Rauch
a647fae3c4 Remvoed volatile messages unsubscription. 2011-05-24 21:03:21 -07:00
Guillermo Rauch
245c57c527 Fix style. 2011-05-24 21:02:26 -07:00
Guillermo Rauch
40106aa8db Fixed test expectation. 2011-05-24 21:01:54 -07:00
Guillermo Rauch
b663f5dd24 Make sure the Transport assumes delivered messages are pre-encoded. 2011-05-24 21:01:27 -07:00
Guillermo Rauch
79f6e5c538 Make sure that Socket#packet encodes the message prior to publication. 2011-05-24 21:01:05 -07:00
Guillermo Rauch
61eb0a2fd4 Added manual ack data callback handling. 2011-05-24 21:00:48 -07:00
Guillermo Rauch
5ea91da02f Added missing socket argument to event listener 2011-05-24 20:25:36 -07:00
Guillermo Rauch
fced9cca5e Fixed test expectation for Ack packet. 2011-05-24 20:24:03 -07:00
Guillermo Rauch
adf9f1150a Added automatic ACK handling to Transport. 2011-05-24 20:23:45 -07:00
Guillermo Rauch
bd231fcc9b Make sure to POST the ACK after the response close, so that we can test buffering
of ACKs.
2011-05-24 20:01:48 -07:00
Guillermo Rauch
0c4ac66b5f Fixed missing post reference in xhr-polling test. 2011-05-24 19:56:42 -07:00
Guillermo Rauch
00b600e5c0 Fixed xhr-polling test. 2011-05-24 19:55:12 -07:00
Guillermo Rauch
fafb44dcad Fixed test expectation for xhr-polling. 2011-05-24 19:54:11 -07:00
Guillermo Rauch
c57cabb982 Fixed missing done reference in xhr-polling test. 2011-05-24 19:53:04 -07:00
Guillermo Rauch
9777886f6c Fixed test expecetation in xhr-polling. 2011-05-24 19:51:48 -07:00
Guillermo Rauch
aa3b99a630 Added Socket#$emit as the original EventEmitter emit 2011-05-24 18:51:40 -07:00
Guillermo Rauch
b3b4ac439d Fixed event emitter in test with correct paramaters. 2011-05-24 18:43:16 -07:00
Guillermo Rauch
3be15033cc Fixed test expectation in messages json comparison. 2011-05-24 18:42:03 -07:00
Guillermo Rauch
c30a8edcc0 Added volatile event tests for htmlfile. 2011-05-22 22:33:25 -07:00
Guillermo Rauch
cf435bf3c6 Add test for deliverable volatile json. 2011-05-22 22:28:56 -07:00
Guillermo Rauch
2869f466be Added volatile message tests for htmlfile. 2011-05-22 22:23:53 -07:00
Guillermo Rauch
2cc3a85ea1 Added test for undeliverable volatile events for htmlfile. 2011-05-22 21:21:02 -07:00
Guillermo Rauch
8c9e063b74 Added htmlfile test for undeliverable volatile json. 2011-05-22 21:11:37 -07:00
Guillermo Rauch
fcd474e89e Added htmlfile test for undeliverable volatile messages. 2011-05-22 21:10:20 -07:00
Guillermo Rauch
0e3f0eabe4 Simplified heartbeat htmlfile test, made consistent with websocket one. 2011-05-22 20:47:07 -07:00
Guillermo Rauch
7b486e2b37 Make sure to set drain to false upon htmlfile transport write. 2011-05-22 20:18:03 -07:00
Guillermo Rauch
334c00f2c0 Finished last websocket test. 2011-05-22 20:17:44 -07:00
Guillermo Rauch
a2c30a1416 Fixed event emission from Socket (the name key was missing) 2011-05-22 20:17:20 -07:00
Guillermo Rauch
474f4e6ebd Added test for delivery of volatile json messages with websocket. 2011-05-22 14:39:43 -07:00
Guillermo Rauch
a5634b0bbd Added test for delivering volatile messages in websocket. 2011-05-22 14:37:05 -07:00
Guillermo Rauch
f020d012f2 Make sure the socket is considered drained when re-set, specially if a socket is
closed before its drain event fires.
2011-05-22 14:28:41 -07:00
Guillermo Rauch
b76901eb56 Removed writeVolatile special handling for polling transports, since it's now handled
elegantly across all transports, and polling drained-ness doesn't concern us.
2011-05-22 14:22:41 -07:00
Guillermo Rauch
777746d42d Changed; moved volatile message subscription to request initialization.
Fixed; socket errors now close the transport instead of resulting in a disconnection.
Transport#writeVolatile now considers transport open state.
2011-05-22 14:20:18 -07:00
Guillermo Rauch
e436f90ac9 Removed Transport#drained initialization from WebSocket transport constructor. 2011-05-22 13:25:13 -07:00
Guillermo Rauch
c0e1944462 Added WebSocket#drained initialization to constructor. 2011-05-22 13:24:51 -07:00
Guillermo Rauch
f5edca935d Added Transport#writeVolatile for every transport.
Removed WebSocket#writeVolatile, inherit from Transport instead.
Removed `drain` listener from WebSocket onSocketConnect method.
2011-05-22 13:18:51 -07:00
Guillermo Rauch
9cfffa48e8 Added Transport#drained and Transport#onSocketDrain for every transport. 2011-05-22 13:17:00 -07:00
Guillermo Rauch
9b8ca8cc4b Added test for undeliverable volatile events for websocket. 2011-05-22 13:02:13 -07:00
Guillermo Rauch
8c9e6a99bc Added test for undeliverable volatile json in websocket. 2011-05-22 13:01:56 -07:00
Guillermo Rauch
4bba9b1e17 Added test for undeliverable volatile messages for websocket. 2011-05-22 13:01:28 -07:00
Guillermo Rauch
ef610de2b1 Added websocket test for maintaining session by responding to heartbeats. 2011-05-21 21:56:29 -07:00
Guillermo Rauch
c07693b46e Added websocket test for heartbeat disconnection reason. 2011-05-21 21:41:54 -07:00
Guillermo Rauch
c2b6acbff4 Fixed; make sure to check for the beat presence before examining the disconnection
reason in htmlfile heartbeat test.
2011-05-21 21:38:34 -07:00
Guillermo Rauch
4ab6e9592f Fixed; make sure to check for the heartbeat being sent to client in htmlfile
heartbeat test.
2011-05-21 21:36:33 -07:00
Guillermo Rauch
227e14c71b Fixed global leak in websocket test. 2011-05-21 21:34:21 -07:00
Guillermo Rauch
ef435a0b03 Finished incomplete xhr-polling test. 2011-05-21 21:31:10 -07:00
Guillermo Rauch
c8a73d56c8 Added more xhr-polling tests. 2011-05-21 21:01:03 -07:00
Guillermo Rauch
07f5d1ff64 Added MemoryStore#clients.
Added MemoryStore#join.
Added MemoryStore#leave.
2011-05-21 20:57:41 -07:00
Guillermo Rauch
8416e76114 Added SocketNamespace#store shortcut.
Added SocketNamespace#in
Added SocketNamespace#for
Implemented SocketNamespace#packet
Fixed SocketNamespace#emit
Fixed SocketNamespace#send
2011-05-21 20:56:31 -07:00
Guillermo Rauch
b4034878eb Added jsonp-polling tests. 2011-05-19 15:53:27 -07:00
Guillermo Rauch
b5b72bd212 Fixed; make sure handshake responses are not parsed. 2011-05-19 15:50:55 -07:00
Guillermo Rauch
88d5daa3b5 Finished jsonp-polling transport. 2011-05-19 15:35:18 -07:00
Guillermo Rauch
4f4d25e954 Fixed parameter names for htmlfile 2011-05-19 14:53:56 -07:00
Guillermo Rauch
f47a9dc110 Fixed parameter names for xhr-polling 2011-05-19 14:51:55 -07:00
Guillermo Rauch
882fb96567 Fixed; constructor parameter names for websocket. 2011-05-19 14:51:08 -07:00
Guillermo Rauch
aa1ba762ae All tests passing 2011-05-19 13:26:26 -07:00
Guillermo Rauch
287dd40dd2 Fixed jsonp-polling and xhr-polling doWrite with no data. 2011-05-19 13:25:35 -07:00
Guillermo Rauch
ccac8fe8a4 Fixed; disable the Nagle algorithm for websocket. 2011-05-19 13:17:42 -07:00
Guillermo Rauch
43f6071f4f Fixed jsonp-polling writes. 2011-05-19 13:17:25 -07:00
Guillermo Rauch
b4b7c0b428 Fixed; override clearTimeouts for clearing polling timeout for polling transports. 2011-05-19 13:16:59 -07:00
Guillermo Rauch
750e8a9272 Fixed; removed noDelay for all sockets. 2011-05-19 13:16:43 -07:00
Guillermo Rauch
118f5b2371 Commented out failing test related to connection notifications. 2011-05-18 20:40:37 -07:00
Guillermo Rauch
d64fdfa422 Added WebSocket tests. 2011-05-18 20:40:20 -07:00
Guillermo Rauch
ffb6557880 Hacked; expose the stream from the WebSocket client for more flexibility during
testing.
2011-05-18 20:39:52 -07:00
Guillermo Rauch
4f293ae44e Completed WebSocket transport.
Added (naive) support for closing frames.
2011-05-18 20:39:24 -07:00
Guillermo Rauch
080abccf10 Fixed distributed connections detection.
Fixed; make sure all heartbeats are captured.
Changed; make sure to close on our end when the socket 'end'/'close' event fires.
2011-05-18 20:37:51 -07:00
Guillermo Rauch
7f788e1404 Fixed; added callback support to MemoryStore#publish. 2011-05-18 20:37:24 -07:00
Guillermo Rauch
887eb42b2f Added node websocket client. 2011-05-17 18:52:41 -07:00
Guillermo Rauch
70c815dd47 Modifications to README. 2011-05-17 18:52:30 -07:00
Guillermo Rauch
b086a526a1 Added initial websocket test suite. 2011-05-17 18:52:24 -07:00
Guillermo Rauch
76a2da8cb8 Fixed style 2011-05-17 18:51:59 -07:00
Guillermo Rauch
a9ed766b85 Fixed; this.connection is undefined. 2011-05-17 18:51:44 -07:00
Guillermo Rauch
6a513d163b Fixed; unknown transports just end the connection.
Fixed; origin verification happens at handshake time.
2011-05-17 18:51:11 -07:00
Guillermo Rauch
d9015b7732 Fix package.json (thanks @dshaw) 2011-05-17 17:03:22 -07:00
Guillermo Rauch
53bedb7abd Added HTMLFile tests. 2011-05-17 16:12:39 -07:00
Guillermo Rauch
36b7ffe70c Fix style 2011-05-17 16:12:28 -07:00
Guillermo Rauch
3595cc4f0b Added HTTPClient export in test utilities. 2011-05-17 16:12:06 -07:00
Guillermo Rauch
c0481f615e Fixed json-p debug instrumentation. 2011-05-17 16:11:51 -07:00
Guillermo Rauch
dfae47d42a Make sure to disable heartbeat intervals in polling transports. 2011-05-17 16:10:47 -07:00
Guillermo Rauch
f5133b6a6f Fixed style. 2011-05-17 16:10:33 -07:00
Guillermo Rauch
da95a4e31f Added cross-connection heartbeat clearing. In a XHR transport, if the POST request
goes through a different connection, we want to clear the heartbeat timeout set in
the connection associated with the GET request.
Added disconnect reasons.
2011-05-17 16:09:01 -07:00
Guillermo Rauch
f65d381961 Changed; hide away message publishing behind message, hearbeat methods added to
the Store.
Added support for reason passing in the store callbacks.
2011-05-17 16:08:13 -07:00
Guillermo Rauch
d35998a633 Added reason support to disconnect callbacks. 2011-05-17 16:07:54 -07:00
Guillermo Rauch
2bf65750f3 Added; test/common exports HTTPClient for transport inheritance.
Added the possibility of HTTPClient not buffering responses.
2011-05-17 11:22:03 -07:00
Guillermo Rauch
e6ad372ef3 Changed; finished refactoring tests. All passing. 2011-05-17 10:52:45 -07:00
Guillermo Rauch
e9ab235174 Tests refactored. 2011-05-16 20:07:56 -07:00
Guillermo Rauch
8f0f71ac92 Changed; cleaned up test utilities:
- Moved all the logic into a reusable class.
 - Minimize globals by only exposing `client` and `create`
 - Separate `http.Agent` per clients so that we can terminate all sockets at once.
 - Implemented `create` to easily spawn a socket.io server for a given client.
2011-05-16 19:45:03 -07:00
Guillermo Rauch
60ad6e3ceb Fixed; HTMLFile#doWrite never gets called since it's an HTTP non-polling transport. 2011-05-16 19:44:37 -07:00
Guillermo Rauch
4724724e20 Changed; only do forced disconnection handling for writable sockets. This prevents
Transport objects created with POST requests from triggering disconnect events too.
Changed; moved forced disconnect logic into Transport#onForcedDisconnect.
2011-05-16 19:43:30 -07:00
Guillermo Rauch
5e61a3bd5a Changed; publish the disconnect event after the disconnect-force internal event. 2011-05-16 19:43:08 -07:00
Guillermo Rauch
0bebd38042 Changed; renamed SocketNamespace#nsp to SocketNamespace#name.
Changed; make sure to only emit the connection event when a client is registered for
the default namespace.
Added `connect` packet handler.
2011-05-16 19:41:52 -07:00
Guillermo Rauch
ad1946e79d Fix; make sure to reset length when parsing a payload. 2011-05-15 19:20:14 -07:00
Guillermo Rauch
f63f72cdac Added additional packet to payload decoding test. 2011-05-15 19:20:03 -07:00
Guillermo Rauch
968afd89a5 Fixed handling of incoming POST requests to a XHR transport.
Fixed payloading encoding.
2011-05-15 19:07:04 -07:00
Guillermo Rauch
30ceabf10f Removed __io counter in incoming sockets. 2011-05-15 19:06:21 -07:00
Guillermo Rauch
b7c877b497 Added additional parser tests. 2011-05-15 19:06:01 -07:00
Guillermo Rauch
db87502b9b Fixed parser#encodePayload 2011-05-15 19:05:46 -07:00
Guillermo Rauch
9820716ff0 Fixed client packet disconnect test. 2011-05-15 13:37:01 -07:00
Guillermo Rauch
5f028c5ca9 Fixed; moved data decoding logic into base HTTP transport interface. 2011-05-15 13:36:21 -07:00
Guillermo Rauch
f2060d1283 Added remaining tests. 2011-05-14 22:04:01 -07:00
Guillermo Rauch
5a164ed053 Fixed tests helpers. 2011-05-14 20:25:46 -07:00
Guillermo Rauch
3dda158065 Changed; make sure to Transport#resume only if the client is connected.
Fixed; send disconnection packet when forced disconnecting.
2011-05-14 19:22:32 -07:00
Guillermo Rauch
4f23e97310 Changed; make sure to clean up client prior to emission of disconnection events. 2011-05-14 19:22:06 -07:00
Guillermo Rauch
af57fd9801 Changed; add disconnect check to Socket#disconnect. 2011-05-14 19:21:42 -07:00
Guillermo Rauch
f1f3918739 Changed instrumentation for disconnection URI from error to debug. 2011-05-14 19:21:19 -07:00
Guillermo Rauch
c6f4a5701f Merge branch 'master' of github.com:LearnBoost/Socket.IO-node 2011-05-14 00:55:13 -07:00
Arnout Kazemier
b1cde55d97 Fixes #133 2011-05-13 22:02:47 +02:00
Arnout Kazemier
d77379ced0 Fixing #208 again, now with proper update 2011-05-13 21:56:43 +02:00
Guillermo Rauch
c6f8009e69 Ignore files 2011-05-10 14:49:46 -07:00
Guillermo Rauch
6ed7964f8f Fixed requests that just target the resource. 2011-05-10 14:49:13 -07:00
Guillermo Rauch
4f6734b006 Merge pull request #202 from 3rd-Eden/master
Misc
2011-05-09 15:19:46 -07:00
Guillermo Rauch
5ddc23f82e Fixed style [OCD-related work]. 2011-05-08 22:42:57 -07:00
Guillermo Rauch
910995a8f2 Fixed emission of non-socket.io events in SocketNamespace. 2011-05-08 22:42:31 -07:00
Guillermo Rauch
5f8192799b Fixed iteration of namespaces in Manager 2011-05-08 22:42:16 -07:00
Guillermo Rauch
790e916cd4 OCD-related work. 2011-05-08 20:46:29 -07:00
Guillermo Rauch
7f3c5f6a73 Fixed typo 2011-05-08 20:44:54 -07:00
Guillermo Rauch
4889057f9a Changed/Added some tests 2011-05-08 20:40:18 -07:00
Guillermo Rauch
a27a6ad2b6 Changed; only output CORS headers for cross-domain requests to minimize framing.
Changed debug instrumentation.
2011-05-08 20:38:53 -07:00
Guillermo Rauch
0a69b580c4 Added WebSocket#writeVolatile (and WebSocket#drained state)
Added WebSocket#doClose
2011-05-08 20:38:10 -07:00
Guillermo Rauch
6665e08cb7 Added HTTPTransport#doClose. 2011-05-08 20:37:49 -07:00
Guillermo Rauch
600c05bbbe Changed; leveraged Transport#close instead of Transport#write with empty string.
Added more debug instrumentation.
2011-05-08 20:37:08 -07:00
Guillermo Rauch
d5e922ba12 Changed debug statement. 2011-05-08 20:36:49 -07:00
Guillermo Rauch
c39191b3fd Added the notion of forced disconnects.
Added Transport#onSocketConnect interface.
Added Transport#clearTimeouts
Added heartbeat response handling.
Added Transport#close, Transport#onClose, chanaged Transport#end.
2011-05-08 20:35:38 -07:00
Guillermo Rauch
eb77c5e01a Added disconnction handler in Memory store. 2011-05-08 20:35:22 -07:00
Guillermo Rauch
d739f560b8 Added SocketNamespace#log getter.
Added SocketNamespace#socket to retrieve/create Sockets.
Added packet handling.
2011-05-08 20:34:28 -07:00
Guillermo Rauch
c32708c383 Changed; make sure to ignore newListener event when Socket#emit is overridden.
Changed; keep track of disconnected state and ACK callbacks.
Added; make sure to emit the `disconnect` event.
Removed readyState handling, shouldn't be part of the public API.
2011-05-08 20:31:21 -07:00
Guillermo Rauch
34a701fb7f Changed; initialize default namespace with Manager#for instead of manually.
Changed; perform error handling for Store#isHandshaken.
Added; handle manual disconnect urls.
Changed; make sure to initialize a socket for all namespaces when a client connects.
Changed; delegate packet handling to the appropriate SocketNamespace.
Changed; cache regular expression for checkRequest method.
2011-05-08 20:28:16 -07:00
Guillermo Rauch
b7488e7a13 Added failing disconnection event test 2011-05-07 18:33:43 -07:00
Guillermo Rauch
ed12f347eb Changed; make sure to clear polling timeout if the connection closes.
Added "clearPollTimeout" method
2011-05-07 18:33:17 -07:00
Guillermo Rauch
5d7c5f7471 Changed; make sure to compare the decoded packet representation with an empty
endpoint and advice.
2011-05-07 18:25:40 -07:00
Guillermo Rauch
416cd66591 Fix for detecting HTTP-based transports for get() test shortcut. 2011-05-07 18:25:14 -07:00
Guillermo Rauch
c3171be7a8 Added; implemented message handling at transport level for heartbeat clearing and
disconnection handling.
2011-05-07 18:24:45 -07:00
Guillermo Rauch
8cd476295a Added Store disconnect method 2011-05-07 18:24:29 -07:00
Guillermo Rauch
209426a9b0 Changed; implemented write-only Socket.
Added log accessor to Socket
2011-05-07 18:23:59 -07:00
Arnout Kazemier
8f1d96ad7f Updated the readme, fixed typos, changed socket.io requires to socket.io-node requires as that is the name according to the package.json.
Also updated the styling to fancy pancy HTML highlighting
2011-05-07 13:58:32 +02:00
Arnout Kazemier
3a5ab7675d Updated the package.json, added more keywords. Added repo and fixed the engine requirement or it will not work with future node versions. 2011-05-07 13:51:41 +02:00
Guillermo Rauch
ece9b120a9 Changed; allow for writeonly sockets (used to permit a specific socket to message
another socket, or group of sockets).
2011-05-06 20:23:42 -07:00
Guillermo Rauch
981a0e22b4 Changed; leverage new utilities signature. 2011-05-06 20:23:33 -07:00
Guillermo Rauch
80e8777dba Changed; leverage new utilities signature 2011-05-06 20:23:12 -07:00
Guillermo Rauch
0df8acc280 Fixed; ignore parser for empty GET responses.
Changed; style
2011-05-06 20:22:41 -07:00
Guillermo Rauch
4243ddfb89 Changed; utility functions signature now path, port, opts, fn, with opts being
optional.
Changed; parser override only for paths that include transports.
Changed; style.
2011-05-06 20:22:07 -07:00
Guillermo Rauch
9215d77898 Changed; make sure that get() decodes the payload and also preserves the frame parser. 2011-05-06 17:28:42 -07:00
Guillermo Rauch
d2c74536e0 Changed; improved htmlfile framing size. 2011-05-06 17:12:52 -07:00
Guillermo Rauch
deb45624ba Changed; test utilities now expose get / post / req
Changed; req now accepts a response parser
2011-05-06 17:01:11 -07:00
Guillermo Rauch
136850a7b5 Fixed; package json is now actual json (fixes #199) 2011-05-06 16:46:57 -07:00
Guillermo Rauch
42a4e6bc9e Updated README 2011-05-06 15:41:04 -07:00
Guillermo Rauch
c2d0774d46 Removed const (slow) 2011-05-06 15:12:51 -07:00
Guillermo Rauch
1514af064f Socket.IO 0.7-pre 2011-05-05 08:49:40 -07:00
Arnout Kazemier
9082bb8265 Finished the JSDoc intergration, and did a final automatic spelling check. 2011-03-13 21:02:40 +01:00
Arnout Kazemier
ae05abc44a Added better descriptions and examples + typo fixes 2011-03-13 00:24:09 +01:00
Arnout Kazemier
c63efa3a36 More modifications to the JSDocs 2011-03-11 16:42:34 +01:00
Arnout Kazemier
d484cb7f78 More JSDoc documentation, replaced the /*! with /** in the licensen headers for dox compatiblity 2011-03-11 13:13:12 +01:00
Arnout Kazemier
d3b984d097 Fixed typo in documentation 2011-03-11 13:12:45 +01:00
Arnout Kazemier
924731b63a Merge branch 'jsdoc' of github.com:Hotelsnl/Socket.IO into jsdoc 2011-03-11 09:08:59 +01:00
Arnout Kazemier
8dca195ce3 Added some JSDocs 2011-03-10 22:23:24 +01:00
Arnout Kazemier
bdc37c1650 More documentation 2011-03-10 17:04:53 +01:00
Arnout Kazemier
6f3d47bd9c Work in progress of converting the files to JSDoc. Finished the transport.js but and started work on the other files. 2011-03-09 23:06:33 +01:00
Arnout Kazemier
d6665e9a1b Removed double var statements.. 2011-03-09 17:01:39 +01:00
Arnout Kazemier
0fcc9c07e9 Removed globals that where introduced by commit: 0a1a93b484 2011-03-09 16:25:48 +01:00
Arnout Kazemier
bddffb1e43 Removed pointless flashcheck codes. We are already bundling the SWFObject inside of the Socket.io.js
This functionality contains checking for flash availablity.

The new Flash check will also check on Flash version number as web-socket-js requires flash 10.0+
2011-03-09 15:59:24 +01:00
Arnout Kazemier
adde74610e Updated the README to reflect the API updates. Added .once support and support for .connect(fn); 2011-03-09 09:46:25 +01:00
Arnout Kazemier
2b48f93d46 First basic implemenation of .once but still need to figure out a way to also have the .once removed as it's wrapped in a function. Anyways this alone is enough to close bug #103 . Because we now have a once listener we can easily fix #38 2011-03-08 23:06:41 +01:00
Arnout Kazemier
7f6ca6eb17 This should fix https://github.com/LearnBoost/Socket.IO/issues/92 because the client will be broken anyways without JSON support we might as well throw an error. 2011-03-08 22:17:20 +01:00
Arnout Kazemier
8e91094cba MOAN, Now, i finally got the html working again... and than i start breaking the flashsocket.. >_< DAMN you privates 2011-03-08 17:02:30 +01:00
Arnout Kazemier
dee3c4511b Merge branch 'master' of git://github.com/LearnBoost/Socket.IO
Conflicts:
	socket.io.min.js
2011-03-07 20:00:36 +01:00
Guillermo Rauch
ec023737a4 Merge branch 'master' of github.com:LearnBoost/Socket.IO 2011-03-07 10:28:14 -08:00
Guillermo Rauch
d062c91027 Preparing 0.7 changelog 2011-03-07 10:27:41 -08:00
Guillermo Rauch
146cfc3253 Added Arnout to contributors 2011-03-07 09:43:00 -08:00
Arnout Kazemier
d860b4ff53 Updated the documentation with some of the missing options and propperties. 2011-03-07 15:03:56 +01:00
Arnout Kazemier
63ce0051be Updated the documentation in the README
Added reconnectionAttempts to the reconnecting event.
Delete redoTransports property when we reset.
2011-03-07 11:06:06 +01:00
Arnout Kazemier
0bd73fa84b Updated the builds after the merge 2011-03-06 19:56:08 +01:00
Arnout Kazemier
eae8020bff Merge branch 'master' of git://github.com/LearnBoost/Socket.IO
Conflicts:
	bin/build
2011-03-06 19:55:43 +01:00
Arnout Kazemier
484c27ea4c Merge branch 'master' of git://github.com/LearnBoost/Socket.IO into reconnect
Conflicts:
	bin/build
2011-03-06 19:52:34 +01:00
Arnout Kazemier
d69a8ce577 Removed once, because it's not that easy to remove the events you attach. Because when call our reset function, you also want to remove all attached listeners we required for the reconnect functionality. And, it's that bad if they are called multiple times. 2011-03-06 19:30:02 +01:00
Guillermo Rauch
83aa03900b Fixed; different port now considered cross-domain. 2011-03-06 00:05:45 -08:00
Guillermo Rauch
2921f50799 Merge branch 'master' of https://github.com/substack/Socket.IO into substack-master 2011-03-05 23:46:11 -08:00
Arnout Kazemier
01cbb21692 Updated the readme with a new event.
Updated the lib/socket with a new event.
Removed todo, as all is implemented.
Generated new builds
2011-03-05 21:51:55 +01:00
Arnout Kazemier
cd0b83a76a Inital draft of reconnection support.
This features some additons to the socket.io code, and fixing some inconsistencies.
2011-03-04 16:43:13 +01:00
Arnout Kazemier
8a62f4523a Produced new builds 2011-03-04 10:56:08 +01:00
Arnout Kazemier
5952bd965b Upgraded the build process to also produce a minified build.
The minification was done using uglifyjs and included in the vendor folder.
2011-03-04 10:47:38 +01:00
Arnout Kazemier
1d80b62da9 Removed unused files. + applied patch for the WebSocket flash fallback,
It throws errors if we are not listening to the onopen event. Fixed
in my personal web-socket-js and send pull request: https://github.com/gimite/web-socket-js/pull/60

But in order to use the latest version of web-socket-js I have applied it
here.
2011-03-04 10:18:56 +01:00
Arnout Kazemier
2fd7f0b130 Removed FABridge from build script, it's no longer needed as the flash fallback
is using ExternalInterface instead
2011-03-04 09:28:52 +01:00
Arnout Kazemier
d0189b0dc0 Updated the flash fallback to the latest version,
This no longer requires the use of FLABridge, so we can save allot filesize
2011-03-04 09:25:46 +01:00
James Halliday
8494eea2bc fix to make io resolve where this !== window so it works with module bundling 2011-02-26 16:13:33 -08:00
James Halliday
65be353cbb drop sys in favor of console 2011-02-25 03:38:17 -08:00
James Halliday
dc03de6cb1 a package.json all up in this! 2011-02-25 03:37:26 -08:00
Martin Kreichgauer
0a1a93b484 Reference a local copy of this.io internally 2011-02-09 12:00:47 -08:00
Guillermo Rauch
b6149c0c9e Added changelog 2011-02-05 11:38:01 -08:00
Guillermo Rauch
e3376a5251 Release 0.6.2 2011-02-05 11:37:43 -08:00
Guillermo Rauch
7515915957 Fixed problem with xhr-multipart buffering 2011-02-05 11:35:58 -08:00
Guillermo Rauch
4e95643a46 Updated Flash websocke transport 2011-02-05 11:35:33 -08:00
Guillermo Rauch
badb0ac883 Removed submodule 2011-02-05 11:35:15 -08:00
Guillermo Rauch
9804716115 Updated README 2011-02-05 11:33:40 -08:00
Guillermo Rauch
4d457ec203 Building Daniel Beardsley's changes into socket.io.js 2010-12-26 01:51:42 -08:00
Daniel Beardsley
686e1d1dfa Fixed the broken tryTransportsOnConnectTimeout option
and added the 'connect_failed' event after the last available transport fails to connect within the timeout
The function was re-creating the list of transports each time the timeout was hit, effectively only continually retrying the second transport, and never making it past that.
2010-12-26 01:42:18 -08:00
Daniel Beardsley
24358ae3f0 Add 'connecting' event emit on each connection attempt. 2010-12-26 00:57:53 -08:00
Guillermo Rauch
69991be5cc 0.6.1 2010-12-23 20:51:04 -08:00
Guillermo Rauch
803dcad6fb Build 2010-12-23 17:45:08 -08:00
Guillermo Rauch
3b352ecfea Fire 'error' event when socket.onerror fires (thanks @tomyan) 2010-12-23 17:41:27 -08:00
Guillermo Rauch
50add1ae02 Corrected position of WEB_SOCKET_SWF_LOCATION check 2010-12-23 17:37:48 -08:00
Guillermo Rauch
d74c7f1199 Allow to specify WEB_SOCKET_SWF_LOCATION before socket.io is loaded. Thanks @saikat 2010-12-23 17:36:14 -08:00
Guillermo Rauch
a3f6e1a9f3 Applied several bug fixes (thanks Toby Ho - @airportyh) 2010-12-23 17:29:53 -08:00
Guillermo Rauch
763ce20da0 Better readyState read 2010-12-23 17:27:19 -08:00
Guillermo Rauch
7c90584c07 Wrapped XHR abort() in a try-catch clause 2010-12-23 17:26:24 -08:00
Guillermo Rauch
f75464bb6d send(null) for FF2/3 2010-12-23 17:24:58 -08:00
Guillermo Rauch
280c999e3a Removed XHR onload handler 2010-12-23 17:23:58 -08:00
Guillermo Rauch
66599a6591 Removed onload handler cleanup 2010-12-23 17:21:50 -08:00
Guillermo Rauch
e89e20eada Fixed connect timeout being fired after an explicit disconnect. Thanks @mbrevoort 2010-12-23 17:15:53 -08:00
Guillermo Rauch
f1332af1ee Renaming fire to emit and making a copy of events first (thanks @fjakobs) 2010-12-23 15:00:27 -08:00
Guillermo Rauch
7a5197c1e7 Make sure to only destroy if the _iframe was created 2010-11-01 12:58:25 -03:00
Guillermo Rauch
9fb0b3ec8a Fixed io.util.merge 2010-10-30 21:28:48 -03:00
Guillermo Rauch
1f06916c4e Added io.utils.merge
Removed flashsocket onClose logic since its handled by connectTimeout
Added socket checks when disconnecting / sending messages
2010-10-28 19:15:08 -03:00
Guillermo Rauch
e31a3beeed Fixed semicolons (thanks SINPacifist) 2010-10-20 19:21:31 -03:00
Guillermo Rauch
d8da8efe91 Added io.util.merge for options merging. Probably should be recursive at some point. Thanks SINPacifist 2010-10-20 19:18:19 -03:00
Guillermo Rauch
c226b89c29 Removed unnecessary onClose handling, since this is taken care by Socket (thanks SINPacifist) 2010-10-20 19:12:15 -03:00
Guillermo Rauch
336331a32c Make sure not to try other transports if the socket.io cookie was there 2010-09-25 11:06:22 +02:00
Guillermo Rauch
33c40b96d1 Temporarily reverting to /socket.io/ to serve the SWF 2010-09-24 06:03:58 +02:00
Guillermo Rauch
669ff4c038 Updating web-socket-js 2010-09-20 17:58:11 -07:00
Guillermo Rauch
b9c70a8279 Build 2010-09-20 16:28:29 -07:00
Guillermo Rauch
ef13f123ba Oops 2010-09-20 16:28:21 -07:00
Guillermo Rauch
c76e867462 Build 2010-09-20 16:26:17 -07:00
Guillermo Rauch
9501cb1197 Make sure not to abort the for loop when skipping the transport 2010-09-20 16:26:00 -07:00
Guillermo Rauch
f6d29b62a5 Fix for this inside of the timeout
Build
2010-09-20 15:59:01 -07:00
Guillermo Rauch
c2917c7989 Connect timeout (fixes #34)
Try different transports upon connect timeout (fixes #35)
2010-09-20 15:53:29 -07:00
Guillermo Rauch
c73d292d9e Restored rememberTransport to default 2010-09-20 15:40:52 -07:00
Guillermo Rauch
aa8afe4d5d Removed io.setPath check 2010-09-20 15:39:35 -07:00
Guillermo Rauch
33a89f8aee Clarification for serving Flash
Added .gitignore
2010-09-20 15:30:19 -07:00
Guillermo Rauch
8dc8e90540 CDN instructions 2010-09-20 12:42:46 -07:00
Guillermo Rauch
4a52e9ab71 Make sure IE7 doesn't err on the multipart feature detection. Thanks Davin Lunz 2010-09-10 12:09:39 -07:00
Guillermo Rauch
1851f58a81 CORS feature detection. Fixes IE7 attempting cross domain requests through their incomplete XMLHttpRequest implementation. 2010-09-09 17:31:31 -07:00
Guillermo Rauch
660f9adb2c Now altering WEB_SOCKET_SWF_LOCATION (this way we don't need the web-socket-js WebSocket object to be there)
Flashsocket .connect() and .send() call addTask.
Removed _loaded, since addTask does load checking internally
Build
2010-09-09 17:19:55 -07:00
Guillermo Rauch
30b7200a53 Make sure flashsocket can only be loaded on browsers that don't have a native websocket 2010-09-09 16:36:51 -07:00
Guillermo Rauch
86c35873ca Leveraging __addTask to delay sent messages until WebSocket through SWF is fully loaded.
Removing __isFlashLite check
2010-09-09 16:18:09 -07:00
Guillermo Rauch
13c638178a Leverage node.js serving of the client side files
Make sure we can load io.js from node (window check)
2010-09-09 14:06:41 -07:00
Guillermo Rauch
9a4bb0076d Fix for XDomain send() on IE8 (thanks Eric Zhang) 2010-09-07 01:38:23 -07:00
Arnout Kazemier
7546cee7aa Added a note about cross domain .swf files 2010-09-03 13:35:25 +02:00
Arnout Kazemier
aec758df99 new build 2010-09-03 13:30:47 +02:00
Arnout Kazemier
520aeaddf4 Made sure no errors where thrown in IE if there isn't a flash fallback available. 2010-09-03 13:22:55 +02:00
Guillermo Rauch
50f7e4704e Build 2010-09-02 12:24:25 -07:00
Guillermo Rauch
7f5b56ab78 Make sure disconnect event is only fired if the socket was completely connected, and it's not a reconnection attempt that was interrupted. 2010-09-02 12:23:56 -07:00
Guillermo Rauch
7231783551 Force disconnection if .connect() is called and a connection attempt is ongoing 2010-09-02 12:14:00 -07:00
Guillermo Rauch
ba5bba6e07 Build 2010-09-02 12:07:28 -07:00
Guillermo Rauch
a646824285 Upon socket disconnection, also mark connecting as false
.connecting flag in transport instance
Make sure .connecting is cleared in transport
2010-09-02 12:01:08 -07:00
Guillermo Rauch
743ab80f80 Correct sessionid checking 2010-09-01 13:22:56 -07:00
Guillermo Rauch
f86db67c20 Build 2010-09-01 13:21:17 -07:00
Guillermo Rauch
6a7023da9d Clear sessionid upon disconnection 2010-09-01 13:18:37 -07:00
Guillermo Rauch
ca9e732265 Build 2010-09-01 12:58:12 -07:00
Guillermo Rauch
70dde951be Remove _xhr and _sendXhr objects 2010-09-01 11:44:43 -07:00
Guillermo Rauch
7f0c14393e Updated README 2010-09-01 02:19:12 -07:00
Guillermo Rauch
a848324d2a Added note about htmlfile cross-domain 2010-09-01 02:12:40 -07:00
Guillermo Rauch
750f746f60 Moved timeout default into Transport 2010-09-01 02:05:55 -07:00
Guillermo Rauch
5548e916ad Added timeout
Remove callbacks on _onDisconnect and call abort()
Added placeholder for direct disconnect in XHR
2010-09-01 01:59:42 -07:00
Guillermo Rauch
a9d5285509 Timeout logic (fixes #31)
Build
2010-08-31 19:52:37 -07:00
Guillermo Rauch
29ce06f8d9 Don't check for data length to trigger _onData, since most transports are not doing it 2010-08-31 19:49:56 -07:00
Guillermo Rauch
cc05094d29 Set timeout defaults based on heartbeat interval and polling duration (since we dont do heartbeats for polling)
Check for msgs.length _onData
2010-08-31 19:49:12 -07:00
Guillermo Rauch
4c4bec9f44 Removed unused client option (heartbeatInterval) 2010-08-31 19:46:07 -07:00
Guillermo Rauch
6731b2d779 Added onDisconnect call if long poll is interrupted 2010-08-31 19:39:50 -07:00
Guillermo Rauch
56ee90d0bd Polling calls _get directly as opposed to connect()
Build
2010-08-31 19:30:54 -07:00
Guillermo Rauch
b2f92acbbe Disconnection handling upon failure to send a message through xhr-* transports.
Clean up internal xhr buffer upon disconnection
Clean up general buffer in Socket upon disconnection
Mark socket as disconnected
2010-08-31 19:18:04 -07:00
Guillermo Rauch
922a96d28c Opera 10 support
Some README fixes
 - Added API example at the top
 - Added opera
2010-08-31 13:05:41 -07:00
Guillermo Rauch
41ad4057f5 Fix for .fire on IE being called without arguments (fixes #28) + build 2010-08-30 18:42:09 -07:00
Guillermo Rauch
4697574a68 JSONP IE6-7 fixes 2010-08-30 15:22:11 -07:00
Guillermo Rauch
1561b52fee JSONP Polling send fix for IE (only tested in IE8) 2010-08-29 18:27:14 -07:00
Guillermo Rauch
4935e6c4ca Build 2010-08-29 17:42:11 -07:00
Guillermo Rauch
bf0b541129 JSONP polling completed 2010-08-29 16:39:36 -07:00
Guillermo Rauch
c0c5a7e653 Missing inherit call 2010-08-26 16:50:56 -07:00
Guillermo Rauch
bfdb66eac2 Added jsonp-polling to the build script
Version set to 0.6
2010-08-26 16:11:43 -07:00
Guillermo Rauch
596c39e64b JSONP Polling transport
Some small changes for xdomain XHR feature detection
2010-08-26 15:44:39 -07:00
Guillermo Rauch
7ab5806991 Rebuilt socket.io.js 2010-08-26 13:31:47 -07:00
Guillermo Rauch
8d19a4ced3 Android compatibility. Updated web-socket-js. Thanks @sleavitt, @gimite 2010-08-26 13:31:04 -07:00
Guillermo Rauch
9608d40e1a Build 2010-08-23 21:00:38 -07:00
Guillermo Rauch
8e9b16ff15 Automatic JSON decoding support 2010-08-23 20:59:14 -07:00
Guillermo Rauch
37f0194246 Automatic JSON encoding support for objects 2010-08-23 20:48:57 -07:00
Guillermo Rauch
cd30cbf046 Adding test for android for delaying the connection. 2010-08-12 23:52:28 -07:00
Saikat Chakrabarti
cb000bfe4b Fixing a few dangerous loops that otherwise loop into properties that have been added to the prototype elsewhere. 2010-08-04 17:22:03 -07:00
Guillermo Rauch
dd2e23685a Support for initializing io.Socket after the page has been loaded 2010-08-02 13:03:13 -07:00
Guillermo Rauch
aed0fc8ef5 Loading bar fix for iPhone
Some readme fixed and started keeping a changelog
Added io.util.load and io.util.ios
0.5.4
2010-08-02 12:56:27 -07:00
Guillermo Rauch
a3707afc5b Removed onClose from xhr 2010-08-02 09:52:13 -07:00
Guillermo Rauch
6884a643e8 Changed onreadystatechange/send order 2010-08-01 17:14:46 -07:00
Guillermo Rauch
a8efecaa56 0.5.3 2010-08-01 14:04:23 -07:00
Guillermo Rauch
2bcc175241 Build 2010-08-01 14:04:05 -07:00
Guillermo Rauch
40e06d2f73 Restorted _checkSend (accidentally removed) 2010-08-01 14:03:53 -07:00
Guillermo Rauch
6f6ae2e53b Build 2010-08-01 12:33:50 -07:00
Guillermo Rauch
a9d2c738e2 Fixed method duplication 2010-08-01 12:32:20 -07:00
Guillermo Rauch
9ac738be4a 0.5.2
Build
2010-08-01 11:26:05 -07:00
Guillermo Rauch
c5f990c9d6 Fix for queuing before socket is connected.
Make sure XHR-based transports can handle arrays of messages
2010-08-01 11:24:18 -07:00
Guillermo Rauch
f090bca342 Just tested on iPad 2010-07-29 10:42:54 -07:00
Guillermo Rauch
2fe9fec1ef Temporarily changed default for rememberTransport 2010-07-29 10:37:00 -07:00
Guillermo Rauch
42bc64e9a6 Tested browsers list 2010-07-29 02:10:05 -07:00
Guillermo Rauch
f541b540fa Updated README 2010-07-29 01:58:21 -07:00
Guillermo Rauch
7a5e2b8cac Build 2010-07-28 21:08:36 -07:00
Guillermo Rauch
43259d4373 Check for messages to send before trying to send yo 2010-07-28 21:04:08 -07:00
Guillermo Rauch
3579c1ce93 Fixed buffered posting for XHR transports 2010-07-28 20:59:36 -07:00
Guillermo Rauch
ad76f786b4 Replacing unicode characters for flashsocket 2010-07-28 19:45:27 -07:00
Guillermo Rauch
1c9351c6cf Fix onHeartbeat internal call reference 2010-07-28 18:33:44 -07:00
Guillermo Rauch
9ce1d7b272 Changed frame unicode character 2010-07-28 16:47:46 -07:00
Guillermo Rauch
5c453da957 Fix for event firing (build) 2010-07-28 16:40:20 -07:00
Guillermo Rauch
c2da5a06aa Fix for event firing 2010-07-28 16:40:07 -07:00
Guillermo Rauch
99c4e8deab Removed reference to .messages (legacy JSON decoding) 2010-07-28 16:35:49 -07:00
Guillermo Rauch
e469528f4e Removed reference to .messages (legacy JSON decoding) 2010-07-28 16:35:28 -07:00
Guillermo Rauch
c42d188872 Make sure websocket transport name is lowercase 2010-07-28 16:28:39 -07:00
Guillermo Rauch
13976ac33e Make sure parent constructors are called properly
Fix for Flashsocket not calling Websocket constructor
2010-07-28 16:08:09 -07:00
Guillermo Rauch
33502d056a Build 2010-07-28 16:04:57 -07:00
Guillermo Rauch
a91013ffd9 Server > Socket typo 2010-07-28 16:04:49 -07:00
Guillermo Rauch
b7f856452b Build 2010-07-28 16:03:12 -07:00
Guillermo Rauch
a219ed68fb Fixed bad reference to Flashsocket
Fixed typo in parent call to _onClose
Fixed broken XHR.request reference
2010-07-28 16:02:39 -07:00
Guillermo Rauch
0a6e113350 New build 2010-07-28 15:59:51 -07:00
Guillermo Rauch
78ede4bcf8 Fixed typo 2010-07-28 15:59:44 -07:00
Guillermo Rauch
d94ff19cad Fixed leaked global 2010-07-28 11:34:38 -07:00
Guillermo Rauch
09094a2114 Build updated 2010-07-28 11:16:44 -07:00
Guillermo Rauch
068335da6b Handling of undefined and null values
Implemented isArray
2010-07-28 11:15:36 -07:00
Guillermo Rauch
93d2424c32 Added util.isArray for safe array type checking
Fix for _encode
2010-07-28 11:12:15 -07:00
Guillermo Rauch
f0a307269f Updated builder
Added makefile and `make build` task
Updated socket.io.js
Added basic prototype inheritance support
2010-07-28 10:58:33 -07:00
Guillermo Rauch
1fb3b86a9f Updated web-socket-js 2010-07-28 10:35:39 -07:00
Guillermo Rauch
534fc32542 Implemented encoding 2010-07-28 10:13:39 -07:00
Guillermo Rauch
adb95f4ceb Updated encoding/decoding
Updated README
2010-07-28 10:07:12 -07:00
Guillermo Rauch
587c579504 Implementation of buffering for XHR send messages
XHR sending is now handled exclusively by XHR.js
HTMLFile inherits from XHR for POST handling
Implemented heartbeats echoing
Events integrated directly into socket.js
New default method to add events is `on`.
Added aliases for old event handling methods
Simplified utilities / removed legacy code
Updated build.js
Actually implemented the private method _get for XHR transports (we were overriding connect() before)
Updated example/API
2010-07-21 23:16:03 -07:00
Guillermo Rauch
e67d6544d1 Removed object, options, json dependencies
Simplified classes
Bump version to 0.5
2010-07-19 14:49:31 -07:00
Guillermo Rauch
fec3a888e0 0.2.4 2010-06-18 03:00:02 -03:00
Jacob Thornton
0f950af625 changes removeEvent to splice event array rather than delete from it, which was causing undefinied valuesand throwing errors 2010-06-12 11:47:35 -07:00
Guillermo Rauch
8d19f82c9f Added checks for cross-domain in transports
Added support for XDomainRequest (IE8)
2010-06-01 08:38:20 -03:00
Guillermo Rauch
d643e6029c Updated build 2010-05-27 21:38:14 -03:00
Guillermo Rauch
c91140d022 Improved flash detection
Updated web-socket-js
Bumped version
2010-05-27 21:37:49 -03:00
Guillermo Rauch
acdd16b071 _onData now takes objects too
Fixed htmlfile transport
2010-05-27 21:31:35 -03:00
Guillermo Rauch
7bb7be23d1 Build updated
Updated copyrights
2010-05-26 21:19:02 -03:00
Guillermo Rauch
54c0c792ce Version 0.2.2 2010-05-26 21:07:16 -03:00
Guillermo Rauch
0cc19a524f Fixed long polling for IE8
- Added timestamp to make sure GET requests are not cached
 - Make sure timestamp is not confounded with the protocol sessionId
2010-05-26 21:06:16 -03:00
Guillermo Rauch
8a34dc7598 Note about submodules 2010-05-13 22:04:57 -03:00
Guillermo Rauch
1e0e9fb87d 0.2.1 2010-04-30 09:00:41 -03:00
Guillermo Rauch
0546f9977f htmlfile temporarily disabled until I gain access to an IE box :P 2010-04-30 09:00:00 -03:00
Guillermo Rauch
1b19122a02 Updated README 2010-04-30 08:56:31 -03:00
Guillermo Rauch
28c4583255 Server events removed
New build
2010-04-30 08:34:21 -03:00
Guillermo Rauch
be50f65567 Removed legacy io.util.JSON 2010-04-30 07:54:21 -03:00
Guillermo Rauch
af92e825ce Version update (0.2.0) 2010-04-30 07:51:01 -03:00
Guillermo Rauch
2ef27e0f2f htmlfile extra XHR feature detection
removed legacy onData
2010-04-30 07:50:03 -03:00
Guillermo Rauch
db8bb18135 Futuristic fix for when gimite adds Flash detection to web-socket-js 2010-04-03 18:49:53 -07:00
Guillermo Rauch
ca21b52818 0.1.7 2010-04-03 18:30:22 -07:00
Guillermo Rauch
f9eb55da55 Fix for iPad/iPhone! wooohoo! 2010-04-03 18:29:02 -07:00
Guillermo Rauch
fd46282c95 Replaced JSON with Crockford's 2010-04-01 19:43:51 -07:00
Guillermo Rauch
f2079f1212 Build 0.1.5 2010-04-01 18:31:51 -07:00
Guillermo Rauch
cd54ade8c3 0.1.5 2010-04-01 18:31:43 -07:00
Guillermo Rauch
4344190017 JSON util fix 2010-04-01 18:29:05 -07:00
Guillermo Rauch
c32239c5e7 Version bump 2010-04-01 17:38:48 -07:00
Guillermo Rauch
5a5c46e3c6 JSON util fixes 2010-04-01 17:38:21 -07:00
Guillermo Rauch
4cb4e26570 Accommodate try{} to only capture JSON decoding errors, and show the rest.
Version bump
2010-04-01 15:54:07 -07:00
Guillermo Rauch
2358f44215 Version 0.1.2 2010-03-30 17:05:13 -07:00
Guillermo Rauch
2020ad8cfc Warning for flashsocket for devs that forget to call io.setPath 2010-03-30 17:01:12 -07:00
Guillermo Rauch
dbfec13855 Ensure the trailing slash is added in case the dev forgets it 2010-03-30 16:57:07 -07:00
Guillermo Rauch
a8290043b7 Fixes default port
If host not present defaults to document.domain
2010-03-28 03:36:12 -07:00
Guillermo Rauch
5cebe02f5d Builder now puts a notice at the top of the file
Fixed indentation
2010-03-18 20:50:31 -07:00
Guillermo Rauch
16e1f3560c - No longer generating the minified version (was confusing some people)
- Added node-based builder
- Fix for missing trailing ; in oo.js
- Added copyright headers
2010-03-18 19:07:47 -07:00
Guillermo Rauch
6d16490326 - Make sure websocket transport doesn't confound it with the flash websocket (could happen if you connect to the io.Socket onload)
- Marked setPath as will-deprecate
2010-03-18 17:49:33 -07:00
Guillermo Rauch
ddce412c88 Minified 2010-03-17 13:22:48 -07:00
Guillermo Rauch
54ff1d4058 Readme fix 2010-03-17 13:14:10 -07:00
Guillermo Rauch
541699e79f htmlfile temporarily disabled (will fallback to xhr polling in IE) 2010-03-17 13:12:13 -07:00
Guillermo Rauch
388dd928f3 io.util.Class renamed to ioClass 2010-03-17 13:10:27 -07:00
Guillermo Rauch
0600a19ef8 Remove global/this check 2010-03-17 13:07:18 -07:00
Guillermo Rauch
7aaf567a35 oo fix 2010-03-17 13:04:12 -07:00
Guillermo Rauch
dab45734e5 Fix typo 2010-03-17 13:00:58 -07:00
Guillermo Rauch
0393369542 Namespaced oo to avoid conflicts.
Removed js-oo as submodule and copied to util/.
2010-03-17 12:53:46 -07:00
Guillermo Rauch
f8228d9466 .path => .setPath
Changed event listeners for flashsocket compatibility
2010-03-17 12:31:16 -07:00
Guillermo Rauch
bfeb35f58d Flashsocket fixes 2010-03-17 12:22:04 -07:00
Guillermo Rauch
f30f50376c XHR-Multipart readyState fix 2010-03-17 12:13:20 -07:00
Guillermo Rauch
f8350592bb Removed io.lab 2010-03-17 12:08:00 -07:00
Guillermo Rauch
b1d4bc98c2 __swfLocation fix
io.path put back to README
2010-03-17 12:05:06 -07:00
Guillermo Rauch
83d403ae3c LABjs temporarily removed 2010-03-17 12:01:59 -07:00
Guillermo Rauch
d4b772aeb5 Lazy loading of Flash removed temporarily due to a bug in Safari 4 2010-03-17 12:01:02 -07:00
Guillermo Rauch
de3fa7eac4 LABjs temporarily removed 2010-03-17 11:58:25 -07:00
Guillermo Rauch
4e2cb42ec6 LABjs temporarily removed 2010-03-17 11:57:31 -07:00
Guillermo Rauch
9a822a5e60 Pass true to _request :P 2010-03-16 21:24:17 -07:00
Guillermo Rauch
2ea11161fa Send multipart=true before open 2010-03-16 21:17:14 -07:00
Guillermo Rauch
0757eb0ed8 Set multipart=true 2010-03-16 21:14:20 -07:00
Guillermo Rauch
8180d307df README fixes 2010-03-16 18:15:17 -07:00
Guillermo Rauch
b98744123b Test removed (see server test/) 2010-03-15 19:52:31 -07:00
Guillermo Rauch
042b4d7f9a Doc fix 2010-03-15 19:46:17 -07:00
Guillermo Rauch
507dc04388 Initial commit 2010-03-15 19:40:48 -07:00
836 changed files with 299804 additions and 23468 deletions

View File

@@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
labels: 'to triage'
assignees: ''
---
@@ -14,44 +14,39 @@ A clear and concise description of what the bug is.
Please fill the following code example:
Engine.IO server version: `x.y.z`
Socket.IO server version: `x.y.z`
*Server*
```js
const engine = require("engine.io");
const server = engine.listen(3000, {});
import { Server } from "socket.io";
server.on("connection", (socket) => {
console.log("connection");
const io = new Server(3000, {});
socket.on("message", (data) => {
console.log("data", data);
});
io.on("connection", (socket) => {
console.log(`connect ${socket.id}`);
socket.on("close", () => {
console.log("close");
socket.on("disconnect", () => {
console.log(`disconnect ${socket.id}`);
});
});
```
Engine.IO client version: `x.y.z`
Socket.IO client version: `x.y.z`
*Client*
```js
const socket = require("engine.io-client")("ws://localhost:3000");
import { io } from "socket.io-client";
socket.on("open", () => {
console.log("open");
const socket = io("ws://localhost:3000/", {});
socket.on("message", (data) => {
console.log("data", data);
});
socket.on("connect", () => {
console.log(`connect ${socket.id}`);
});
socket.on("close", () => {
console.log("close");
});
socket.on("disconnect", () => {
console.log("disconnect");
});
```

View File

@@ -1,6 +1,4 @@
*Note*: the `engine.io.js` file is the generated output of `make engine.io.js`, and should not be manually modified.
### The kind of change this PR does introduce
* [x] a bug fix
@@ -9,10 +7,10 @@
* [ ] a code change that improves performance
* [ ] other
### Current behaviour
### Current behavior
### New behaviour
### New behavior
### Other information (e.g. related issues)

45
.github/workflows/build-examples.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: Build examples
on:
schedule:
- cron: '0 0 * * 0'
permissions:
contents: read
jobs:
build-examples:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
example:
- custom-parsers
- typescript-example/cjs
- typescript-example/esm
- typescript-client-example/cjs
- typescript-client-example/esm
- webpack-build
- webpack-build-server
- basic-crud-application/angular-client
- basic-crud-application/vue-client
- nextjs-pages-router
- nextjs-app-router
- nuxt-example
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Build ${{ matrix.example }}
run: |
cd examples/${{ matrix.example }}
npm install
npm run build

41
.github/workflows/ci-browser.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: CI (browser)
on:
push:
branches:
- '**'
paths:
- 'packages/engine.io-parser/**'
- 'packages/engine.io-client/**'
- 'packages/socket.io-parser/**'
- 'packages/socket.io-client/**'
permissions:
contents: read
jobs:
test-browser:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Compile each package
run: npm run compile --workspaces --if-present
- name: Run tests
run: npm test --workspace=socket.io-parser --workspace=socket.io-client
env:
BROWSERS: 1
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}

View File

@@ -2,35 +2,77 @@ name: CI
on:
push:
branches:
- '**'
pull_request:
schedule:
- cron: '0 0 * * 0'
permissions:
contents: read
jobs:
test-node:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
node-version:
- 16
- 20
- 22
- 24
services:
redis:
image: redis:7
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: changeit
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Compile each package
run: npm run compile --workspaces --if-present
- name: Run tests with fetch()
run: npm run test:node-fetch
if: ${{ matrix.node-version == '20' }} # fetch() was added in Node.js v18.0.0 (without experimental flag)
- name: Run tests
run: npm test --workspaces
- name: Run tests with uws (engine.io)
run: npm run test:uws --workspace=engine.io
if: ${{ matrix.node-version == '18' }}
- name: Run tests with fetch instead of XHR (engine.io-client)
run: npm run test:node-fetch --workspace=engine.io-client
if: ${{ matrix.node-version == '18' }}
- name: Run tests with Node.js native WebSocket (engine.io-client)
run: npm run test:node-builtin-ws --workspace=engine.io-client
if: ${{ matrix.node-version == '22' }}

35
.github/workflows/publish.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
# reference: https://docs.npmjs.com/trusted-publishers#for-github-actions
name: Publish
on:
push:
tags:
# expected format: <package>@<version> (example: socket.io@1.2.3)
- '**@*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Compile each package
run: npm run compile --workspaces --if-present
- name: Publish package
run: npm publish --workspace=${GITHUB_REF_NAME%@*} --access public

19
.gitignore vendored
View File

@@ -1,8 +1,15 @@
node_modules
.DS_Store
build
components
/coverage
npm-debug.log
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
benchmarks/*.png
node_modules
coverage
.idea
test/support/public/engine.io.min.js
.nyc_output
dist/
build/

View File

@@ -1,612 +1,18 @@
# History
| Version | Release date | Bundle size (UMD min+gzip) |
|-------------------------------------------------------------------------------------------------------------|----------------|----------------------------|
| [6.6.0](#660-2024-06-21) | June 2024 | `8.6 KB` |
| [6.5.4](#654-2024-06-18) (from the [6.5.x](https://github.com/socketio/engine.io-client/tree/6.5.x) branch) | June 2024 | `8.8 KB` |
| [3.5.4](#354-2024-06-18) (from the [3.5.x](https://github.com/socketio/engine.io-client/tree/3.5.x) branch) | June 2024 | `-` |
| [6.5.3](#653-2023-11-09) | November 2023 | `8.8 KB` |
| [6.5.2](#652-2023-08-01) | August 2023 | `8.8 KB` |
| [6.5.1](#651-2023-06-28) | June 2023 | `8.4 KB` |
| [6.5.0](#650-2023-06-16) | June 2023 | `7.8 KB` |
| [6.4.0](#640-2023-02-06) | February 2023 | `7.8 KB` |
| [6.3.1](#631-2023-02-04) | February 2023 | `7.8 KB` |
| [6.3.0](#630-2023-01-10) | January 2023 | `8.0 KB` |
| [6.2.3](#623-2022-10-13) | October 2022 | `7.8 KB` |
| [3.5.3](#353-2022-09-07) | September 2022 | `-` |
| [6.2.2](#622-2022-05-02) | May 2022 | `7.8 KB` |
| [6.2.1](#621-2022-04-17) | April 2022 | `7.8 KB` |
| [6.2.0](#620-2022-04-17) | April 2022 | `7.8 KB` |
| [6.0.3](#603-2021-11-14) (from the [6.0.x](https://github.com/socketio/engine.io-client/tree/6.0.x) branch) | November 2021 | `7.4 KB` |
| [6.1.1](#611-2021-11-14) | November 2021 | `7.4 KB` |
| [6.1.0](#610-2021-11-08) | November 2021 | `7.4 KB` |
| [6.0.2](#602-2021-10-15) | October 2021 | `7.4 KB` |
| [6.0.1](#601-2021-10-14) | October 2021 | `7.4 KB` |
| [**6.0.0**](#600-2021-10-08) | October 2021 | `7.5 KB` |
| [5.2.0](#520-2021-08-29) | August 2021 | `9.4 KB` |
| [5.1.2](#512-2021-06-24) | June 2021 | `9.3 KB` |
| [5.1.1](#511-2021-05-11) | May 2021 | `9.2 KB` |
| [4.1.4](#414-2021-05-05) (from the [4.1.x](https://github.com/socketio/engine.io-client/tree/4.1.x) branch) | May 2021 | `9.1 KB` |
| [3.5.2](#352-2021-05-05) (from the [3.5.x](https://github.com/socketio/engine.io-client/tree/3.5.x) branch) | May 2021 | `-` |
| [5.1.0](#510-2021-05-04) | May 2021 | `9.2 KB` |
| [5.0.1](#501-2021-03-31) | March 2021 | `9.2 KB` |
| [**5.0.0**](#500-2021-03-10) | March 2021 | `9.3 KB` |
| [3.5.1](#351-2021-03-02) (from the [3.5.x](https://github.com/socketio/engine.io-client/tree/3.5.x) branch) | March 2021 | `-` |
| [4.1.2](#412-2021-02-25) | February 2021 | `9.2 KB` |
| [4.1.1](#411-2021-02-02) | February 2021 | `9.1 KB` |
| [4.1.0](#410-2021-01-14) | January 2021 | `9.1 KB` |
# Release notes
## [6.6.0](https://github.com/socketio/engine.io-client/compare/6.5.3...6.6.0) (2024-06-21)
### Bug Fixes
* add some randomness to the cache busting string generator ([b624c50](https://github.com/socketio/engine.io-client/commit/b624c508325615fe5f0ba82293d14831d8861324))
* fix cookie management with WebSocket (Node.js only) ([e105551](https://github.com/socketio/engine.io-client/commit/e105551ef17ff8a23aa3ebdea9119619ae4208ad))
### Features
* add HTTP long-polling implementation based on fetch() ([b11763b](https://github.com/socketio/engine.io-client/commit/b11763beecfe4622867b4dec9d1db77460733ffb))
* add the ability to test all transports ([579b243](https://github.com/socketio/engine.io-client/commit/579b243e89ac7dc58233f9844ef70817364ecf52))
* allow to provide a list of transport implementations ([f4d898e](https://github.com/socketio/engine.io-client/commit/f4d898ee9652939a4550a41ac0e8143056154c0a))
### Dependencies
- [`ws@~8.17.1`](https://github.com/websockets/ws/releases/tag/8.17.1) (no change)
## [6.5.4](https://github.com/socketio/engine.io-client/compare/6.5.3...6.5.4) (2024-06-18)
This release contains a bump of the `ws` dependency, which includes an important [security fix](https://github.com/websockets/ws/commit/e55e5106f10fcbaac37cfa89759e4cc0d073a52c).
Advisory: https://github.com/advisories/GHSA-3h5v-q93c-6h6q
### Dependencies
- [`ws@~8.17.1`](https://github.com/websockets/ws/releases/tag/8.17.1) ([diff](https://github.com/websockets/ws/compare/8.11.0...8.17.1))
## [3.5.4](https://github.com/socketio/engine.io-client/compare/3.5.3...3.5.4) (2024-06-18)
This release contains a bump of the `ws` dependency, which includes an important [security fix](https://github.com/websockets/ws/commit/e55e5106f10fcbaac37cfa89759e4cc0d073a52c).
Advisory: https://github.com/advisories/GHSA-3h5v-q93c-6h6q
### Dependencies
- [`ws@~7.5.10`](https://github.com/websockets/ws/releases/tag/7.5.10) ([diff](https://github.com/websockets/ws/compare/7.4.2...7.5.10))
## [6.5.3](https://github.com/socketio/engine.io-client/compare/6.5.2...6.5.3) (2023-11-09)
### Bug Fixes
* add a maximum length for the URL ([707597d](https://github.com/socketio/engine.io-client/commit/707597df26abfa1e6b569b2a62918dfcc8b80b5d))
* improve compatibility with node16 module resolution ([#711](https://github.com/socketio/engine.io-client/issues/711)) ([46ef851](https://github.com/socketio/engine.io-client/commit/46ef8512edac758069ed4d519f7517bafbace4a9))
### Dependencies
- [`ws@~8.11.0`](https://github.com/websockets/ws/releases/tag/8.11.0) (no change)
## [6.5.2](https://github.com/socketio/engine.io-client/compare/6.5.1...6.5.2) (2023-08-01)
### Bug Fixes
* **webtransport:** add proper framing ([d55c39e](https://github.com/socketio/engine.io-client/commit/d55c39e0ed5cb7b3a34875a398efc111c91184f6))
* **webtransport:** honor the binaryType attribute ([8270e00](https://github.com/socketio/engine.io-client/commit/8270e00d5b865278d136a4d349b344cbc2b38dc5))
### Dependencies
- [`ws@~8.11.0`](https://github.com/websockets/ws/releases/tag/8.11.0) (no change)
## [6.5.1](https://github.com/socketio/engine.io-client/compare/6.5.0...6.5.1) (2023-06-28)
### Bug Fixes
* make closeOnBeforeunload default to false ([a63066b](https://github.com/socketio/engine.io-client/commit/a63066bdc8ae9e6746c3113d06c2ead78f4a4851))
* **webtransport:** properly handle abruptly closed connections ([cf6aa1f](https://github.com/socketio/engine.io-client/commit/cf6aa1f43c27a56c076bf26fddfce74bfeb65040))
### Dependencies
- [`ws@~8.11.0`](https://github.com/websockets/ws/releases/tag/8.11.0) (no change)
## [6.5.0](https://github.com/socketio/engine.io-client/compare/6.4.0...6.5.0) (2023-06-16)
### Features
#### Support for WebTransport
The Engine.IO client can now use WebTransport as the underlying transport.
WebTransport is a web API that uses the HTTP/3 protocol as a bidirectional transport. It's intended for two-way communications between a web client and an HTTP/3 server.
References:
- https://w3c.github.io/webtransport/
- https://developer.mozilla.org/en-US/docs/Web/API/WebTransport
- https://developer.chrome.com/articles/webtransport/
**For Node.js clients**: until WebTransport support lands [in Node.js](https://github.com/nodejs/node/issues/38478), you can use the `@fails-components/webtransport` package:
```js
import { WebTransport } from "@fails-components/webtransport";
global.WebTransport = WebTransport;
```
Added in [7195c0f](https://github.com/socketio/engine.io-client/commit/7195c0f305b482f7b1ca2ed812030caaf72c0906).
#### Cookie management for the Node.js client
When setting the `withCredentials` option to `true`, the Node.js client will now include the cookies in the HTTP requests, making it easier to use it with cookie-based sticky sessions.
```js
import { Socket } from "engine.io-client";
const socket = new Socket("https://example.com", {
withCredentials: true
});
```
Added in [5fc88a6](https://github.com/socketio/engine.io-client/commit/5fc88a62d4017cdc144fa39b9755deadfff2db34).
### Dependencies
- [`ws@~8.11.0`](https://github.com/websockets/ws/releases/tag/8.11.0) (no change)
## [6.4.0](https://github.com/socketio/engine.io-client/compare/6.3.1...6.4.0) (2023-02-06)
The minor bump is due to changes on the server side.
### Dependencies
- [`ws@~8.11.0`](https://github.com/websockets/ws/releases/tag/8.11.0) (no change)
## [6.3.1](https://github.com/socketio/engine.io-client/compare/6.3.0...6.3.1) (2023-02-04)
### Bug Fixes
* **typings:** do not expose browser-specific types ([37d7a0a](https://github.com/socketio/engine.io-client/commit/37d7a0aa791a4666ca405b11d0d8bdb199222e50))
### Dependencies
- [`ws@~8.11.0`](https://github.com/websockets/ws/releases/tag/8.11.0) (no change)
## [6.3.0](https://github.com/socketio/engine.io-client/compare/6.2.3...6.3.0) (2023-01-10)
### Bug Fixes
* properly parse relative URL with a "@" character ([12b7d78](https://github.com/socketio/engine.io-client/commit/12b7d7817e9c0016c970f903de15ed8b4255ea90))
* use explicit context for setTimeout function ([#699](https://github.com/socketio/engine.io-client/issues/699)) ([047f420](https://github.com/socketio/engine.io-client/commit/047f420b86a669752536ff425261e7be60a80692))
### Features
* add the "addTrailingSlash" option ([#694](https://github.com/socketio/engine.io-client/issues/694)) ([21a6e12](https://github.com/socketio/engine.io-client/commit/21a6e1219add92157c5442537d24fbe1129a50f5))
The trailing slash which was added by default can now be disabled:
```js
import { Socket } from "engine.io-client";
const socket = new Socket("https://example.com", {
addTrailingSlash: false
});
```
In the example above, the request URL will be `https://example.com/engine.io` instead of `https://example.com/engine.io/`.
### Dependencies
- [`ws@~8.11.0`](https://github.com/websockets/ws/releases/tag/8.11.0) ([diff](https://github.com/websockets/ws/compare/8.2.3...8.11.0))
## [6.2.3](https://github.com/socketio/engine.io-client/compare/6.2.2...6.2.3) (2022-10-13)
### Bug Fixes
* properly clear "beforeunload" event listener ([99925a4](https://github.com/socketio/engine.io-client/commit/99925a47750f66d2ad36313243545181512579ee))
### Dependencies
- [`ws@~8.2.3`](https://github.com/websockets/ws/releases/tag/8.2.3) (no change)
## [3.5.3](https://github.com/socketio/engine.io-client/compare/3.5.2...3.5.3) (2022-09-07)
### Bug Fixes
* fix usage with vite ([280de36](https://github.com/socketio/engine.io-client/commit/280de368092b17648b59b7467fa49f2425edcd45))
### Dependencies
- [`ws@~7.4.2`](https://github.com/websockets/ws/releases/tag/7.4.2) (no change)
## [6.2.2](https://github.com/socketio/engine.io-client/compare/6.2.1...6.2.2) (2022-05-02)
### Bug Fixes
* simplify the check for WebSocket availability ([f158c8e](https://github.com/socketio/engine.io-client/commit/f158c8e255be9e849313e53201adf1642c60345a))
This check was added for the flashsocket transport, which has been deprecated for a while now ([1]). But it fails with latest webpack versions, as the expression `"__initialize" in WebSocket` gets evaluated to `true`.
* use named export for globalThis shim ([#688](https://github.com/socketio/engine.io-client/issues/688)) ([32878ea](https://github.com/socketio/engine.io-client/commit/32878ea047c38e2b2f0444e828ac71f4d833971f))
Default export of globalThis seems to have a problem in the "browser" field when the library is loaded asynchronously with webpack.
## [6.2.1](https://github.com/socketio/engine.io-client/compare/6.2.0...6.2.1) (2022-04-17)
# [6.2.0](https://github.com/socketio/engine.io-client/compare/6.1.1...6.2.0) (2022-04-17)
### Features
* add details to the "close" event ([b9252e2](https://github.com/socketio/engine.io-client/commit/b9252e207413a850db7e4f0f0ef7dd2ef0ed26da))
The close event will now include additional details to help debugging if anything has gone wrong.
Example when a payload is over the maxHttpBufferSize value in HTTP long-polling mode:
```js
socket.on("close", (reason, details) => {
console.log(reason); // "transport error"
// in that case, details is an error object
console.log(details.message); "xhr post error"
console.log(details.description); // 413 (the HTTP status of the response)
// details.context refers to the XMLHttpRequest object
console.log(details.context.status); // 413
console.log(details.context.responseText); // ""
});
```
Note: the error object was already included before this commit and is kept for backward compatibility.
* slice write buffer according to the maxPayload value ([46fdc2f](https://github.com/socketio/engine.io-client/commit/46fdc2f0ed352b454614247406689edc9d908927))
The server will now include a "maxPayload" field in the handshake details, allowing the clients to decide how many
packets they have to send to stay under the maxHttpBufferSize value.
## [6.0.3](https://github.com/socketio/engine.io-client/compare/6.0.2...6.0.3) (2021-11-14)
Some bug fixes were backported from master, to be included by the latest `socket.io-client` version.
### Bug Fixes
* add package name in nested package.json ([32511ee](https://github.com/socketio/engine.io-client/commit/32511ee32a0a6122e99db35833ed948aa4e427ac))
* fix vite build for CommonJS users ([9fcaf58](https://github.com/socketio/engine.io-client/commit/9fcaf58d18c013c0b92fdaf27481f0383efb3658))
## [6.1.1](https://github.com/socketio/engine.io-client/compare/6.1.0...6.1.1) (2021-11-14)
### Bug Fixes
* add package name in nested package.json ([6e798fb](https://github.com/socketio/engine.io-client/commit/6e798fbb5b11a1cfec03ece3dfce03213b5f9a12))
* fix vite build for CommonJS users ([c557707](https://github.com/socketio/engine.io-client/commit/c557707fb694bd10397b4cd8b4ec2fbe59128faa))
# [6.1.0](https://github.com/socketio/engine.io-client/compare/6.0.2...6.1.0) (2021-11-08)
The minor bump is due to changes on the server side.
### Bug Fixes
* **typings:** allow any value in the query option ([018e1af](https://github.com/socketio/engine.io-client/commit/018e1afcc5ef5eac81e9e1629db053bda44120ee))
* **typings:** allow port to be a number ([#680](https://github.com/socketio/engine.io-client/issues/680)) ([8f68f77](https://github.com/socketio/engine.io-client/commit/8f68f77825af069fe2c612a3200a025d4130ac0a))
## [6.0.2](https://github.com/socketio/engine.io-client/compare/6.0.1...6.0.2) (2021-10-15)
### Bug Fixes
* **bundle:** fix vite build ([faa9f31](https://github.com/socketio/engine.io-client/commit/faa9f318e70cd037af79bfa20e9d21b284ddf257))
## [6.0.1](https://github.com/socketio/engine.io-client/compare/6.0.0...6.0.1) (2021-10-14)
### Bug Fixes
* fix usage with vite ([4971914](https://github.com/socketio/engine.io-client/commit/49719142f65e23efa65fca4f66765ded5d955972))
# [6.0.0](https://github.com/socketio/engine.io-client/compare/5.2.0...6.0.0) (2021-10-08)
This major release contains three important changes:
- the codebase was migrated to TypeScript ([7245b80](https://github.com/socketio/engine.io-client/commit/7245b803e0c8d57cfc1f1cd8b8c8d598e8397967))
- rollup is now used instead of webpack to create the bundles ([27de300](https://github.com/socketio/engine.io-client/commit/27de300de42420ab59a02ec7a3445e636cbcc78e))
- code that provided support for ancient browsers (think IE8) was removed ([c656192](https://github.com/socketio/engine.io-client/commit/c6561928be628084fd2f5e7a70943c8e5c582873) and [b2c7381](https://github.com/socketio/engine.io-client/commit/b2c73812e978489b5dfbe516a26b6b8fd628856d))
There is now three distinct builds (in the build/ directory):
- CommonJS
- ESM with debug
- ESM without debug (rationale here: [00d7e7d](https://github.com/socketio/engine.io-client/commit/00d7e7d7ee85b4cfa6f9f547203cc692083ac61c))
And three bundles (in the dist/ directory) :
- `engine.io.js`: unminified UMD bundle
- `engine.io.min.js`: minified UMD bundle
- `engine.io.esm.min.js`: ESM bundle
Please note that the communication protocol was not updated, so a v5 client will be able to reach a v6 server (and vice-versa).
Reference: https://github.com/socketio/engine.io-protocol
### Features
* provide an ESM build without debug ([00d7e7d](https://github.com/socketio/engine.io-client/commit/00d7e7d7ee85b4cfa6f9f547203cc692083ac61c))
### BREAKING CHANGES
* the enableXDR option is removed ([c656192](https://github.com/socketio/engine.io-client/commit/c6561928be628084fd2f5e7a70943c8e5c582873))
* the jsonp and forceJSONP options are removed ([b2c7381](https://github.com/socketio/engine.io-client/commit/b2c73812e978489b5dfbe516a26b6b8fd628856d))
`ws` version: `~8.2.3`
# [5.2.0](https://github.com/socketio/engine.io-client/compare/5.1.2...5.2.0) (2021-08-29)
### Features
* add an option to use native timer functions ([#672](https://github.com/socketio/engine.io-client/issues/672)) ([5d1d5be](https://github.com/socketio/engine.io-client/commit/5d1d5bea11ab6854473ddc02a3391929ea4fc8f4))
## [5.1.2](https://github.com/socketio/engine.io-client/compare/5.1.1...5.1.2) (2021-06-24)
### Bug Fixes
* emit ping when receiving a ping from the server ([589d3ad](https://github.com/socketio/engine.io-client/commit/589d3ad63840329b5a61186603a415c534f8d4fc))
* **websocket:** fix timer blocking writes ([#670](https://github.com/socketio/engine.io-client/issues/670)) ([f30a10b](https://github.com/socketio/engine.io-client/commit/f30a10b7f45517fcb3abd02511c58a89e0ef498f))
## [5.1.1](https://github.com/socketio/engine.io-client/compare/5.1.0...5.1.1) (2021-05-11)
### Bug Fixes
* fix JSONP transport on IE9 ([bddd992](https://github.com/socketio/engine.io-client/commit/bddd9928fcdb33c79e0289bcafef337359dee12b))
## [4.1.4](https://github.com/socketio/engine.io-client/compare/4.1.3...4.1.4) (2021-05-05)
This release only contains a bump of `xmlhttprequest-ssl`, in order to fix the following vulnerability: https://www.npmjs.com/advisories/1665.
Please note that `engine.io-client` was not directly impacted by this vulnerability, since we are always using `async: true`.
## [3.5.2](https://github.com/socketio/engine.io-client/compare/3.5.1...3.5.2) (2021-05-05)
This release only contains a bump of `xmlhttprequest-ssl`, in order to fix the following vulnerability: https://www.npmjs.com/advisories/1665.
Please note that `engine.io-client` was not directly impacted by this vulnerability, since we are always using `async: true`.
# [5.1.0](https://github.com/socketio/engine.io-client/compare/5.0.1...5.1.0) (2021-05-04)
### Features
* add the "closeOnBeforeunload" option ([dcb85e9](https://github.com/socketio/engine.io-client/commit/dcb85e902d129b2d1a94943b4f6d471532f70dc9))
## [5.0.1](https://github.com/socketio/engine.io-client/compare/5.0.0...5.0.1) (2021-03-31)
### Bug Fixes
* ignore packets when the transport is silently closed ([d291a4c](https://github.com/socketio/engine.io-client/commit/d291a4c9f6accfc86fcd96683a5d493a87e3644c))
# [5.0.0](https://github.com/socketio/engine.io-client/compare/4.1.2...5.0.0) (2021-03-10)
The major bump is due to a breaking change on the server side.
### Features
* add autoUnref option ([6551683](https://github.com/socketio/engine.io-client/commit/65516836b2b6fe28d80e9a5918f9e10baa7451d8))
* listen to the "offline" event ([c361bc6](https://github.com/socketio/engine.io-client/commit/c361bc691f510b96f8909c5e6c62a4635d50275c))
## [3.5.1](https://github.com/socketio/engine.io-client/compare/3.5.0...3.5.1) (2021-03-02)
### Bug Fixes
* replace default nulls in SSL options with undefineds ([d0c551c](https://github.com/socketio/engine.io-client/commit/d0c551cca1e37301e8b28843c8f6e7ad5cf561d3))
## [4.1.2](https://github.com/socketio/engine.io-client/compare/4.1.1...4.1.2) (2021-02-25)
### Bug Fixes
* silently close the transport in the beforeunload hook ([ed48b5d](https://github.com/socketio/engine.io-client/commit/ed48b5dc3407e5ded45072606b3bb0eafa49c01f))
## [4.1.1](https://github.com/socketio/engine.io-client/compare/4.1.0...4.1.1) (2021-02-02)
### Bug Fixes
* remove polyfill for process in the bundle ([c95fdea](https://github.com/socketio/engine.io-client/commit/c95fdea83329b264964641bb48e3be2a8772f7a1))
# [4.1.0](https://github.com/socketio/engine.io-client/compare/4.0.6...4.1.0) (2021-01-14)
### Features
* add missing ws options ([d134fee](https://github.com/socketio/engine.io-client/commit/d134feeaa615afc4cbe0aa45aa4344c899b65df0))
## [4.0.6](https://github.com/socketio/engine.io-client/compare/4.0.5...4.0.6) (2021-01-04)
# [3.5.0](https://github.com/socketio/engine.io-client/compare/3.4.4...3.5.0) (2020-12-30)
### Bug Fixes
* check the type of the initial packet ([8750356](https://github.com/socketio/engine.io-client/commit/8750356dba5409ba0e1d3a27da6d214118702b3e))
## [4.0.5](https://github.com/socketio/engine.io-client/compare/4.0.4...4.0.5) (2020-12-07)
## [4.0.4](https://github.com/socketio/engine.io-client/compare/4.0.3...4.0.4) (2020-11-17)
### Bug Fixes
* check the type of the initial packet ([1c8cba8](https://github.com/socketio/engine.io-client/commit/1c8cba8818e930205918a70f05c1164865842a48))
* restore the cherry-picking of the WebSocket options ([4873a23](https://github.com/socketio/engine.io-client/commit/4873a237f1ce5fcb18e255dd604d50dcfc624ea8))
## [4.0.3](https://github.com/socketio/engine.io-client/compare/4.0.2...4.0.3) (2020-11-17)
### Bug Fixes
* **react-native:** add a default value for the withCredentials option ([ccb99e3](https://github.com/socketio/engine.io-client/commit/ccb99e3718e8ee2c50960430d2bd6c12a3dcb0dc))
* **react-native:** exclude the localAddress option ([177b95f](https://github.com/socketio/engine.io-client/commit/177b95fe463ad049b35170f042a771380fdaedee))
## [4.0.2](https://github.com/socketio/engine.io-client/compare/4.0.1...4.0.2) (2020-11-09)
## [4.0.1](https://github.com/socketio/engine.io-client/compare/4.0.0...4.0.1) (2020-10-21)
## [3.4.4](https://github.com/socketio/engine.io-client/compare/3.4.3...3.4.4) (2020-09-30)
# [4.0.0](https://github.com/socketio/engine.io-client/compare/v4.0.0-alpha.1...4.0.0) (2020-09-10)
More details about this release in the blog post: https://socket.io/blog/engine-io-4-release/
### Bug Fixes
* **react-native:** restrict the list of options for the WebSocket object ([2f5c948](https://github.com/socketio/engine.io-client/commit/2f5c948abe8fd1c0fdb010e88f96bd933a3792ea))
* use globalThis polyfill instead of self/global ([#634](https://github.com/socketio/engine.io-client/issues/634)) ([3f3a6f9](https://github.com/socketio/engine.io-client/commit/3f3a6f991404ef601252193382d2d2029cff6c45))
### Features
* strip debug from the browser bundle ([f7ba966](https://github.com/socketio/engine.io-client/commit/f7ba966e53f4609f755880be8fa504f7252b0817))
#### Links
- Diff: [v4.0.0-alpha.1...4.0.0](https://github.com/socketio/engine.io-client/compare/v4.0.0-alpha.1...4.0.0)
- Full diff: [3.4.0...4.0.0](https://github.com/socketio/engine.io-client/compare/3.4.0...4.0.0)
- Server release: [4.0.0](https://github.com/socketio/engine.io/releases/tag/4.0.0)
- ws version: [~7.2.1](https://github.com/websockets/ws/releases/tag/7.2.1)
## [3.4.1](https://github.com/socketio/engine.io-client/compare/3.4.0...3.4.1) (2020-04-17)
### Bug Fixes
* use globalThis polyfill instead of self/global ([357f01d](https://github.com/socketio/engine.io-client/commit/357f01d90448d8565b650377bc7cabb351d991bd))
#### Links
- Diff: [3.4.0...3.4.1](https://github.com/socketio/engine.io-client/compare/3.4.0...3.4.1)
- Server release: [3.4.1](https://github.com/socketio/engine.io/releases/tag/3.4.1)
- ws version: [~6.1.0](https://github.com/websockets/ws/releases/tag/6.1.0)
# [4.0.0-alpha.1](https://github.com/socketio/engine.io-client/compare/v4.0.0-alpha.0...v4.0.0-alpha.1) (2020-02-12)
### Bug Fixes
* properly assign options when creating the transport ([7c7f1a9](https://github.com/socketio/engine.io-client/commit/7c7f1a9fe24856e3a155db1dc67d12d1586ffa37))
#### Links
- Diff: [v4.0.0-alpha.0...v4.0.0-alpha.1](https://github.com/socketio/engine.io-client/compare/v4.0.0-alpha.0...v4.0.0-alpha.1)
- Server release: [v4.0.0-alpha.1](https://github.com/socketio/engine.io/releases/tag/v4.0.0-alpha.1)
- ws version: [~7.2.1](https://github.com/websockets/ws/releases/tag/7.2.1)
# [4.0.0-alpha.0](https://github.com/socketio/engine.io-client/compare/3.4.0...v4.0.0-alpha.0) (2020-02-12)
### chore
* migrate to webpack 4 ([11dc4f3](https://github.com/socketio/engine.io-client/commit/11dc4f3a56d440f24b8a091485fef038d592bd6e))
### Features
* reverse the ping-pong mechanism ([81d7171](https://github.com/socketio/engine.io-client/commit/81d7171c6bb4053c802e3cc4b29a0e42dcf9c065))
### BREAKING CHANGES
* v3.x clients will not be able to connect anymore (they
will send a ping packet and timeout while waiting for a pong packet).
* the output bundle will now be found in the dist/ folder.
#### Links
- Diff: [3.4.0...v4.0.0-alpha.0](https://github.com/socketio/engine.io-client/compare/3.4.0...v4.0.0-alpha.0)
- Server release: [v4.0.0-alpha.0](https://github.com/socketio/engine.io/releases/tag/v4.0.0-alpha.0)
- ws version: [~7.2.1](https://github.com/websockets/ws/releases/tag/7.2.1)
# Changelog
Here are the detailed changelogs for each package in this monorepo:
| Package | Changelog |
|------------------------------------|----------------------------------------------------------------|
| `engine.io` | [link](packages/engine.io/CHANGELOG.md) |
| `engine.io-client` | [link](packages/engine.io-client/CHANGELOG.md) |
| `engine.io-parser` | [link](packages/engine.io-parser/CHANGELOG.md) |
| `socket.io` | [link](packages/socket.io/CHANGELOG.md) |
| `socket.io-adapter` | [link](packages/socket.io-adapter/CHANGELOG.md) |
| `socket.io-client` | [link](packages/socket.io-client/CHANGELOG.md) |
| `@socket.io/cluster-adapter` | [link](packages/socket.io-cluster-adapter/CHANGELOG.md) |
| `@socket.io/cluster-engine` | [link](packages/socket.io-cluster-engine/CHANGELOG.md) |
| `@socket.io/component-emitter` | [link](packages/socket.io-component-emitter/History.md) |
| `socket.io-parser` | [link](packages/socket.io-parser/CHANGELOG.md) |
| `@socket.io/postgres-emitter` | [link](packages/socket.io-postgres-emitter/CHANGELOG.md) |
| `@socket.io/redis-streams-emitter` | [link](/packages/socket.io-redis-streams-emitter/CHANGELOG.md) |

167
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,167 @@
# Socket.IO Contributing Guide
Thanks a lot for your interest in contributing to Socket.IO!
Before submitting your contribution, please make sure to take a moment and read through the following guidelines:
<!-- TOC -->
* [Before you start](#before-you-start)
* [Guidelines for reporting a bug](#guidelines-for-reporting-a-bug)
* [Guidelines for requesting a feature](#guidelines-for-requesting-a-feature)
* [Guidelines for creating a pull request](#guidelines-for-creating-a-pull-request)
* [Bug fix](#bug-fix)
* [New feature](#new-feature)
* [Project structure](#project-structure)
* [Development setup](#development-setup)
* [Commands](#commands)
* [Compile with TypeScript](#compile-with-typescript)
* [Apply formatting](#apply-formatting)
* [Run the tests](#run-the-tests)
<!-- TOC -->
## Before you start
Our [issues list](https://github.com/socketio/socket.io/issues) is exclusively reserved for bug reports and feature requests. For usage questions, please use the following resources:
- read the [docs](https://socket.io/docs/v4/)
- check the [troubleshooting guide](https://socket.io/docs/v4/troubleshooting-connection-issues/)
- look for/ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/socket.io)
- create a new [discussion](https://github.com/socketio/socket.io/discussions/new?category=q-a)
## Guidelines for reporting a bug
If you think that you have found a security vulnerability in our project, please do not create an issue in this GitHub repository, but rather refer to our [security policy](./SECURITY.md).
Please make sure that the bug hasn't already been reported in our [issues list](https://github.com/socketio/socket.io/issues?q=label%3Abug+), as it may already have been fixed in a recent version. However, if the bug was reported in an old, closed issue but persists, you should open a new issue instead of commenting on the old issue.
After these checks, please [create a new bug report](https://github.com/socketio/socket.io/issues/new/choose) with all the necessary details:
- package versions
- platform (device, browser, operating system)
- a minimal reproduction (you can fork [this repository](https://github.com/socketio/socket.io-fiddle))
Without a clear way to reproduce the bug, we unfortunately won't be able to help you.
## Guidelines for requesting a feature
Please make sure that the feature hasn't already been requested in our [issues list](https://github.com/socketio/socket.io/labels/enhancement).
After these checks, please [create a new feature request](https://github.com/socketio/socket.io/issues/new/choose) with all the necessary details:
- what the problem is
- what you want to happen
- any alternative solutions or features you have considered
## Guidelines for creating a pull request
### Bug fix
- if you fix a bug which is described in our [issues list](https://github.com/socketio/socket.io/issues), please add a reference to it in the description of your pull request. Otherwise, please provide all necessary details to reproduce the bug, as described [above](#guidelines-for-reporting-a-bug).
- add one or more test cases, in order to avoid any regression in the future
- make sure existing tests still pass
### New feature
- we strongly suggest that you first open a [feature request](#guidelines-for-requesting-a-feature) and have it approved before working on it. In that case, please add a reference to it in the description of your pull request.
- add one or more test cases, in order to avoid any regression in the future
- make sure existing tests still pass
## Project structure
This repository is a [monorepo](https://en.wikipedia.org/wiki/Monorepo) which contains the source of the following packages:
| Package | Description |
|--------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|
| `engine.io` | The server-side implementation of the low-level communication layer. |
| `engine.io-client` | The client-side implementation of the low-level communication layer. |
| `engine.io-parser` | The parser responsible for encoding and decoding Engine.IO packets, used by both the `engine.io` and `engine.io-client` packages. |
| `socket.io` | The server-side implementation of the bidirectional channel, built on top on the `engine.io` package. |
| `socket.io-adapter` | An extensible component responsible for broadcasting a packet to all connected clients, used by the `socket.io` package. |
| `socket.io-client` | The client-side implementation of the bidirectional channel, built on top on the `engine.io-client` package. |
| `@socket.io/cluster-engine` | A cluster-friendly engine to share load between multiple Node.js processes (without sticky sessions) |
| `@socket.io/component-emitter` | An `EventEmitter` implementation, similar to the one provided by [Node.js](https://nodejs.org/api/events.html) but for all platforms. |
| `socket.io-parser` | The parser responsible for encoding and decoding Socket.IO packets, used by both the `socket.io` and `socket.io-client` packages. |
## Development setup
You will need [Node.js](https://nodejs.org) **version 18+**, and [`npm`](https://docs.npmjs.com/about-npm) **version 7+**, as we make use of npm's [workspaces feature](https://docs.npmjs.com/cli/v10/using-npm/workspaces).
After cloning the repository, please run:
```bash
npm ci
```
to install all dependencies.
Here is the list of tools that we use:
- [TypeScript](https://www.typescriptlang.org/) as the development language
- [Rollup](https://rollupjs.org/) for production bundling
- [Prettier](https://prettier.io/) for code formatting
- [Mocha](https://mochajs.org/) for testing
- [WebdriverIO](https://webdriver.io/) for browser and mobile testing
## Commands
Each npm workspace corresponds to a package. You can run the command:
- on all workspaces with the `--workspace` command-line argument (abbreviated `-ws`)
- on a specific workspace with the `--workspace=<some-workspace>` command-line argument
### Compile with TypeScript
For all workspaces:
```bash
npm run compile -ws --if-present
```
For a specific workspace:
```bash
npm run compile --workspace=socket.io
```
### Apply formatting
For all workspaces:
```bash
npm run format:fix -ws
```
For a specific workspace:
```bash
npm run format:fix --workspace=socket.io
```
### Run the tests
For all workspaces:
```bash
npm test -ws
```
For a specific workspace:
```bash
npm test --workspace=socket.io
```
### Generate the changelog
Install the [`conventional-changelog-cli`](https://www.npmjs.com/package/conventional-changelog-cli) package:
```bash
npm i -g conventional-changelog-cli
```
Then run:
```bash
cd packages/engine.io-client
conventional-changelog -p angular --tag-prefix "engine.io-client@" --commit-path .
```

View File

@@ -1,6 +1,6 @@
(The MIT License)
Copyright (c) 2014-2015 Automattic <dev@cloudup.com>
Copyright (c) 2014-present Guillermo Rauch and Socket.IO contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

335
README.md
View File

@@ -1,331 +1,34 @@
# socket.io
# Engine.IO client
[![Latest NPM version](https://img.shields.io/npm/v/socket.io.svg)](https://www.npmjs.com/package/socket.io)
[![Build status](https://github.com/socketio/socket.io/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/socketio/socket.io/actions/workflows/ci.yml)
[![Downloads per month](https://img.shields.io/npm/dm/socket.io.svg)]((https://www.npmjs.com/package/socket.io))
[![Build Status](https://github.com/socketio/engine.io-client/workflows/CI/badge.svg?branch=main)](https://github.com/socketio/engine.io-client/actions)
[![NPM version](https://badge.fury.io/js/engine.io-client.svg)](http://badge.fury.io/js/engine.io-client)
## Getting Started
This is the client for [Engine.IO](http://github.com/socketio/engine.io),
the implementation of transport-based cross-browser/cross-device
bi-directional communication layer for [Socket.IO](http://github.com/socketio/socket.io).
Please check our documentation [here](https://socket.io).
## How to use
## Questions
### Standalone
Our [issues list](https://github.com/socketio/socket.io/issues) is exclusively reserved for bug reports and feature requests. For usage questions, please use the following resources:
You can find an `engine.io.js` file in this repository, which is a
standalone build you can use as follows:
- read our [documentation](https://socket.io/docs/v4/)
- check our [troubleshooting guide](https://socket.io/docs/v4/troubleshooting-connection-issues/)
- look for/ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/socket.io)
- create a new [discussion](https://github.com/socketio/socket.io/discussions/new?category=q-a)
```html
<script src="/path/to/engine.io.js"></script>
<script>
// eio = Socket
const socket = eio('ws://localhost');
socket.on('open', () => {
socket.on('message', (data) => {});
socket.on('close', () => {});
});
</script>
```
## Security
### With browserify
If you think that you have found a security vulnerability in our project, please do not create an issue in this GitHub repository, but rather refer to our [Security Policy](./SECURITY.md).
Engine.IO is a commonjs module, which means you can include it by using
`require` on the browser and package using [browserify](http://browserify.org/):
## Issues and contribution
1. install the client package
Please make sure to read our [Contributing Guide](./CONTRIBUTING.md) before creating an issue or making a pull request.
```bash
$ npm install engine.io-client
```
Thanks to everyone who has already contributed to Socket.IO!
1. write your app code
```js
const { Socket } = require('engine.io-client');
const socket = new Socket('ws://localhost');
socket.on('open', () => {
socket.on('message', (data) => {});
socket.on('close', () => {});
});
```
1. build your app bundle
```bash
$ browserify app.js > bundle.js
```
1. include on your page
```html
<script src="/path/to/bundle.js"></script>
```
### Sending and receiving binary
```html
<script src="/path/to/engine.io.js"></script>
<script>
const socket = eio('ws://localhost/');
socket.binaryType = 'blob';
socket.on('open', () => {
socket.send(new Int8Array(5));
socket.on('message', (blob) => {});
socket.on('close', () => {});
});
</script>
```
### Node.JS
Add `engine.io-client` to your `package.json` and then:
```js
const { Socket } = require('engine.io-client');
const socket = new Socket('ws://localhost');
socket.on('open', () => {
socket.on('message', (data) => {});
socket.on('close', () => {});
});
```
### Node.js with certificates
```js
const opts = {
key: fs.readFileSync('test/fixtures/client.key'),
cert: fs.readFileSync('test/fixtures/client.crt'),
ca: fs.readFileSync('test/fixtures/ca.crt')
};
const { Socket } = require('engine.io-client');
const socket = new Socket('ws://localhost', opts);
socket.on('open', () => {
socket.on('message', (data) => {});
socket.on('close', () => {});
});
```
### Node.js with extraHeaders
```js
const opts = {
extraHeaders: {
'X-Custom-Header-For-My-Project': 'my-secret-access-token',
'Cookie': 'user_session=NI2JlCKF90aE0sJZD9ZzujtdsUqNYSBYxzlTsvdSUe35ZzdtVRGqYFr0kdGxbfc5gUOkR9RGp20GVKza; path=/; expires=Tue, 07-Apr-2015 18:18:08 GMT; secure; HttpOnly'
}
};
const { Socket } = require('engine.io-client');
const socket = new Socket('ws://localhost', opts);
socket.on('open', () => {
socket.on('message', (data) => {});
socket.on('close', () => {});
});
```
In the browser, the [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object does not support additional headers.
In case you want to add some headers as part of some authentication mechanism, you can use the `transportOptions` attribute.
Please note that in this case the headers won't be sent in the WebSocket upgrade request.
```js
// WILL NOT WORK in the browser
const socket = new Socket('http://localhost', {
extraHeaders: {
'X-Custom-Header-For-My-Project': 'will not be sent'
}
});
// WILL NOT WORK
const socket = new Socket('http://localhost', {
transports: ['websocket'], // polling is disabled
transportOptions: {
polling: {
extraHeaders: {
'X-Custom-Header-For-My-Project': 'will not be sent'
}
}
}
});
// WILL WORK
const socket = new Socket('http://localhost', {
transports: ['polling', 'websocket'],
transportOptions: {
polling: {
extraHeaders: {
'X-Custom-Header-For-My-Project': 'will be used'
}
}
}
});
```
## Features
- Lightweight
- Runs on browser and node.js seamlessly
- Transports are independent of `Engine`
- Easy to debug
- Easy to unit test
- Runs inside HTML5 WebWorker
- Can send and receive binary data
- Receives as ArrayBuffer or Blob when in browser, and Buffer or ArrayBuffer
in Node
- When XHR2 or WebSockets are used, binary is emitted directly. Otherwise
binary is encoded into base64 strings, and decoded when binary types are
supported.
- With browsers that don't support ArrayBuffer, an object { base64: true,
data: dataAsBase64String } is emitted on the `message` event.
## API
### Socket
The client class. Mixes in [Emitter](http://github.com/component/emitter).
Exposed as `eio` in the browser standalone build.
#### Properties
- `protocol` _(Number)_: protocol revision number
- `binaryType` _(String)_ : can be set to 'arraybuffer' or 'blob' in browsers,
and `buffer` or `arraybuffer` in Node. Blob is only used in browser if it's
supported.
#### Events
- `open`
- Fired upon successful connection.
- `message`
- Fired when data is received from the server.
- **Arguments**
- `String` | `ArrayBuffer`: utf-8 encoded data or ArrayBuffer containing
binary data
- `close`
- Fired upon disconnection. In compliance with the WebSocket API spec, this event may be
fired even if the `open` event does not occur (i.e. due to connection error or `close()`).
- `error`
- Fired when an error occurs.
- `flush`
- Fired upon completing a buffer flush
- `drain`
- Fired after `drain` event of transport if writeBuffer is empty
- `upgradeError`
- Fired if an error occurs with a transport we're trying to upgrade to.
- `upgrade`
- Fired upon upgrade success, after the new transport is set
- `ping`
- Fired upon receiving a ping packet.
- `pong`
- Fired upon _flushing_ a pong packet (ie: actual packet write out)
#### Methods
- **constructor**
- Initializes the client
- **Parameters**
- `String` uri
- `Object`: optional, options object
- **Options**
- `agent` (`http.Agent`): `http.Agent` to use, defaults to `false` (NodeJS only)
- `upgrade` (`Boolean`): defaults to true, whether the client should try
to upgrade the transport from long-polling to something better.
- `forceBase64` (`Boolean`): forces base 64 encoding for polling transport even when XHR2 responseType is available and WebSocket even if the used standard supports binary.
- `withCredentials` (`Boolean`): defaults to `false`, whether to include credentials (cookies, authorization headers, TLS client certificates, etc.) with cross-origin XHR polling requests.
- `timestampRequests` (`Boolean`): whether to add the timestamp with each
transport request. Note: polling requests are always stamped unless this
option is explicitly set to `false` (`false`)
- `timestampParam` (`String`): timestamp parameter (`t`)
- `path` (`String`): path to connect to, default is `/engine.io`
- `transports` (`Array`): a list of transports to try (in order).
Defaults to `['polling', 'websocket', 'webtransport']`. `Engine`
always attempts to connect directly with the first one, provided the
feature detection test for it passes.
- `transportOptions` (`Object`): hash of options, indexed by transport name, overriding the common options for the given transport
- `rememberUpgrade` (`Boolean`): defaults to false.
If true and if the previous websocket connection to the server succeeded,
the connection attempt will bypass the normal upgrade process and will initially
try websocket. A connection attempt following a transport error will use the
normal upgrade process. It is recommended you turn this on only when using
SSL/TLS connections, or if you know that your network does not block websockets.
- `pfx` (`String`|`Buffer`): Certificate, Private key and CA certificates to use for SSL. Can be used in Node.js client environment to manually specify certificate information.
- `key` (`String`): Private key to use for SSL. Can be used in Node.js client environment to manually specify certificate information.
- `passphrase` (`String`): A string of passphrase for the private key or pfx. Can be used in Node.js client environment to manually specify certificate information.
- `cert` (`String`): Public x509 certificate to use. Can be used in Node.js client environment to manually specify certificate information.
- `ca` (`String`|`Array`): An authority certificate or array of authority certificates to check the remote host against.. Can be used in Node.js client environment to manually specify certificate information.
- `ciphers` (`String`): A string describing the ciphers to use or exclude. Consult the [cipher format list](http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT) for details on the format. Can be used in Node.js client environment to manually specify certificate information.
- `rejectUnauthorized` (`Boolean`): If true, the server certificate is verified against the list of supplied CAs. An 'error' event is emitted if verification fails. Verification happens at the connection level, before the HTTP request is sent. Can be used in Node.js client environment to manually specify certificate information.
- `perMessageDeflate` (`Object|Boolean`): parameters of the WebSocket permessage-deflate extension
(see [ws module](https://github.com/einaros/ws) api docs). Set to `false` to disable. (`true`)
- `threshold` (`Number`): data is compressed only if the byte size is above this value. This option is ignored on the browser. (`1024`)
- `extraHeaders` (`Object`): Headers that will be passed for each request to the server (via xhr-polling and via websockets). These values then can be used during handshake or for special proxies. Can only be used in Node.js client environment.
- `localAddress` (`String`): the local IP address to connect to
- `autoUnref` (`Boolean`): whether the transport should be `unref`'d upon creation. This calls `unref` on the underlying timers and sockets so that the program is allowed to exit if they are the only timers/sockets in the event system (Node.js only)
- `useNativeTimers` (`Boolean`): Whether to always use the native timeouts. This allows the client to reconnect when the native timeout functions are overridden, such as when mock clocks are installed with [`@sinonjs/fake-timers`](https://github.com/sinonjs/fake-timers).
- **Polling-only options**
- `requestTimeout` (`Number`): Timeout for xhr-polling requests in milliseconds (`0`)
- **Websocket-only options**
- `protocols` (`Array`): a list of subprotocols (see [MDN reference](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#Subprotocols))
- `closeOnBeforeunload` (`Boolean`): whether to silently close the connection when the [`beforeunload`](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event) event is emitted in the browser (defaults to `false`)
- `send`
- Sends a message to the server
- **Parameters**
- `String` | `ArrayBuffer` | `ArrayBufferView` | `Blob`: data to send
- `Object`: optional, options object
- `Function`: optional, callback upon `drain`
- **Options**
- `compress` (`Boolean`): whether to compress sending data. This option is ignored and forced to be `true` on the browser. (`true`)
- `close`
- Disconnects the client.
### Transport
The transport class. Private. _Inherits from EventEmitter_.
#### Events
- `poll`: emitted by polling transports upon starting a new request
- `pollComplete`: emitted by polling transports upon completing a request
- `drain`: emitted by polling transports upon a buffer drain
## Tests
`engine.io-client` is used to test
[engine](http://github.com/socketio/engine.io). Running the `engine.io`
test suite ensures the client works and vice-versa.
Browser tests are run using [zuul](https://github.com/defunctzombie/zuul). You can
run the tests locally using the following command.
```
./node_modules/.bin/zuul --local 8080 -- test/index.js
```
Additionally, `engine.io-client` has a standalone test suite you can run
with `make test` which will run node.js and browser tests. You must have zuul setup with
a saucelabs account.
## Support
The support channels for `engine.io-client` are the same as `socket.io`:
- irc.freenode.net **#socket.io**
- [Google Groups](http://groups.google.com/group/socket_io)
- [Website](http://socket.io)
## Development
To contribute patches, run tests or benchmarks, make sure to clone the
repository:
```bash
git clone git://github.com/socketio/engine.io-client.git
```
Then:
```bash
cd engine.io-client
npm install
```
See the `Tests` section above for how to run tests before submitting any patches.
<a href="https://github.com/socketio/socket.io/graphs/contributors"><img src="https://opencollective.com/socketio/contributors.svg?width=890" /></a>
## License
MIT - Copyright (c) 2014 Automattic, Inc.
[MIT](https://opensource.org/licenses/MIT)

View File

@@ -1,13 +1,21 @@
# Security Policy
<!-- TOC -->
* [Supported Versions](#supported-versions)
* [Reporting a Vulnerability](#reporting-a-vulnerability)
* [History](#history)
* [For the `socket.io` package](#for-the-socketio-package)
* [For the `socket.io-client` package](#for-the-socketio-client-package)
<!-- TOC -->
## Supported Versions
| Version | `socket.io-client` version | Supported |
|---------|----------------------------|--------------------|
| 6.x | 4.x | :white_check_mark: |
| 4.x | 3.x | :white_check_mark: |
| 3.5.x | 2.4.x | :white_check_mark: |
| < 3.5.0 | < 2.4.0 | :x: |
| Version | Supported |
|---------|--------------------|
| 4.x | :white_check_mark: |
| 3.x | :white_check_mark: |
| 2.4.x | :white_check_mark: |
| < 2.4.0 | :x: |
## Reporting a Vulnerability
@@ -19,4 +27,43 @@ We will get back to you as soon as possible and publish a fix if necessary.
## History
- Mar 2016: [Insecure Defaults Allow MITM Over TLS in engine.io-client](https://github.com/advisories/GHSA-4r4m-hjwj-43p8) (CVE-2016-10536)
### For the `socket.io` package
| Date | Description | CVE number | Affected versions | Patched versions |
|--------------|------------------------------------------------------------------------------|------------------|-------------------------------------|-----------------------|
| July 2012 | [Insecure randomness](https://github.com/advisories/GHSA-qv2v-m59f-v5fw) | `CVE-2017-16031` | `<= 0.9.6` | `0.9.7` |
| January 2021 | [CORS misconfiguration](https://github.com/advisories/GHSA-fxwf-4rqh-v8g3) | `CVE-2020-28481` | `< 2.4.0` | `2.4.0` |
| June 2024 | [Unhandled 'error' event](https://github.com/advisories/GHSA-25hc-qcg6-38wj) | `CVE-2024-38355` | `< 2.5.1` <br/> `>= 3.0.0, < 4.6.2` | `2.5.1` <br/> `4.6.2` |
From the transitive dependencies:
| Date | Dependency | Description | CVE number |
|---------------|--------------------|---------------------------------------------------------------------------------------------------------------|------------------|
| January 2016 | `ws` | [Buffer vulnerability](https://github.com/advisories/GHSA-2mhh-w6q8-5hxw) | `CVE-2016-10518` |
| January 2016 | `ws` | [DoS due to excessively large websocket message](https://github.com/advisories/GHSA-6663-c963-2gqg) | `CVE-2016-10542` |
| November 2017 | `ws` | [DoS in the `Sec-Websocket-Extensions` header parser](https://github.com/advisories/GHSA-5v72-xg48-5rpm) | `-` |
| February 2020 | `engine.io` | [Resource exhaustion](https://github.com/advisories/GHSA-j4f2-536g-r55m) | `CVE-2020-36048` |
| January 2021 | `socket.io-parser` | [Resource exhaustion](https://github.com/advisories/GHSA-xfhh-g9f5-x4m4) | `CVE-2020-36049` |
| May 2021 | `ws` | [ReDoS in `Sec-Websocket-Protocol` header](https://github.com/advisories/GHSA-6fc8-4gx4-v693) | `CVE-2021-32640` |
| January 2022 | `engine.io` | [Uncaught exception](https://github.com/advisories/GHSA-273r-mgr4-v34f) | `CVE-2022-21676` |
| October 2022 | `socket.io-parser` | [Insufficient validation when decoding a Socket.IO packet](https://github.com/advisories/GHSA-qm95-pgcg-qqfq) | `CVE-2022-2421` |
| November 2022 | `engine.io` | [Uncaught exception](https://github.com/advisories/GHSA-r7qp-cfhv-p84w) | `CVE-2022-41940` |
| May 2023 | `engine.io` | [Uncaught exception](https://github.com/advisories/GHSA-q9mw-68c2-j6m5) | `CVE-2023-31125` |
| May 2023 | `socket.io-parser` | [Insufficient validation when decoding a Socket.IO packet](https://github.com/advisories/GHSA-cqmj-92xf-r6r9) | `CVE-2023-32695` |
| June 2024 | `ws` | [DoS when handling a request with many HTTP headers](https://github.com/advisories/GHSA-3h5v-q93c-6h6q) | `CVE-2024-37890` |
### For the `socket.io-client` package
From the transitive dependencies:
| Date | Dependency | Description | CVE number |
|---------------|--------------------|---------------------------------------------------------------------------------------------------------------|------------------|
| January 2016 | `ws` | [Buffer vulnerability](https://github.com/advisories/GHSA-2mhh-w6q8-5hxw) | `CVE-2016-10518` |
| January 2016 | `ws` | [DoS due to excessively large websocket message](https://github.com/advisories/GHSA-6663-c963-2gqg) | `CVE-2016-10542` |
| October 2016 | `engine.io-client` | [Insecure Defaults Allow MITM Over TLS](https://github.com/advisories/GHSA-4r4m-hjwj-43p8) | `CVE-2016-10536` |
| November 2017 | `ws` | [DoS in the `Sec-Websocket-Extensions` header parser](https://github.com/advisories/GHSA-5v72-xg48-5rpm) | `-` |
| January 2021 | `socket.io-parser` | [Resource exhaustion](https://github.com/advisories/GHSA-xfhh-g9f5-x4m4) | `CVE-2020-36049` |
| May 2021 | `ws` | [ReDoS in `Sec-Websocket-Protocol` header](https://github.com/advisories/GHSA-6fc8-4gx4-v693) | `CVE-2021-32640` |
| October 2022 | `socket.io-parser` | [Insufficient validation when decoding a Socket.IO packet](https://github.com/advisories/GHSA-qm95-pgcg-qqfq) | `CVE-2022-2421` |
| May 2023 | `socket.io-parser` | [Insufficient validation when decoding a Socket.IO packet](https://github.com/advisories/GHSA-cqmj-92xf-r6r9) | `CVE-2023-32695` |
| June 2024 | `ws` | [DoS when handling a request with many HTTP headers](https://github.com/advisories/GHSA-3h5v-q93c-6h6q) | `CVE-2024-37890` |

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
docs/README.md Normal file
View File

@@ -0,0 +1,2 @@
The documentation has been moved to the website [here](https://socket.io/docs/).

View File

@@ -0,0 +1 @@
node_modules

View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Test suite for the Engine.IO protocol</title>
<link rel="stylesheet" href="https://unpkg.com/mocha@9/mocha.css" />
</head>
<body>
<div id="mocha"></div>
<script src="https://unpkg.com/mocha@9/mocha.js"></script>
<script src="https://unpkg.com/chai@4/chai.js" ></script>
<script src="https://unpkg.com/chai-string@1/chai-string.js" ></script>
<script class="mocha-init">
mocha.setup("bdd");
mocha.checkLeaks();
</script>
<script type="module" src="test-suite.js"></script>
<script class="mocha-exec">
mocha.run();
</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
import fetch from "node-fetch";
import { WebSocket } from "ws";
import chai from "chai";
import chaiString from "chai-string";
chai.use(chaiString);
globalThis.fetch = fetch;
globalThis.WebSocket = WebSocket;
globalThis.chai = chai;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,18 @@
{
"name": "engine.io-protocol-test-suite",
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"format": "prettier -w *.js",
"test": "mocha test-suite.js"
},
"devDependencies": {
"chai": "^4.3.6",
"chai-string": "^1.5.0",
"mocha": "^9.2.1",
"node-fetch": "^3.2.0",
"prettier": "^2.5.1",
"ws": "^8.5.0"
}
}

View File

@@ -0,0 +1,595 @@
const isNodejs = typeof window === "undefined";
if (isNodejs) {
// make the tests runnable in both the browser and Node.js
await import("./node-imports.js");
}
const { expect } = chai;
const URL = "http://localhost:3000";
const WS_URL = URL.replace("http", "ws");
const PING_INTERVAL = 300;
const PING_TIMEOUT = 200;
function sleep(delay) {
return new Promise((resolve) => setTimeout(resolve, delay));
}
function waitFor(socket, eventType) {
return new Promise((resolve) => {
socket.addEventListener(
eventType,
(event) => {
resolve(event);
},
{ once: true }
);
});
}
function decodePayload(payload) {
const firstColonIndex = payload.indexOf(":");
const length = payload.substring(0, firstColonIndex);
const packet = payload.substring(firstColonIndex + 1);
return [length, packet];
}
async function initLongPollingSession(supportsBinary = false) {
const response = await fetch(`${URL}/engine.io/?EIO=3&transport=polling` + (supportsBinary ? "" : "&b64=1"));
const text = await response.text();
const [, content] = decodePayload(text);
return JSON.parse(content.substring(1)).sid;
}
describe("Engine.IO protocol", () => {
describe("handshake", () => {
describe("HTTP long-polling", () => {
it("successfully opens a session", async () => {
const response = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling`
);
expect(response.status).to.eql(200);
const text = await response.text();
const [length, content] = decodePayload(text);
expect(length).to.eql(content.length.toString());
expect(content).to.startsWith("0");
const value = JSON.parse(content.substring(1));
expect(value.sid).to.be.a("string");
expect(value.upgrades).to.eql(["websocket"]);
expect(value.pingInterval).to.eql(PING_INTERVAL);
expect(value.pingTimeout).to.eql(PING_TIMEOUT);
expect(value.maxPayload).to.be.oneOf([undefined, 1000000]);
});
it("fails with an invalid 'transport' query parameter", async () => {
const response = await fetch(`${URL}/engine.io/?EIO=3`);
expect(response.status).to.eql(400);
const response2 = await fetch(`${URL}/engine.io/?EIO=3&transport=abc`);
expect(response2.status).to.eql(400);
});
it("fails with an invalid request method", async () => {
const response = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling`,
{
method: "post",
}
);
expect(response.status).to.eql(400);
});
});
describe("WebSocket", () => {
it("successfully opens a session", async () => {
const socket = new WebSocket(
`${WS_URL}/engine.io/?EIO=3&transport=websocket`
);
const { data } = await waitFor(socket, "message");
expect(data).to.startsWith("0");
const value = JSON.parse(data.substring(1));
expect(value.sid).to.be.a("string");
expect(value.upgrades).to.eql([]);
expect(value.pingInterval).to.eql(PING_INTERVAL);
expect(value.pingTimeout).to.eql(PING_TIMEOUT);
expect(value.maxPayload).to.be.oneOf([undefined, 1000000]);
socket.close();
});
it("fails with an invalid 'EIO' query parameter", async () => {
const socket = new WebSocket(
`${WS_URL}/engine.io/?transport=websocket`
);
if (isNodejs) {
socket.on("error", () => {});
}
waitFor(socket, "close");
const socket2 = new WebSocket(
`${WS_URL}/engine.io/?EIO=abc&transport=websocket`
);
if (isNodejs) {
socket2.on("error", () => {});
}
waitFor(socket2, "close");
});
it("fails with an invalid 'transport' query parameter", async () => {
const socket = new WebSocket(`${WS_URL}/engine.io/?EIO=3`);
if (isNodejs) {
socket.on("error", () => {});
}
waitFor(socket, "close");
const socket2 = new WebSocket(
`${WS_URL}/engine.io/?EIO=3&transport=abc`
);
if (isNodejs) {
socket2.on("error", () => {});
}
waitFor(socket2, "close");
});
});
});
describe("message", () => {
describe("HTTP long-polling", () => {
it("sends and receives a payload containing one plain text packet", async () => {
const sid = await initLongPollingSession();
const pushResponse = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`,
{
method: "post",
body: "6:4hello",
}
);
expect(pushResponse.status).to.eql(200);
const postContent = await pushResponse.text();
expect(postContent).to.eql("ok");
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(200);
const pollContent = await pollResponse.text();
expect(pollContent).to.eql("6:4hello");
});
it("sends and receives a payload containing several plain text packets", async () => {
const sid = await initLongPollingSession();
const pushResponse = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`,
{
method: "post",
body: "6:4test16:4test26:4test3",
}
);
expect(pushResponse.status).to.eql(200);
const postContent = await pushResponse.text();
expect(postContent).to.eql("ok");
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(200);
const pollContent = await pollResponse.text();
expect(pollContent).to.eql("6:4test16:4test26:4test3");
});
it("sends and receives a payload containing plain text and binary packets (base64 encoded)", async () => {
const sid = await initLongPollingSession();
const pushResponse = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`,
{
method: "post",
body: "6:4hello10:b4AQIDBA==",
}
);
expect(pushResponse.status).to.eql(200);
const postContent = await pushResponse.text();
expect(postContent).to.eql("ok");
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(200);
const pollContent = await pollResponse.text();
expect(pollContent).to.eql("6:4hello10:b4AQIDBA==");
});
it("sends and receives a payload containing plain text and binary packets (binary)", async () => {
const sid = await initLongPollingSession(true);
const pushResponse = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`,
{
method: "post",
body: "6:4hello10:b4AQIDBA==",
}
);
expect(pushResponse.status).to.eql(200);
const postContent = await pushResponse.text();
expect(postContent).to.eql("ok");
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(200);
const buffer = await pollResponse.arrayBuffer();
// 0 => string
// 6 => byte length
// 255 => delimiter
// 52 => 4 (MESSAGE packet type)
// 104 101 108 108 111 => "hello"
// 1 => binary
// 5 => byte length
// 255 => delimiter
// 4 => 4 (MESSAGE packet type)
// 1 2 3 4 => binary message
expect(buffer).to.eql(Uint8Array.from([0, 6, 255, 52, 104, 101, 108, 108, 111, 1, 5, 255, 4, 1, 2, 3, 4]).buffer);
});
it("closes the session upon invalid packet format", async () => {
const sid = await initLongPollingSession();
try {
const pushResponse = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`,
{
method: "post",
body: "abc",
}
);
expect(pushResponse.status).to.eql(400);
} catch (e) {
// node-fetch throws when the request is closed abnormally
}
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(400);
});
// FIXME CORS error
it.skip("closes the session upon duplicate poll requests", async () => {
const sid = await initLongPollingSession();
const pollResponses = await Promise.all([
fetch(`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`),
sleep(5).then(() => fetch(`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}&t=burst`)),
]);
expect(pollResponses[0].status).to.eql(200);
const content = await pollResponses[0].text();
expect(content).to.eql("1:1");
// the Node.js implementation uses HTTP 500 (Internal Server Error), but HTTP 400 seems more suitable
expect(pollResponses[1].status).to.be.oneOf([400, 500]);
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(500);
});
});
describe("WebSocket", () => {
it("sends and receives a plain text packet", async () => {
const socket = new WebSocket(
`${WS_URL}/engine.io/?EIO=3&transport=websocket`
);
await waitFor(socket, "open");
await waitFor(socket, "message"); // handshake
socket.send("4hello");
const { data } = await waitFor(socket, "message");
expect(data).to.eql("4hello");
socket.close();
});
it("sends and receives a binary packet", async () => {
const socket = new WebSocket(
`${WS_URL}/engine.io/?EIO=3&transport=websocket`
);
socket.binaryType = "arraybuffer";
await waitFor(socket, "message"); // handshake
socket.send(Uint8Array.from([4, 1, 2, 3, 4]));
const { data } = await waitFor(socket, "message");
expect(data).to.eql(Uint8Array.from([4, 1, 2, 3, 4]).buffer);
socket.close();
});
it("closes the session upon invalid packet format", async () => {
const socket = new WebSocket(
`${WS_URL}/engine.io/?EIO=3&transport=websocket`
);
await waitFor(socket, "message"); // handshake
socket.send("abc");
await waitFor(socket, "close");
socket.close();
});
});
});
describe("heartbeat", function () {
this.timeout(5000);
describe("HTTP long-polling", () => {
it("sends ping/pong packets", async () => {
const sid = await initLongPollingSession();
for (let i = 0; i < 3; i++) {
const pushResponse = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`,
{
method: "post",
body: "1:2",
}
);
expect(pushResponse.status).to.eql(200);
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(200);
const pollContent = await pollResponse.text();
expect(pollContent).to.eql("1:3");
}
});
it("closes the session upon ping timeout", async () => {
const sid = await initLongPollingSession();
await sleep(PING_INTERVAL + PING_TIMEOUT);
const pushResponse = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`,
{
method: "post",
body: "1:2",
}
);
expect(pushResponse.status).to.eql(400);
});
});
describe("WebSocket", () => {
it("sends ping/pong packets", async () => {
const socket = new WebSocket(
`${WS_URL}/engine.io/?EIO=3&transport=websocket`
);
const x = await waitFor(socket, "message"); // handshake
for (let i = 0; i < 3; i++) {
socket.send("2");
const { data } = await waitFor(socket, "message");
expect(data).to.eql("3");
}
socket.close();
});
it("closes the session upon ping timeout", async () => {
const socket = new WebSocket(
`${WS_URL}/engine.io/?EIO=3&transport=websocket`
);
await waitFor(socket, "close"); // handshake
});
});
});
describe("close", () => {
describe("HTTP long-polling", () => {
it("forcefully closes the session", async () => {
const sid = await initLongPollingSession();
const [pollResponse] = await Promise.all([
fetch(`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`),
fetch(`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`, {
method: "post",
body: "1:1",
}),
]);
expect(pollResponse.status).to.eql(200);
const pullContent = await pollResponse.text();
expect(pullContent).to.eql("1:6");
const pollResponse2 = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`
);
expect(pollResponse2.status).to.eql(400);
});
});
describe("WebSocket", () => {
it("forcefully closes the session", async () => {
const socket = new WebSocket(
`${WS_URL}/engine.io/?EIO=3&transport=websocket`
);
await waitFor(socket, "message"); // handshake
socket.send("1");
await waitFor(socket, "close");
});
});
});
describe("upgrade", () => {
it("successfully upgrades from HTTP long-polling to WebSocket", async () => {
const sid = await initLongPollingSession();
const socket = new WebSocket(
`${WS_URL}/engine.io/?EIO=3&transport=websocket&sid=${sid}`
);
await waitFor(socket, "open");
// send probe
socket.send("2probe");
const probeResponse = await waitFor(socket, "message");
expect(probeResponse.data).to.eql("3probe");
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(200);
const pollContent = await pollResponse.text();
expect(pollContent).to.eql("1:6"); // "noop" packet to cleanly end the HTTP long-polling request
// complete upgrade
socket.send("5");
socket.send("4hello");
const { data } = await waitFor(socket, "message");
expect(data).to.eql("4hello");
});
it("ignores HTTP requests with same sid after upgrade", async () => {
const sid = await initLongPollingSession();
const socket = new WebSocket(
`${WS_URL}/engine.io/?EIO=3&transport=websocket&sid=${sid}`
);
await waitFor(socket, "open");
socket.send("2probe");
const res = await waitFor(socket, "message");
expect(res.data).to.eql("3probe");
socket.send("5");
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=3&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(400);
socket.send("4hello");
const { data } = await waitFor(socket, "message");
expect(data).to.eql("4hello");
});
it("ignores WebSocket connection with same sid after upgrade", async () => {
const sid = await initLongPollingSession();
const socket = new WebSocket(
`${WS_URL}/engine.io/?EIO=3&transport=websocket&sid=${sid}`
);
await waitFor(socket, "open");
socket.send("2probe");
const res = await waitFor(socket, "message");
expect(res.data).to.eql("3probe");
socket.send("5");
const socket2 = new WebSocket(
`${WS_URL}/engine.io/?EIO=3&transport=websocket&sid=${sid}`
);
await waitFor(socket2, "close");
socket.send("4hello");
const { data } = await waitFor(socket, "message");
expect(data).to.eql("4hello");
});
});
});

View File

@@ -0,0 +1,545 @@
# Engine.IO Protocol
This document describes the Engine.IO protocol. For a reference JavaScript
implementation, take a look at
[engine.io-parser](https://github.com/learnboost/engine.io-parser),
[engine.io-client](https://github.com/learnboost/engine.io-client)
and [engine.io](https://github.com/learnboost/engine.io).
Table of Contents:
- [Revision](#revision)
- [Anatomy of an Engine.IO session](#anatomy-of-an-engineio-session)
- [Sample session](#sample-session)
- [Sample session with WebSocket only](#sample-session-with-websocket-only)
- [URLs](#urls)
- [Encoding](#encoding)
- [Packet](#packet)
- [0 open](#0-open)
- [1 close](#1-close)
- [2 ping](#2-ping)
- [3 pong](#3-pong)
- [4 message](#4-message)
- [5 upgrade](#5-upgrade)
- [6 noop](#6-noop)
- [Payload](#payload)
- [Transports](#transports)
- [Polling](#polling)
- [XHR](#xhr)
- [JSONP](#jsonp)
- [WebSocket](#websocket)
- [Transport upgrading](#transport-upgrading)
- [Timeouts](#timeouts)
- [Difference between v2 and v3](#difference-between-v2-and-v3)
- [Test suite](#test-suite)
## Revision
This is revision **3** of the Engine.IO protocol.
The revision 2 can be found here: https://github.com/socketio/engine.io-protocol/tree/v2
## Anatomy of an Engine.IO session
1. Transport establishes a connection to the Engine.IO URL .
2. Server responds with an `open` packet with JSON-encoded handshake data:
- `sid` session id (`String`)
- `upgrades` possible transport upgrades (`Array` of `String`)
- `pingTimeout` server configured ping timeout, used for the client
to detect that the server is unresponsive (`Number`)
- `pingInterval` server configured ping interval, used for the client
to detect that the server is unresponsive (`Number`)
3. Server must respond to periodic `ping` packets sent by the client
with `pong` packets.
4. Client and server can exchange `message` packets at will.
5. Polling transports can send a `close` packet to close the socket, since
they're expected to be "opening" and "closing" all the time.
### Sample session
- Request n°1 (open packet)
```
GET /engine.io/?EIO=3&transport=polling&t=N8hyd6w
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=UTF-8
96:0{"sid":"lv_VI97HAXpY6yYWAAAC","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":5000}
```
Details:
```
96 => number of characters (not bytes)
: => separator
0 => "open" packet type
{"sid":... => the handshake data
```
Note: the `t` query param is used to ensure that the request is not cached by the browser.
- Request n°2 (message in):
`socket.send('hey')` is executed on the server:
```
GET /engine.io/?EIO=3&transport=polling&t=N8hyd7H&sid=lv_VI97HAXpY6yYWAAAC
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=UTF-8
4:4hey
```
Details:
```
4 => number of characters
: => separator
4 => "message" packet type
hey => the actual message
```
- Request n°3 (message out)
`socket.send('hello'); socket.send('world');` is executed on the client:
```
POST /engine.io/?EIO=3&transport=polling&t=N8hzxke&sid=lv_VI97HAXpY6yYWAAAC
> Content-Type: text/plain; charset=UTF-8
6:4hello6:4world
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=UTF-8
ok
```
Details:
```
6 => number of characters of the 1st packet
: => separator
4 => "message" packet type
hello => the 1st message
6 => number of characters of the 2nd packet
: => separator
4 => "message" message type
world => the 2nd message
```
- Request n°4 (WebSocket upgrade)
```
GET /engine.io/?EIO=3&transport=websocket&sid=lv_VI97HAXpY6yYWAAAC
< HTTP/1.1 101 Switching Protocols
```
WebSocket frames:
```
< 2probe => probe request
> 3probe => probe response
> 5 => "upgrade" packet type
> 4hello => message (not concatenated)
> 4world
> 2 => "ping" packet type
< 3 => "pong" packet type
> 1 => "close" packet type
```
### Sample session with WebSocket only
In that case, the client only enables WebSocket (without HTTP polling).
```
GET /engine.io/?EIO=3&transport=websocket
< HTTP/1.1 101 Switching Protocols
```
WebSocket frames:
```
< 0{"sid":"lv_VI97HAXpY6yYWAAAC","pingInterval":25000,"pingTimeout":5000} => handshake
< 4hey
> 4hello => message (not concatenated)
> 4world
< 2 => "ping" packet type
> 3 => "pong" packet type
> 1 => "close" packet type
```
## URLs
An Engine.IO url is composed as follows:
```
/engine.io/[?<query string>]
```
- The `engine.io` pathname should only be changed by higher-level
frameworks whose protocol sits on top of engine's.
- The query string is optional and has six reserved keys:
- `transport`: indicates the transport name. Supported ones by default are
`polling`, `websocket`.
- `j`: if the transport is `polling` but a JSONP response is required, `j`
must be set with the JSONP response index.
- `sid`: if the client has been given a session id, it must be included
in the querystring.
- `b64`: if the client doesn't support XHR2, `b64=1` is sent in the query string
to signal the server that all binary data should be sent base64 encoded.
- `EIO`: the version of the protocol
- `t`: a hashed-timestamp used for cache-busting
*FAQ:* Is the `/engine.io` portion modifiable?
Provided the server is customized to intercept requests under a different
path segment, yes.
*FAQ:* What determines whether an option is going to be part of the path
versus being encoded as part of the query string? In other words, why
is the `transport` not part of the URL?
It's convention that the path segments remain *only* that which allows to
disambiguate whether a request should be handled by a given Engine.IO
server instance or not. As it stands, it's only the Engine.IO prefix
(`/engine.io`) and the resource (`default` by default).
## Encoding
There's two distinct types of encodings
- packet
- payload
### Packet
An encoded packet can be UTF-8 string or binary data. The packet encoding format for a string is as follows
```
<packet type id>[<data>]
```
example:
```
2probe
```
For binary data the encoding is identical. When sending binary data, the packet
type id is sent in the first byte of the binary contents, followed by the
actual packet data. Example:
```
4|0|1|2|3|4|5
```
In the above example each byte is separated by a pipe character and shown as an
integer. So the above packet is of type message (see below), and contains
binary data that corresponds to an array of integers with values 0, 1, 2, 3, 4
and 5.
The packet type id is an integer. The following are the accepted packet
types.
#### 0 open
Sent from the server when a new transport is opened (recheck)
#### 1 close
Request the close of this transport but does not shutdown the connection itself.
#### 2 ping
Sent by the client. Server should answer with a pong packet containing the same data
example
1. client sends: ```2probe```
2. server sends: ```3probe```
#### 3 pong
Sent by the server to respond to ping packets.
#### 4 message
actual message, client and server should call their callbacks with the data.
##### example 1
1. server sends: ```4HelloWorld```
2. client receives and calls callback ```socket.on('message', function (data) { console.log(data); });```
##### example 2
1. client sends: ```4HelloWorld```
2. server receives and calls callback ```socket.on('message', function (data) { console.log(data); });```
#### 5 upgrade
Before engine.io switches a transport, it tests, if server and client can communicate over this transport.
If this test succeed, the client sends an upgrade packets which requests the server to flush its cache on
the old transport and switch to the new transport.
#### 6 noop
A noop packet. Used primarily to force a poll cycle when an incoming websocket connection is received.
##### example
1. client connects through new transport
2. client sends ```2probe```
3. server receives and sends ```3probe```
4. client receives and sends ```5```
5. server flushes and closes old transport and switches to new.
### Payload
A payload is a series of encoded packets tied together. The payload encoding format is as follows when only strings are sent and XHR2 is not supported:
```
<length1>:<packet1>[<length2>:<packet2>[...]]
```
* length: length of the packet in __characters__
* packet: actual packets as descriped above
When XHR2 is not supported, the same encoding principle is used also when
binary data is sent, but it is sent as base64 encoded strings. For the purposes of decoding, an identifier `b` is
put before a packet encoding that contains binary data. A combination of any
number of strings and base64 encoded strings can be sent. Here is an example of
base 64 encoded messages:
```
<length of base64 representation of the data + 1 (for packet type)>:b<packet1 type><packet1 data in b64>[...]
```
When XHR2 is supported, a similar principle is used, but everything is encoded
directly into binary, so that it can be sent as binary over XHR. The format is
the following:
```
<0 for string data, 1 for binary data><Any number of numbers between 0 and 9><The number 255><packet1 (first type,
then data)>[...]
```
If a combination of UTF-8 strings and binary data is sent, the string values
are represented so that each character is written as a character code into a
byte.
The payload is used for transports which do not support framing, as the polling protocol for example.
- Example without binary:
```
[
{
"type": "message",
"data": "hello"
},
{
"type": "message",
"data": "€"
}
]
```
is encoded to:
```
6:4hello2:4€
```
Please note that we are not counting bytes, but characters, hence 2 (1 + 1) instead of 4 (1 + 3).
- Example with binary (both the client and the transport support binary):
```
[
{
"type": "message",
"data": "€"
},
{
"type": "message",
"data": buffer <01 02 03 04>
}
]
```
is encoded to:
```
buffer <00 04 ff 34 e2 82 ac 01 04 ff 01 02 03 04>
with:
00 => string header
04 => string length in bytes
ff => separator
34 => "message" packet type ("4")
e2 82 ac => "€"
01 => binary header
04 => buffer length in bytes
ff => separator
01 02 03 04 => buffer content
```
- Example with binary (either the client or the transport does not support binary):
```
[
{
"type": "message",
"data": "€"
},
{
"type": "message",
"data": buffer <01 02 03 04>
}
]
```
is encoded to:
```
2:4€10:b4AQIDBA==
with
2 => number of characters of the 1st packet
: => separator
4 => "message" packet type
10 => number of characters of the 2nd packet
: => separator
b => indicates a base64 packet
4 => "message" packet type
AQIDBA== => buffer content encoded in base64
```
## Transports
An engine.io server must support three transports:
- websocket
- polling
- jsonp
- xhr
### Polling
The polling transport consists of recurring GET requests by the client
to the server to get data, and POST requests with payloads from the
client to the server to send data.
#### XHR
The server must support CORS responses.
#### JSONP
The server implementation must respond with valid JavaScript. The URL
contains a query string parameter `j` that must be used in the response.
`j` is an integer.
The format of a JSONP packet.
```
`___eio[` <j> `]("` <encoded payload> `");`
```
To ensure that the payload gets processed correctly, it must be escaped
in such a way that the response is still valid JavaScript. Passing the
encoded payload through a JSON encoder is a good way to escape it.
Example JSONP frame returned by the server:
```
___eio[4]("packet data");
```
##### Posting data
The client posts data through a hidden iframe. The data gets to the server
in the URI encoded format as follows:
```
d=<escaped packet payload>
```
In addition to the regular qs escaping, in order to prevent
inconsistencies with `\n` handling by browsers, `\n` gets escaped as `\\n`
prior to being POSTd.
### WebSocket
Encoding payloads _should not_ be used for WebSocket, as the protocol
already has a lightweight framing mechanism.
In order to send a payload of messages, encode packets individually
and `send()` them in succession.
## Transport upgrading
A connection always starts with polling (either XHR or JSONP). WebSocket
gets tested on the side by sending a probe. If the probe is responded
from the server, an upgrade packet is sent.
To ensure no messages are lost, the upgrade packet will only be sent
once all the buffers of the existing transport are flushed and the
transport is considered _paused_.
When the server receives the upgrade packet, it must assume this is the
new transport channel and send all existing buffers (if any) to it.
The probe sent by the client is a `ping` packet with `probe` sent as data.
The probe sent by the server is a `pong` packet with `probe` sent as data.
Moving forward, upgrades other than just `polling -> x` are being considered.
## Timeouts
The client must use the `pingTimeout` and the `pingInterval` sent as part
of the handshake (with the `open` packet) to determine whether the server
is unresponsive.
The client sends a `ping` packet. If no packet type is received within
`pingTimeout`, the client considers the socket disconnected. If a `pong`
packet is actually received, the client will wait `pingInterval` before
sending a `ping` packet again.
Since the two values are shared between the server and the client, the server
will also be able to detect whether the client becomes unresponsive when it
does not receive any data within `pingTimeout + pingInterval`.
## Difference between v2 and v3
- add support for binary data
v2 is included in Socket.IO v0.9, while v3 is included in Socket.IO v1/v2.
## Test suite
The test suite in the `test-suite/` directory lets you check the compliance of a server implementation.
Usage:
- in Node.js: `npm ci && npm test`
- in a browser: simply open the `index.html` file in your browser
For reference, here is expected configuration for the JavaScript server to pass all tests:
```js
import { listen } from "engine.io";
const server = listen(3000, {
pingInterval: 300,
pingTimeout: 200,
allowEIO3: true,
maxPayload: 1e6,
cors: {
origin: "*"
}
});
server.on("connection", socket => {
socket.on("data", (...args) => {
socket.send(...args);
});
});
```

View File

@@ -0,0 +1,422 @@
# Engine.IO Protocol
This document describes the 4th version of the Engine.IO protocol.
**Table of content**
- [Introduction](#introduction)
- [Transports](#transports)
- [HTTP long-polling](#http-long-polling)
- [Request path](#request-path)
- [Query parameters](#query-parameters)
- [Headers](#headers)
- [Sending and receiving data](#sending-and-receiving-data)
- [Sending data](#sending-data)
- [Receiving data](#receiving-data)
- [WebSocket](#websocket)
- [Protocol](#protocol)
- [Handshake](#handshake)
- [Heartbeat](#heartbeat)
- [Upgrade](#upgrade)
- [Message](#message)
- [Packet encoding](#packet-encoding)
- [HTTP long-polling](#http-long-polling-1)
- [WebSocket](#websocket-1)
- [History](#history)
- [From v2 to v3](#from-v2-to-v3)
- [From v3 to v4](#from-v3-to-v4)
- [Test suite](#test-suite)
## Introduction
The Engine.IO protocol enables [full-duplex](https://en.wikipedia.org/wiki/Duplex_(telecommunications)#FULL-DUPLEX) and low-overhead communication between a client and a server.
It is based on the [WebSocket protocol](https://en.wikipedia.org/wiki/WebSocket) and uses [HTTP long-polling](https://en.wikipedia.org/wiki/Push_technology#Long_polling) as fallback if the WebSocket connection can't be established.
The reference implementation is written in [TypeScript](https://www.typescriptlang.org/):
- server: https://github.com/socketio/engine.io
- client: https://github.com/socketio/engine.io-client
The [Socket.IO protocol](https://github.com/socketio/socket.io-protocol) is built on top of these foundations, bringing additional features over the communication channel provided by the Engine.IO protocol.
## Transports
The connection between an Engine.IO client and an Engine.IO server can be established with:
- [HTTP long-polling](#http-long-polling)
- [WebSocket](#websocket)
### HTTP long-polling
The HTTP long-polling transport (also simply referred as "polling") consists of successive HTTP requests:
- long-running `GET` requests, for receiving data from the server
- short-running `POST` requests, for sending data to the server
#### Request path
The path of the HTTP requests is `/engine.io/` by default.
It might be updated by libraries built on top of the protocol (for example, the Socket.IO protocol uses `/socket.io/`).
#### Query parameters
The following query parameters are used:
| Name | Value | Description |
|-------------|-----------|--------------------------------------------------------------------|
| `EIO` | `4` | Mandatory, the version of the protocol. |
| `transport` | `polling` | Mandatory, the name of the transport. |
| `sid` | `<sid>` | Mandatory once the session is established, the session identifier. |
If a mandatory query parameter is missing, then the server MUST respond with an HTTP 400 error status.
#### Headers
When sending binary data, the sender (client or server) MUST include a `Content-Type: application/octet-stream` header.
Without an explicit `Content-Type` header, the receiver SHOULD infer that the data is plaintext.
Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type
#### Sending and receiving data
##### Sending data
To send some packets, a client MUST create an HTTP `POST` request with the packets encoded in the request body:
```
CLIENT SERVER
│ │
│ POST /engine.io/?EIO=4&transport=polling&sid=... │
│ ───────────────────────────────────────────────────► │
│ ◄──────────────────────────────────────────────────┘ │
│ HTTP 200 │
│ │
```
The server MUST return an HTTP 400 response if the session ID (from the `sid` query parameter) is not known.
To indicate success, the server MUST return an HTTP 200 response, with the string `ok` in the response body.
To ensure packet ordering, a client MUST NOT have more than one active `POST` request. Should it happen, the server MUST return an HTTP 400 error status and close the session.
##### Receiving data
To receive some packets, a client MUST create an HTTP `GET` request:
```
CLIENT SERVER
│ GET /engine.io/?EIO=4&transport=polling&sid=... │
│ ──────────────────────────────────────────────────► │
│ . │
│ . │
│ . │
│ . │
│ ◄─────────────────────────────────────────────────┘ │
│ HTTP 200 │
```
The server MUST return an HTTP 400 response if the session ID (from the `sid` query parameter) is not known.
The server MAY not respond right away if there are no packets buffered for the given session. Once there are some packets to be sent, the server SHOULD encode them (see [Packet encoding](#packet-encoding)) and send them in the response body of the HTTP request.
To ensure packet ordering, a client MUST NOT have more than one active `GET` request. Should it happen, the server MUST return an HTTP 400 error status and close the session.
### WebSocket
The WebSocket transport consists of a [WebSocket connection](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API), which provides a bidirectional and low-latency communication channel between the server and the client.
The following query parameters are used:
| Name | Value | Description |
|-------------|-------------|-------------------------------------------------------------------------------|
| `EIO` | `4` | Mandatory, the version of the protocol. |
| `transport` | `websocket` | Mandatory, the name of the transport. |
| `sid` | `<sid>` | Optional, depending on whether it's an upgrade from HTTP long-polling or not. |
If a mandatory query parameter is missing, then the server MUST close the WebSocket connection.
Each packet (read or write) is sent its own [WebSocket frame](https://datatracker.ietf.org/doc/html/rfc6455#section-5).
A client MUST NOT open more than one WebSocket connection per session. Should it happen, the server MUST close the WebSocket connection.
## Protocol
An Engine.IO packet consists of:
- a packet type
- an optional packet payload
Here is the list of available packet types:
| Type | ID | Usage |
|---------|-----|--------------------------------------------------|
| open | 0 | Used during the [handshake](#handshake). |
| close | 1 | Used to indicate that a transport can be closed. |
| ping | 2 | Used in the [heartbeat mechanism](#heartbeat). |
| pong | 3 | Used in the [heartbeat mechanism](#heartbeat). |
| message | 4 | Used to send a payload to the other side. |
| upgrade | 5 | Used during the [upgrade process](#upgrade). |
| noop | 6 | Used during the [upgrade process](#upgrade). |
### Handshake
To establish a connection, the client MUST send an HTTP `GET` request to the server:
- HTTP long-polling first (by default)
```
CLIENT SERVER
│ │
│ GET /engine.io/?EIO=4&transport=polling │
│ ───────────────────────────────────────────────────────► │
│ ◄──────────────────────────────────────────────────────┘ │
│ HTTP 200 │
│ │
```
- WebSocket-only session
```
CLIENT SERVER
│ │
│ GET /engine.io/?EIO=4&transport=websocket │
│ ───────────────────────────────────────────────────────► │
│ ◄──────────────────────────────────────────────────────┘ │
│ HTTP 101 │
│ │
```
If the server accepts the connection, then it MUST respond with an `open` packet with the following JSON-encoded payload:
| Key | Type | Description |
|----------------|------------|-------------------------------------------------------------------------------------------------------------------|
| `sid` | `string` | The session ID. |
| `upgrades` | `string[]` | The list of available [transport upgrades](#upgrade). |
| `pingInterval` | `number` | The ping interval, used in the [heartbeat mechanism](#heartbeat) (in milliseconds). |
| `pingTimeout` | `number` | The ping timeout, used in the [heartbeat mechanism](#heartbeat) (in milliseconds). |
| `maxPayload` | `number` | The maximum number of bytes per chunk, used by the client to aggregate packets into [payloads](#packet-encoding). |
Example:
```json
{
"sid": "lv_VI97HAXpY6yYWAAAC",
"upgrades": ["websocket"],
"pingInterval": 25000,
"pingTimeout": 20000,
"maxPayload": 1000000
}
```
The client MUST send the `sid` value in the query parameters of all subsequent requests.
### Heartbeat
Once the [handshake](#handshake) is completed, a heartbeat mechanism is started to check the liveness of the connection:
```
CLIENT SERVER
│ *** Handshake *** │
│ │
│ ◄───────────────────────────────────────────────── │
│ 2 │ (ping packet)
│ ─────────────────────────────────────────────────► │
│ 3 │ (pong packet)
```
At a given interval (the `pingInterval` value sent in the handshake) the server sends a `ping` packet and the client has a few seconds (the `pingTimeout` value) to send a `pong` packet back.
If the server does not receive a `pong` packet back, then it SHOULD consider that the connection is closed.
Conversely, if the client does not receive a `ping` packet within `pingInterval + pingTimeout`, then it SHOULD consider that the connection is closed.
### Upgrade
By default, the client SHOULD create an HTTP long-polling connection, and then upgrade to better transports if available.
To upgrade to WebSocket, the client MUST:
- pause the HTTP long-polling transport (no more HTTP request gets sent), to ensure that no packet gets lost
- open a WebSocket connection with the same session ID
- send a `ping` packet with the string `probe` in the payload
The server MUST:
- send a `noop` packet to any pending `GET` request (if applicable) to cleanly close HTTP long-polling transport
- respond with a `pong` packet with the string `probe` in the payload
Finally, the client MUST send a `upgrade` packet to complete the upgrade:
```
CLIENT SERVER
│ │
│ GET /engine.io/?EIO=4&transport=websocket&sid=... │
│ ───────────────────────────────────────────────────► │
│ ◄─────────────────────────────────────────────────┘ │
│ HTTP 101 (WebSocket handshake) │
│ │
│ ----- WebSocket frames ----- │
│ ─────────────────────────────────────────────────► │
│ 2probe │ (ping packet)
│ ◄───────────────────────────────────────────────── │
│ 3probe │ (pong packet)
│ ─────────────────────────────────────────────────► │
│ 5 │ (upgrade packet)
│ │
```
### Message
Once the [handshake](#handshake) is completed, the client and the server can exchange data by including it in a `message` packet.
## Packet encoding
The serialization of an Engine.IO packet depends on the type of the payload (plaintext or binary) and on the transport.
The character encoding is UTF-8 for plain text and for base64-encoded binary payloads.
### HTTP long-polling
Due to the nature of the HTTP long-polling transport, multiple packets might be concatenated in a single payload in order to increase throughput.
Format:
```
<packet type>[<data>]<separator><packet type>[<data>]<separator><packet type>[<data>][...]
```
Example:
```
4hello\x1e2\x1e4world
with:
4 => message packet type
hello => message payload
\x1e => separator
2 => ping packet type
\x1e => separator
4 => message packet type
world => message payload
```
The packets are separated by the [record separator character](https://en.wikipedia.org/wiki/C0_and_C1_control_codes#Field_separators): `\x1e`
Binary payloads MUST be base64-encoded and prefixed with a `b` character:
Example:
```
4hello\x1ebAQIDBA==
with:
4 => message packet type
hello => message payload
\x1e => separator
b => binary prefix
AQIDBA== => buffer <01 02 03 04> encoded as base64
```
The client SHOULD use the `maxPayload` value sent during the [handshake](#handshake) to decide how many packets should be concatenated.
### WebSocket
Each Engine.IO packet is sent in its own [WebSocket frame](https://datatracker.ietf.org/doc/html/rfc6455#section-5).
Format:
```
<packet type>[<data>]
```
Example:
```
4hello
with:
4 => message packet type
hello => message payload (UTF-8 encoded)
```
Binary payloads are sent as is, without modification.
## History
### From v2 to v3
- add support for binary data
The [2nd version](https://github.com/socketio/engine.io-protocol/tree/v2) of the protocol is used in Socket.IO `v0.9` and below.
The [3rd version](https://github.com/socketio/engine.io-protocol/tree/v3) of the protocol is used in Socket.IO `v1` and `v2`.
### From v3 to v4
- reverse ping/pong mechanism
The ping packets are now sent by the server, because the timers set in the browsers are not reliable enough. We
suspect that a lot of timeout problems came from timers being delayed on the client-side.
- always use base64 when encoding a payload with binary data
This change allows to treat all payloads (with or without binary) the same way, without having to take in account
whether the client or the current transport supports binary data or not.
Please note that this only applies to HTTP long-polling. Binary data is sent in WebSocket frames with no additional transformation.
- use a record separator (`\x1e`) instead of counting of characters
Counting characters prevented (or at least makes harder) to implement the protocol in other languages, which may not use
the UTF-16 encoding.
For example, `€` was encoded to `2:4€`, though `Buffer.byteLength('€') === 3`.
Note: this assumes the record separator is not used in the data.
The 4th version (current) is included in Socket.IO `v3` and above.
## Test suite
The test suite in the `test-suite/` directory lets you check the compliance of a server implementation.
Usage:
- in Node.js: `npm ci && npm test`
- in a browser: simply open the `index.html` file in your browser
For reference, here is expected configuration for the JavaScript server to pass all tests:
```js
import { listen } from "engine.io";
const server = listen(3000, {
pingInterval: 300,
pingTimeout: 200,
maxPayload: 1e6,
cors: {
origin: "*"
}
});
server.on("connection", socket => {
socket.on("data", (...args) => {
socket.send(...args);
});
});
```

View File

@@ -0,0 +1 @@
node_modules

View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Test suite for the Engine.IO protocol</title>
<link rel="stylesheet" href="https://unpkg.com/mocha@9/mocha.css" />
</head>
<body>
<div id="mocha"></div>
<script src="https://unpkg.com/mocha@9/mocha.js"></script>
<script src="https://unpkg.com/chai@4/chai.js" ></script>
<script src="https://unpkg.com/chai-string@1/chai-string.js" ></script>
<script class="mocha-init">
mocha.setup("bdd");
mocha.checkLeaks();
</script>
<script type="module" src="test-suite.js"></script>
<script class="mocha-exec">
mocha.run();
</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
import fetch from "node-fetch";
import { WebSocket } from "ws";
import chai from "chai";
import chaiString from "chai-string";
chai.use(chaiString);
globalThis.fetch = fetch;
globalThis.WebSocket = WebSocket;
globalThis.chai = chai;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,18 @@
{
"name": "engine.io-protocol-test-suite",
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"format": "prettier -w *.js",
"test": "mocha test-suite.js"
},
"devDependencies": {
"chai": "^4.3.6",
"chai-string": "^1.5.0",
"mocha": "^9.2.1",
"node-fetch": "^3.2.0",
"prettier": "^2.5.1",
"ws": "^8.5.0"
}
}

View File

@@ -0,0 +1,609 @@
const isNodejs = typeof window === "undefined";
if (isNodejs) {
// make the tests runnable in both the browser and Node.js
await import("./node-imports.js");
}
const { expect } = chai;
const URL = "http://localhost:3000";
const WS_URL = URL.replace("http", "ws");
const PING_INTERVAL = 300;
const PING_TIMEOUT = 200;
function sleep(delay) {
return new Promise((resolve) => setTimeout(resolve, delay));
}
function createWebSocket(url) {
const socket = new WebSocket(url);
socket._eventBuffer = {};
socket._pendingPromises = {};
for (const eventType of ["open", "close", "message"]) {
socket._eventBuffer[eventType] = [];
socket._pendingPromises[eventType] = [];
socket.addEventListener(eventType, (event) => {
if (socket._pendingPromises[eventType].length) {
socket._pendingPromises[eventType].shift()(event);
} else {
socket._eventBuffer[eventType].push(event);
}
});
}
return socket;
}
function waitFor(socket, eventType) {
if (socket._eventBuffer[eventType].length) {
return Promise.resolve(socket._eventBuffer[eventType].shift());
} else {
return new Promise((resolve) => {
socket._pendingPromises[eventType].push(resolve);
});
}
}
async function initLongPollingSession() {
const response = await fetch(`${URL}/engine.io/?EIO=4&transport=polling`);
const content = await response.text();
return JSON.parse(content.substring(1)).sid;
}
describe("Engine.IO protocol", () => {
describe("handshake", () => {
describe("HTTP long-polling", () => {
it("successfully opens a session", async () => {
const response = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling`
);
expect(response.status).to.eql(200);
const content = await response.text();
expect(content).to.startsWith("0");
const value = JSON.parse(content.substring(1));
expect(value).to.have.all.keys(
"sid",
"upgrades",
"pingInterval",
"pingTimeout",
"maxPayload"
);
expect(value.sid).to.be.a("string");
expect(value.upgrades).to.eql(["websocket"]);
expect(value.pingInterval).to.eql(PING_INTERVAL);
expect(value.pingTimeout).to.eql(PING_TIMEOUT);
expect(value.maxPayload).to.eql(1000000);
});
it("fails with an invalid 'EIO' query parameter", async () => {
const response = await fetch(`${URL}/engine.io/?transport=polling`);
expect(response.status).to.eql(400);
const response2 = await fetch(
`${URL}/engine.io/?EIO=abc&transport=polling`
);
expect(response2.status).to.eql(400);
});
it("fails with an invalid 'transport' query parameter", async () => {
const response = await fetch(`${URL}/engine.io/?EIO=4`);
expect(response.status).to.eql(400);
const response2 = await fetch(`${URL}/engine.io/?EIO=4&transport=abc`);
expect(response2.status).to.eql(400);
});
it("fails with an invalid request method", async () => {
const response = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling`,
{
method: "post",
}
);
expect(response.status).to.eql(400);
const response2 = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling`,
{
method: "put",
}
);
expect(response2.status).to.eql(400);
});
});
describe("WebSocket", () => {
it("successfully opens a session", async () => {
const socket = createWebSocket(
`${WS_URL}/engine.io/?EIO=4&transport=websocket`
);
const { data } = await waitFor(socket, "message");
expect(data).to.startsWith("0");
const value = JSON.parse(data.substring(1));
expect(value).to.have.all.keys(
"sid",
"upgrades",
"pingInterval",
"pingTimeout",
"maxPayload"
);
expect(value.sid).to.be.a("string");
expect(value.upgrades).to.eql([]);
expect(value.pingInterval).to.eql(PING_INTERVAL);
expect(value.pingTimeout).to.eql(PING_TIMEOUT);
expect(value.maxPayload).to.eql(1000000);
socket.close();
});
it("fails with an invalid 'EIO' query parameter", async () => {
const socket = createWebSocket(
`${WS_URL}/engine.io/?transport=websocket`
);
if (isNodejs) {
socket.on("error", () => {});
}
await waitFor(socket, "close");
const socket2 = createWebSocket(
`${WS_URL}/engine.io/?EIO=abc&transport=websocket`
);
if (isNodejs) {
socket2.on("error", () => {});
}
await waitFor(socket2, "close");
});
it("fails with an invalid 'transport' query parameter", async () => {
const socket = createWebSocket(`${WS_URL}/engine.io/?EIO=4`);
if (isNodejs) {
socket.on("error", () => {});
}
await waitFor(socket, "close");
const socket2 = createWebSocket(
`${WS_URL}/engine.io/?EIO=4&transport=abc`
);
if (isNodejs) {
socket2.on("error", () => {});
}
await waitFor(socket2, "close");
});
});
});
describe("message", () => {
describe("HTTP long-polling", () => {
it("sends and receives a payload containing one plain text packet", async () => {
const sid = await initLongPollingSession();
const pushResponse = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`,
{
method: "post",
body: "4hello",
}
);
expect(pushResponse.status).to.eql(200);
const postContent = await pushResponse.text();
expect(postContent).to.eql("ok");
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(200);
const pollContent = await pollResponse.text();
expect(pollContent).to.eql("4hello");
});
it("sends and receives a payload containing several plain text packets", async () => {
const sid = await initLongPollingSession();
const pushResponse = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`,
{
method: "post",
body: "4test1\x1e4test2\x1e4test3",
}
);
expect(pushResponse.status).to.eql(200);
const postContent = await pushResponse.text();
expect(postContent).to.eql("ok");
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(200);
const pollContent = await pollResponse.text();
expect(pollContent).to.eql("4test1\x1e4test2\x1e4test3");
});
it("sends and receives a payload containing plain text and binary packets", async () => {
const sid = await initLongPollingSession();
const pushResponse = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`,
{
method: "post",
body: "4hello\x1ebAQIDBA==",
}
);
expect(pushResponse.status).to.eql(200);
const postContent = await pushResponse.text();
expect(postContent).to.eql("ok");
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(200);
const pollContent = await pollResponse.text();
expect(pollContent).to.eql("4hello\x1ebAQIDBA==");
});
it("closes the session upon invalid packet format", async () => {
const sid = await initLongPollingSession();
try {
const pushResponse = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`,
{
method: "post",
body: "abc",
}
);
expect(pushResponse.status).to.eql(400);
} catch (e) {
// node-fetch throws when the request is closed abnormally
}
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(400);
});
it("closes the session upon duplicate poll requests", async () => {
const sid = await initLongPollingSession();
const pollResponses = await Promise.all([
fetch(`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`),
sleep(5).then(() => fetch(`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}&t=burst`)),
]);
expect(pollResponses[0].status).to.eql(200);
const content = await pollResponses[0].text();
expect(content).to.eql("1");
// the Node.js implementation uses HTTP 500 (Internal Server Error), but HTTP 400 seems more suitable
expect(pollResponses[1].status).to.be.oneOf([400, 500]);
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(400);
});
it("closes the session upon cancelled polling request", async () => {
const sid = await initLongPollingSession();
const controller = new AbortController();
fetch(`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`, {
signal: controller.signal,
}).catch(() => {});
await sleep(5);
controller.abort();
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`,
);
expect(pollResponse.status).to.eql(400);
});
});
describe("WebSocket", () => {
it("sends and receives a plain text packet", async () => {
const socket = createWebSocket(
`${WS_URL}/engine.io/?EIO=4&transport=websocket`
);
await waitFor(socket, "open");
await waitFor(socket, "message"); // handshake
socket.send("4hello");
const { data } = await waitFor(socket, "message");
expect(data).to.eql("4hello");
socket.close();
});
it("sends and receives a binary packet", async () => {
const socket = createWebSocket(
`${WS_URL}/engine.io/?EIO=4&transport=websocket`
);
socket.binaryType = "arraybuffer";
await waitFor(socket, "message"); // handshake
socket.send(Uint8Array.from([1, 2, 3, 4]));
const { data } = await waitFor(socket, "message");
expect(data).to.eql(Uint8Array.from([1, 2, 3, 4]).buffer);
socket.close();
});
it("closes the session upon invalid packet format", async () => {
const socket = createWebSocket(
`${WS_URL}/engine.io/?EIO=4&transport=websocket`
);
await waitFor(socket, "message"); // handshake
socket.send("abc");
await waitFor(socket, "close");
socket.close();
});
});
});
describe("heartbeat", function () {
this.timeout(5000);
describe("HTTP long-polling", () => {
it("sends ping/pong packets", async () => {
const sid = await initLongPollingSession();
for (let i = 0; i < 3; i++) {
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(200);
const pollContent = await pollResponse.text();
expect(pollContent).to.eql("2");
const pushResponse = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`,
{
method: "post",
body: "3",
}
);
expect(pushResponse.status).to.eql(200);
}
});
it("closes the session upon ping timeout", async () => {
const sid = await initLongPollingSession();
await sleep(PING_INTERVAL + PING_TIMEOUT);
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(400);
});
});
describe("WebSocket", () => {
it("sends ping/pong packets", async () => {
const socket = createWebSocket(
`${WS_URL}/engine.io/?EIO=4&transport=websocket`
);
await waitFor(socket, "message"); // handshake
for (let i = 0; i < 3; i++) {
const { data } = await waitFor(socket, "message");
expect(data).to.eql("2");
socket.send("3");
}
socket.close();
});
it("closes the session upon ping timeout", async () => {
const socket = createWebSocket(
`${WS_URL}/engine.io/?EIO=4&transport=websocket`
);
await waitFor(socket, "close"); // handshake
});
});
});
describe("close", () => {
describe("HTTP long-polling", () => {
it("forcefully closes the session", async () => {
const sid = await initLongPollingSession();
const [pollResponse] = await Promise.all([
fetch(`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`),
fetch(`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`, {
method: "post",
body: "1",
}),
]);
expect(pollResponse.status).to.eql(200);
const pullContent = await pollResponse.text();
expect(pullContent).to.eql("6");
const pollResponse2 = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`
);
expect(pollResponse2.status).to.eql(400);
});
});
describe("WebSocket", () => {
it("forcefully closes the session", async () => {
const socket = createWebSocket(
`${WS_URL}/engine.io/?EIO=4&transport=websocket`
);
await waitFor(socket, "message"); // handshake
socket.send("1");
await waitFor(socket, "close");
});
});
});
describe("upgrade", () => {
it("successfully upgrades from HTTP long-polling to WebSocket", async () => {
const sid = await initLongPollingSession();
const socket = createWebSocket(
`${WS_URL}/engine.io/?EIO=4&transport=websocket&sid=${sid}`
);
await waitFor(socket, "open");
// send probe
socket.send("2probe");
const probeResponse = await waitFor(socket, "message");
expect(probeResponse.data).to.eql("3probe");
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(200);
const pollContent = await pollResponse.text();
expect(pollContent).to.eql("6"); // "noop" packet to cleanly end the HTTP long-polling request
// complete upgrade
socket.send("5");
socket.send("4hello");
const { data } = await waitFor(socket, "message");
expect(data).to.eql("4hello");
});
it("ignores HTTP requests with same sid after upgrade", async () => {
const sid = await initLongPollingSession();
const socket = createWebSocket(
`${WS_URL}/engine.io/?EIO=4&transport=websocket&sid=${sid}`
);
await waitFor(socket, "open");
socket.send("2probe");
await waitFor(socket, "message"); // "3probe"
socket.send("5");
const pollResponse = await fetch(
`${URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(400);
socket.send("4hello");
const { data } = await waitFor(socket, "message");
expect(data).to.eql("4hello");
});
it("ignores WebSocket connection with same sid after upgrade", async () => {
const sid = await initLongPollingSession();
const socket = createWebSocket(
`${WS_URL}/engine.io/?EIO=4&transport=websocket&sid=${sid}`
);
await waitFor(socket, "open");
socket.send("2probe");
await waitFor(socket, "message"); // "3probe"
socket.send("5");
const socket2 = createWebSocket(
`${WS_URL}/engine.io/?EIO=4&transport=websocket&sid=${sid}`
);
await waitFor(socket2, "close");
socket.send("4hello");
const { data } = await waitFor(socket, "message");
expect(data).to.eql("4hello");
});
});
});

View File

@@ -0,0 +1,411 @@
# socket.io-protocol
This document describes the Socket.IO protocol. For a reference JavaScript
implementation, take a look at
[socket.io-parser](https://github.com/socketio/socket.io-parser),
[socket.io-client](https://github.com/socketio/socket.io-client)
and [socket.io](https://github.com/socketio/socket.io).
## Table of Contents
- [Protocol version](#protocol-version)
- [Packet format](#packet-format)
- [Packet types](#packet-types)
- [CONNECT](#0---connect)
- [DISCONNECT](#1---disconnect)
- [EVENT](#2---event)
- [ACK](#3---ack)
- [ERROR](#4---error)
- [BINARY_EVENT](#5---binary_event)
- [Packet encoding](#packet-encoding)
- [Encoding format](#encoding-format)
- [Examples](#examples)
- [Exchange protocol](#exchange-protocol)
- [Connection to the default namespace](#connection-to-the-default-namespace)
- [Connection to a non-default namespace](#connection-to-a-non-default-namespace)
- [Disconnection from a non-default namespace](#disconnection-from-a-non-default-namespace)
- [Acknowledgement](#acknowledgement)
- [History](#history)
- [Difference between v3 and v2](#difference-between-v3-and-v2)
- [Difference between v2 and v1](#difference-between-v2-and-v1)
- [Initial revision](#initial-revision)
## Protocol version
This is the revision **3** of the Socket.IO protocol, included in ̀`socket.io@1.0.0...1.0.2`.
The 4th revision (included in ̀`socket.io@1.0.3...latest`) can be found here: https://github.com/socketio/socket.io-protocol/tree/master
Both the 1st and the 2nd revisions were part of the work towards Socket.IO 1.0 but were never included in a Socket.IO
release.
It is built on top of the [3rd](https://github.com/socketio/engine.io-protocol/tree/v3) revision of the Engine.IO
protocol.
While the Engine.IO protocol describes the low-level plumbing with WebSocket and HTTP long-polling, the Socket.IO
protocol adds another layer above in order to provide the following features:
- multiplexing (what we call [Namespace](https://socket.io/docs/namespaces/))
Example of the Javascript API:
```js
// server-side
const nsp = io.of("/admin");
nsp.on("connect", socket => {});
// client-side
const socket1 = io(); // default namespace
const socket2 = io("/admin");
socket2.on("connect", () => {});
```
- acknowledgement of packets
Example of the Javascript API:
```js
// on one side
socket.emit("hello", 1, () => { console.log("received"); });
// on the other side
socket.on("hello", (a, cb) => { cb(); });
```
## Packet format
A packet contains the following fields:
- a type (integer, see [below](#packet-types))
- a namespace (string)
- optionally, a payload (string | Array)
- optionally, an acknowledgment id (integer)
## Packet types
### 0 - CONNECT
This event is sent:
- by the client when requesting access to a namespace
- by the server when accepting the connection to a namespace
It does not contain any payload nor acknowledgement id.
Example:
```json
{
"type": 0,
"nsp": "/admin"
}
```
The client may include additional information (i.e. for authentication purpose) in the namespace field. Example:
```json
{
"type": 0,
"nsp": "/admin?token=1234&uid=abcd"
}
```
#### 1 - DISCONNECT
This event is used when one side wants to disconnect from a namespace.
It does not contain any payload nor acknowledgement id.
Example:
```json
{
"type": 1,
"nsp": "/admin"
}
```
#### 2 - EVENT
This event is used when one side wants to transmit some data (without binary) to the other side.
It does contain a payload, and an optional acknowledgement id.
Example:
```json
{
"type": 2,
"nsp": "/",
"data": ["hello", 1]
}
```
With an acknowledgment id:
```json
{
"type": 2,
"nsp": "/admin",
"data": ["project:delete", 123],
"id": 456
}
```
#### 3 - ACK
This event is used when one side has received an EVENT or a BINARY_EVENT with an acknowledgement id.
It contains the acknowledgement id received in the previous packet, and may contain a payload (without binary).
```json
{
"type": 3,
"nsp": "/admin",
"data": [],
"id": 456
}
```
#### 4 - ERROR
This event is sent by the server when the connection to a namespace is refused.
It may contain a payload indicating the reason of the refusal.
Example:
```json
{
"type": 4,
"nsp": "/admin",
"data": "Not authorized"
}
```
#### 5 - BINARY_EVENT
This event is used when one side wants to transmit some data (including binary) to the other side.
It does contain a payload, and an optional acknowledgement id.
Example:
```
{
"type": 5,
"nsp": "/",
"data": ["hello", <Buffer 01 02 03>]
}
```
With an acknowledgment id:
```
{
"type": 5,
"nsp": "/admin",
"data": ["project:delete", <Buffer 01 02 03>],
"id": 456
}
```
## Packet encoding
This section details the encoding used by the default parser which is included in Socket.IO server and client, and
whose source can be found [here](https://github.com/socketio/socket.io-parser).
The JS server and client implementations also supports custom parsers, which have different tradeoffs and may benefit to
certain kind of applications. Please see [socket.io-json-parser](https://github.com/darrachequesne/socket.io-json-parser)
or [socket.io-msgpack-parser](https://github.com/darrachequesne/socket.io-msgpack-parser) for example.
Please also note that each Socket.IO packet is sent as a Engine.IO `message` packet (more information [here](https://github.com/socketio/engine.io-protocol)),
so the encoded result will be prefixed by `4` when sent over the wire (in the request/response body with HTTP
long-polling, or in the WebSocket frame).
### Encoding format
```
<packet type>[<# of binary attachments>-][<namespace>,][<acknowledgment id>][JSON-stringified payload without binary]
+ binary attachments extracted
```
Note:
- the namespace is only included if it is different from the default namespace (`/`)
### Examples
- `CONNECT` packet for the default namespace
```json
{
"type": 0,
"nsp": "/"
}
```
is encoded to `0`
- `CONNECT` packet for the `/admin` namespace
```json
{
"type": 0,
"nsp": "/admin"
}
```
is encoded to `0/admin`
- `DISCONNECT` packet for the `/admin` namespace
```json
{
"type": 1,
"nsp": "/admin"
}
```
is encoded to `1/admin`
- `EVENT` packet
```json
{
"type": 2,
"nsp": "/",
"data": ["hello", 1]
}
```
is encoded to `2["hello",1]`
- `EVENT` packet with an acknowledgement id
```json
{
"type": 2,
"nsp": "/admin",
"data": ["project:delete", 123],
"id": 456
}
```
is encoded to `2/admin,456["project:delete",123]`
- `ACK` packet
```json
{
"type": 3,
"nsp": "/admin",
"data": [],
"id": 456
}
```
is encoded to `3/admin,456[]`
- `ERROR` packet
```json
{
"type": 4,
"nsp": "/admin",
"data": "Not authorized"
}
```
is encoded to `4/admin,"Not authorized"`
- `BINARY_EVENT` packet
```
{
"type": 5,
"nsp": "/",
"data": ["hello", <Buffer 01 02 03>]
}
```
is encoded to `51-["hello",{"_placeholder":true,"num":0}]` + `<Buffer 01 02 03>`
- `BINARY_EVENT` packet with an acknowledgement id
```
{
"type": 5,
"nsp": "/admin",
"data": ["project:delete", <Buffer 01 02 03>],
"id": 456
}
```
is encoded to `51-/admin,456["project:delete",{"_placeholder":true,"num":0}]` + `<Buffer 01 02 03>`
## Exchange protocol
### Connection to the default namespace
The server always send a `CONNECT` packet for the default namespace (`/`) when the connection is established.
That is, even if the client requests access to a non-default namespace, it will receive a `CONNECT` packet for the
default namespace first.
```
Server > { type: CONNECT, nsp: "/" }
```
No response is expected from the client.
### Connection to a non-default namespace
```
Client > { type: CONNECT, nsp: "/admin" }
Server > { type: CONNECT, nsp: "/admin" } (if the connection is successful)
or
Server > { type: ERROR, nsp: "/admin", data: "Not authorized" }
```
### Disconnection from a non-default namespace
```
Client > { type: DISCONNECT, nsp: "/admin" }
```
And vice versa. No response is expected from the other-side.
### Acknowledgement
```
Client > { type: EVENT, nsp: "/admin", data: ["hello"], id: 456 }
Server > { type: ACK, nsp: "/admin", data: [], id: 456 }
```
And vice versa.
## History
### Difference between v3 and v2
- remove the usage of msgpack to encode packets containing binary objects (see also [299849b](https://github.com/socketio/socket.io-parser/commit/299849b00294c3bc95817572441f3aca8ffb1f65))
### Difference between v2 and v1
- add a BINARY_EVENT packet type
This was added during the work towards Socket.IO 1.0, in order to add support for binary objects. The BINARY_EVENT
packets were encoded with [msgpack](https://msgpack.org/).
### Initial revision
This first revision was the result of the split between the Engine.IO protocol (low-level plumbing with WebSocket / HTTP
long-polling, heartbeat) and the Socket.IO protocol. It was never included in a Socket.IO release, but paved the way for
the next iterations.
## License
MIT

View File

@@ -0,0 +1,556 @@
# socket.io-protocol
This document describes the Socket.IO protocol. For a reference JavaScript
implementation, take a look at
[socket.io-parser](https://github.com/socketio/socket.io-parser),
[socket.io-client](https://github.com/socketio/socket.io-client)
and [socket.io](https://github.com/socketio/socket.io).
## Table of Contents
- [Protocol version](#protocol-version)
- [Packet format](#packet-format)
- [Packet types](#packet-types)
- [CONNECT](#0---connect)
- [DISCONNECT](#1---disconnect)
- [EVENT](#2---event)
- [ACK](#3---ack)
- [ERROR](#4---error)
- [BINARY_EVENT](#5---binary_event)
- [BINARY_ACK](#6---binary_ack)
- [Packet encoding](#packet-encoding)
- [Encoding format](#encoding-format)
- [Examples](#examples)
- [Exchange protocol](#exchange-protocol)
- [Connection to the default namespace](#connection-to-the-default-namespace)
- [Connection to a non-default namespace](#connection-to-a-non-default-namespace)
- [Disconnection from a non-default namespace](#disconnection-from-a-non-default-namespace)
- [Acknowledgement](#acknowledgement)
- [Sample session](#sample-session)
- [History](#history)
- [Difference between v4 and v3](#difference-between-v4-and-v3)
- [Difference between v3 and v2](#difference-between-v3-and-v2)
- [Difference between v2 and v1](#difference-between-v2-and-v1)
- [Initial revision](#initial-revision)
## Protocol version
This is the revision **4** of the Socket.IO protocol, included in `socket.io@1.0.3...latest`.
The 3rd revision (included in `socket.io@1.0.0...1.0.2`) can be found here: https://github.com/socketio/socket.io-protocol/tree/v3
Both the 1st and the 2nd revisions were part of the work towards Socket.IO 1.0 but were never included in a Socket.IO
release.
It is built on top of the [3rd](https://github.com/socketio/engine.io-protocol/tree/v3) revision of the Engine.IO
protocol.
While the Engine.IO protocol describes the low-level plumbing with WebSocket and HTTP long-polling, the Socket.IO
protocol adds another layer above in order to provide the following features:
- multiplexing (what we call [Namespace](https://socket.io/docs/namespaces/))
Example of the Javascript API:
```js
// server-side
const nsp = io.of("/admin");
nsp.on("connect", socket => {});
// client-side
const socket1 = io(); // default namespace
const socket2 = io("/admin");
socket2.on("connect", () => {});
```
- acknowledgement of packets
Example of the Javascript API:
```js
// on one side
socket.emit("hello", 1, () => { console.log("received"); });
// on the other side
socket.on("hello", (a, cb) => { cb(); });
```
## Packet format
A packet contains the following fields:
- a type (integer, see [below](#packet-types))
- a namespace (string)
- optionally, a payload (string | Array)
- optionally, an acknowledgment id (integer)
## Packet types
### 0 - CONNECT
This event is sent:
- by the client when requesting access to a namespace
- by the server when accepting the connection to a namespace
It does not contain any payload nor acknowledgement id.
Example:
```json
{
"type": 0,
"nsp": "/admin"
}
```
The client may include additional information (i.e. for authentication purpose) in the namespace field. Example:
```json
{
"type": 0,
"nsp": "/admin?token=1234&uid=abcd"
}
```
#### 1 - DISCONNECT
This event is used when one side wants to disconnect from a namespace.
It does not contain any payload nor acknowledgement id.
Example:
```json
{
"type": 1,
"nsp": "/admin"
}
```
#### 2 - EVENT
This event is used when one side wants to transmit some data (without binary) to the other side.
It does contain a payload, and an optional acknowledgement id.
Example:
```json
{
"type": 2,
"nsp": "/",
"data": ["hello", 1]
}
```
With an acknowledgment id:
```json
{
"type": 2,
"nsp": "/admin",
"data": ["project:delete", 123],
"id": 456
}
```
#### 3 - ACK
This event is used when one side has received an EVENT or a BINARY_EVENT with an acknowledgement id.
It contains the acknowledgement id received in the previous packet, and may contain a payload (without binary).
```json
{
"type": 3,
"nsp": "/admin",
"data": [],
"id": 456
}
```
#### 4 - ERROR
This event is sent by the server when the connection to a namespace is refused.
It may contain a payload indicating the reason of the refusal.
Example:
```json
{
"type": 4,
"nsp": "/admin",
"data": "Not authorized"
}
```
#### 5 - BINARY_EVENT
This event is used when one side wants to transmit some data (including binary) to the other side.
It does contain a payload, and an optional acknowledgement id.
Example:
```
{
"type": 5,
"nsp": "/",
"data": ["hello", <Buffer 01 02 03>]
}
```
With an acknowledgment id:
```
{
"type": 5,
"nsp": "/admin",
"data": ["project:delete", <Buffer 01 02 03>],
"id": 456
}
```
#### 6 - BINARY_ACK
This event is used when one side has received an EVENT or a BINARY_EVENT with an acknowledgement id.
It contains the acknowledgement id received in the previous packet, and contain a payload including binary.
Example:
```
{
"type": 6,
"nsp": "/admin",
"data": [<Buffer 03 02 01>],
"id": 456
}
```
## Packet encoding
This section details the encoding used by the default parser which is included in Socket.IO server and client, and
whose source can be found [here](https://github.com/socketio/socket.io-parser).
The JS server and client implementations also supports custom parsers, which have different tradeoffs and may benefit to
certain kind of applications. Please see [socket.io-json-parser](https://github.com/darrachequesne/socket.io-json-parser)
or [socket.io-msgpack-parser](https://github.com/darrachequesne/socket.io-msgpack-parser) for example.
Please also note that each Socket.IO packet is sent as a Engine.IO `message` packet (more information [here](https://github.com/socketio/engine.io-protocol)),
so the encoded result will be prefixed by `4` when sent over the wire (in the request/response body with HTTP
long-polling, or in the WebSocket frame).
### Encoding format
```
<packet type>[<# of binary attachments>-][<namespace>,][<acknowledgment id>][JSON-stringified payload without binary]
+ binary attachments extracted
```
Note:
- the namespace is only included if it is different from the default namespace (`/`)
### Examples
- `CONNECT` packet for the default namespace
```json
{
"type": 0,
"nsp": "/"
}
```
is encoded to `0`
- `CONNECT` packet for the `/admin` namespace
```json
{
"type": 0,
"nsp": "/admin"
}
```
is encoded to `0/admin,`
- `DISCONNECT` packet for the `/admin` namespace
```json
{
"type": 1,
"nsp": "/admin"
}
```
is encoded to `1/admin,`
- `EVENT` packet
```json
{
"type": 2,
"nsp": "/",
"data": ["hello", 1]
}
```
is encoded to `2["hello",1]`
- `EVENT` packet with an acknowledgement id
```json
{
"type": 2,
"nsp": "/admin",
"data": ["project:delete", 123],
"id": 456
}
```
is encoded to `2/admin,456["project:delete",123]`
- `ACK` packet
```json
{
"type": 3,
"nsp": "/admin",
"data": [],
"id": 456
}
```
is encoded to `3/admin,456[]`
- `ERROR` packet
```json
{
"type": 4,
"nsp": "/admin",
"data": "Not authorized"
}
```
is encoded to `4/admin,"Not authorized"`
- `BINARY_EVENT` packet
```
{
"type": 5,
"nsp": "/",
"data": ["hello", <Buffer 01 02 03>]
}
```
is encoded to `51-["hello",{"_placeholder":true,"num":0}]` + `<Buffer 01 02 03>`
- `BINARY_EVENT` packet with an acknowledgement id
```
{
"type": 5,
"nsp": "/admin",
"data": ["project:delete", <Buffer 01 02 03>],
"id": 456
}
```
is encoded to `51-/admin,456["project:delete",{"_placeholder":true,"num":0}]` + `<Buffer 01 02 03>`
- `BINARY_ACK` packet
```
{
"type": 6,
"nsp": "/admin",
"data": [<Buffer 03 02 01>],
"id": 456
}
```
is encoded to `61-/admin,456[{"_placeholder":true,"num":0}]` + `<Buffer 03 02 01>`
## Exchange protocol
### Connection to the default namespace
The server always send a `CONNECT` packet for the default namespace (`/`) when the connection is established.
That is, even if the client requests access to a non-default namespace, it will receive a `CONNECT` packet for the
default namespace first.
```
Server > { type: CONNECT, nsp: "/" }
```
No response is expected from the client.
### Connection to a non-default namespace
```
Client > { type: CONNECT, nsp: "/admin" }
Server > { type: CONNECT, nsp: "/admin" } (if the connection is successful)
or
Server > { type: ERROR, nsp: "/admin", data: "Not authorized" }
```
### Disconnection from a non-default namespace
```
Client > { type: DISCONNECT, nsp: "/admin" }
```
And vice versa. No response is expected from the other-side.
### Acknowledgement
```
Client > { type: EVENT, nsp: "/admin", data: ["hello"], id: 456 }
Server > { type: ACK, nsp: "/admin", data: [], id: 456 }
or
Server > { type: BINARY_ACK, nsp: "/admin", data: [ <Buffer 01 02 03> ], id: 456 }
```
And vice versa.
## Sample session
Here is an example of what is sent over the wire when combining both the Engine.IO and the Socket.IO protocols.
- Request n°1 (open packet)
```
GET /socket.io/?EIO=3&transport=polling&t=N8hyd6w
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=UTF-8
96:0{"sid":"lv_VI97HAXpY6yYWAAAC","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":5000}2:40
```
Details:
```
96 => number of characters (not bytes) of the first message
: => separator
0 => Engine.IO "open" packet type
{"sid":... => the Engine.IO handshake data
2 => number of characters of the 2nd message
: => separator
4 => Engine.IO "message" packet type
0 => Socket.IO "CONNECT" packet type
```
Note: the `t` query param is used to ensure that the request is not cached by the browser.
- Request n°2 (message in):
`socket.emit('hey', 'Jude')` is executed on the server:
```
GET /socket.io/?EIO=3&transport=polling&t=N8hyd7H&sid=lv_VI97HAXpY6yYWAAAC
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=UTF-8
16:42["hey","Jude"]
```
Details:
```
16 => number of characters
: => separator
4 => Engine.IO "message" packet type
2 => Socket.IO "EVENT" packet type
[...] => content
```
- Request n°3 (message out)
`socket.emit('hello'); socket.emit('world');` is executed on the client:
```
POST /socket.io/?EIO=3&transport=polling&t=N8hzxke&sid=lv_VI97HAXpY6yYWAAAC
> Content-Type: text/plain; charset=UTF-8
11:42["hello"]11:42["world"]
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=UTF-8
ok
```
Details:
```
11 => number of characters of the 1st packet
: => separator
4 => Engine.IO "message" packet type
2 => Socket.IO "EVENT" packet type
["hello"] => the 1st content
11 => number of characters of the 2nd packet
: => separator
4 => Engine.IO "message" packet type
2 => Socket.IO "EVENT" packet type
["world"] => the 2nd content
```
- Request n°4 (WebSocket upgrade)
```
GET /socket.io/?EIO=3&transport=websocket&sid=lv_VI97HAXpY6yYWAAAC
< HTTP/1.1 101 Switching Protocols
```
WebSocket frames:
```
< 2probe => Engine.IO probe request
> 3probe => Engine.IO probe response
> 5 => Engine.IO "upgrade" packet type
> 42["hello"]
> 42["world"]
> 40/admin, => request access to the admin namespace (Socket.IO "CONNECT" packet)
< 40/admin, => grant access to the admin namespace
> 42/admin,1["tellme"] => Socket.IO "EVENT" packet with acknowledgement
< 461-/admin,1[{"_placeholder":true,"num":0}] => Socket.IO "BINARY_ACK" packet with a placeholder
< <binary> => the binary attachment (sent in the following frame)
... after a while without message
> 2 => Engine.IO "ping" packet type
< 3 => Engine.IO "pong" packet type
> 1 => Engine.IO "close" packet type
```
## History
### Difference between v4 and v3
- add a `BINARY_ACK` packet type
Previously, an `ACK` packet was always treated as if it may contain binary objects, with recursive search for such
objects, which could hurt performance.
### Difference between v3 and v2
- remove the usage of msgpack to encode packets containing binary objects (see also [299849b](https://github.com/socketio/socket.io-parser/commit/299849b00294c3bc95817572441f3aca8ffb1f65))
### Difference between v2 and v1
- add a `BINARY_EVENT` packet type
This was added during the work towards Socket.IO 1.0, in order to add support for binary objects. The `BINARY_EVENT`
packets were encoded with [msgpack](https://msgpack.org/).
### Initial revision
This first revision was the result of the split between the Engine.IO protocol (low-level plumbing with WebSocket / HTTP
long-polling, heartbeat) and the Socket.IO protocol. It was never included in a Socket.IO release, but paved the way for
the next iterations.
## License
MIT

View File

@@ -0,0 +1,733 @@
# Socket.IO Protocol
This document describes the 5th version of the Socket.IO protocol.
**Table of content**
- [Introduction](#introduction)
- [Exchange protocol](#exchange-protocol)
- [Connection to a namespace](#connection-to-a-namespace)
- [Sending and receiving data](#sending-and-receiving-data)
- [Acknowledgement](#acknowledgement)
- [Disconnection from a namespace](#disconnection-from-a-namespace)
- [Packet encoding](#packet-encoding)
- [Format](#format)
- [Examples](#examples)
- [Connection to a namespace](#connection-to-a-namespace-1)
- [Sending and receiving data](#sending-and-receiving-data-1)
- [Acknowledgement](#acknowledgement-1)
- [Disconnection from a namespace](#disconnection-from-a-namespace-1)
- [Sample session](#sample-session)
- [History](#history)
- [Difference between v5 and v4](#difference-between-v5-and-v4)
- [Difference between v4 and v3](#difference-between-v4-and-v3)
- [Difference between v3 and v2](#difference-between-v3-and-v2)
- [Difference between v2 and v1](#difference-between-v2-and-v1)
- [Initial revision](#initial-revision)
- [Test suite](#test-suite)
## Introduction
The Socket.IO protocol enables [full-duplex](https://en.wikipedia.org/wiki/Duplex_(telecommunications)#FULL-DUPLEX) and low-overhead communication between a client and a server.
It is built on top of [the Engine.IO protocol](https://github.com/socketio/engine.io-protocol), which handles the low-level plumbing with WebSocket and HTTP long-polling.
The Socket.IO protocol adds the following features:
- multiplexing (referred as ["namespace"](https://socket.io/docs/v4/namespaces) in the Socket.IO jargon)
Example with the JavaScript API:
*Server*
```js
// declare the namespace
const namespace = io.of("/admin");
// handle the connection to the namespace
namespace.on("connection", (socket) => {
// ...
});
```
*Client*
```js
// reach the main namespace
const socket1 = io();
// reach the "/admin" namespace (with the same underlying WebSocket connection)
const socket2 = io("/admin");
// handle the connection to the namespace
socket2.on("connect", () => {
// ...
});
```
- acknowledgement of packets
Example with the JavaScript API:
```js
// on one side
socket.emit("hello", "foo", (arg) => {
console.log("received", arg);
});
// on the other side
socket.on("hello", (arg, ack) => {
ack("bar");
});
```
The reference implementation is written in [TypeScript](https://www.typescriptlang.org/):
- server: https://github.com/socketio/socket.io
- client: https://github.com/socketio/socket.io-client
## Exchange protocol
A Socket.IO packet contains the following fields:
- a packet type (integer)
- a namespace (string)
- optionally, a payload (Object | Array)
- optionally, an acknowledgment id (integer)
Here is the list of available packet types:
| Type | ID | Usage |
|---------------|-----|---------------------------------------------------------------------------------------|
| CONNECT | 0 | Used during the [connection to a namespace](#connection-to-a-namespace). |
| DISCONNECT | 1 | Used when [disconnecting from a namespace](#disconnection-from-a-namespace). |
| EVENT | 2 | Used to [send data](#sending-and-receiving-data) to the other side. |
| ACK | 3 | Used to [acknowledge](#acknowledgement) an event. |
| CONNECT_ERROR | 4 | Used during the [connection to a namespace](#connection-to-a-namespace). |
| BINARY_EVENT | 5 | Used to [send binary data](#sending-and-receiving-data) to the other side. |
| BINARY_ACK | 6 | Used to [acknowledge](#acknowledgement) an event (the response includes binary data). |
### Connection to a namespace
At the beginning of a Socket.IO session, the client MUST send a `CONNECT` packet:
The server MUST respond with either:
- a `CONNECT` packet if the connection is successful, with the session ID in the payload
- or a `CONNECT_ERROR` packet if the connection is not allowed
```
CLIENT SERVER
│ ───────────────────────────────────────────────────────► │
│ { type: CONNECT, namespace: "/" } │
│ ◄─────────────────────────────────────────────────────── │
│ { type: CONNECT, namespace: "/", data: { sid: "..." } } │
```
If the server does not receive a `CONNECT` packet first, then it MUST close the connection immediately.
A client MAY be connected to multiple namespaces at the same time, with the same underlying WebSocket connection.
Examples:
- with the main namespace (named `"/"`)
```
Client > { type: CONNECT, namespace: "/" }
Server > { type: CONNECT, namespace: "/", data: { sid: "wZX3oN0bSVIhsaknAAAI" } }
```
- with a custom namespace
```
Client > { type: CONNECT, namespace: "/admin" }
Server > { type: CONNECT, namespace: "/admin", data: { sid: "oSO0OpakMV_3jnilAAAA" } }
```
- with an additional payload
```
Client > { type: CONNECT, namespace: "/admin", data: { "token": "123" } }
Server > { type: CONNECT, namespace: "/admin", data: { sid: "iLnRaVGHY4B75TeVAAAB" } }
```
- in case the connection is refused
```
Client > { type: CONNECT, namespace: "/" }
Server > { type: CONNECT_ERROR, namespace: "/", data: { message: "Not authorized" } }
```
### Sending and receiving data
Once the [connection to a namespace](#connection-to-a-namespace) is established, the client and the server can begin exchanging data:
```
CLIENT SERVER
│ ───────────────────────────────────────────────────────► │
│ { type: EVENT, namespace: "/", data: ["foo"] } │
│ │
│ ◄─────────────────────────────────────────────────────── │
│ { type: EVENT, namespace: "/", data: ["bar"] } │
```
The payload is mandatory and MUST be a non-empty array. If that's not the case, then the receiver MUST close the connection.
Examples:
- with the main namespace
```
Client > { type: EVENT, namespace: "/", data: ["foo"] }
```
- with a custom namespace
```
Server > { type: EVENT, namespace: "/admin", data: ["bar"] }
```
- with binary data
```
Client > { type: BINARY_EVENT, namespace: "/", data: ["baz", <Buffer <01 02 03 04>> ] }
```
### Acknowledgement
The sender MAY include an event ID in order to request an acknowledgement from the receiver:
```
CLIENT SERVER
│ ───────────────────────────────────────────────────────► │
│ { type: EVENT, namespace: "/", data: ["foo"], id: 12 } │
│ ◄─────────────────────────────────────────────────────── │
│ { type: ACK, namespace: "/", data: ["bar"], id: 12 } │
```
The receiver MUST respond with an `ACK` packet with the same event ID.
The payload is mandatory and MUST be an array (possibly empty).
Examples:
- with the main namespace
```
Client > { type: EVENT, namespace: "/", data: ["foo"], id: 12 }
Server > { type: ACK, namespace: "/", data: [], id: 12 }
```
- with a custom namespace
```
Server > { type: EVENT, namespace: "/admin", data: ["foo"], id: 13 }
Client > { type: ACK, namespace: "/admin", data: ["bar"], id: 13 }
```
- with binary data
```
Client > { type: BINARY_EVENT, namespace: "/", data: ["foo", <buffer <01 02 03 04> ], id: 14 }
Server > { type: ACK, namespace: "/", data: ["bar"], id: 14 }
or
Server > { type: EVENT, namespace: "/", data: ["foo" ], id: 15 }
Client > { type: BINARY_ACK, namespace: "/", data: ["bar", <buffer <01 02 03 04>], id: 15 }
```
### Disconnection from a namespace
At any time, one side can end the connection to a namespace by sending a `DISCONNECT` packet:
```
CLIENT SERVER
│ ───────────────────────────────────────────────────────► │
│ { type: DISCONNECT, namespace: "/" } │
```
No response is expected from the other side. The low-level connection MAY be kept alive if the client is connected to another namespace.
## Packet encoding
This section details the encoding used by the default parser which is included in Socket.IO server and client, and
whose source can be found [here](https://github.com/socketio/socket.io-parser).
The JavaScript server and client implementations also supports custom parsers, which have different tradeoffs and may benefit to
certain kind of applications. Please see [socket.io-json-parser](https://github.com/socketio/socket.io-json-parser)
or [socket.io-msgpack-parser](https://github.com/socketio/socket.io-msgpack-parser) for example.
Please also note that each Socket.IO packet is sent as a Engine.IO `message` packet (more information [here](https://github.com/socketio/engine.io-protocol)),
so the encoded result will be prefixed by the character `"4"` when sent over the wire (in the request/response body with HTTP
long-polling, or in the WebSocket frame).
### Format
```
<packet type>[<# of binary attachments>-][<namespace>,][<acknowledgment id>][JSON-stringified payload without binary]
+ binary attachments extracted
```
Note: the namespace is only included if it is different from the main namespace (`/`)
### Examples
#### Connection to a namespace
- with the main namespace
*Packet*
```
{ type: CONNECT, namespace: "/" }
```
*Encoded*
```
0
```
- with a custom namespace
*Packet*
```
{ type: CONNECT, namespace: "/admin", data: { sid: "oSO0OpakMV_3jnilAAAA" } }
```
*Encoded*
```
0/admin,{"sid":"oSO0OpakMV_3jnilAAAA"}
```
- in case the connection is refused
*Packet*
```
{ type: CONNECT_ERROR, namespace: "/", data: { message: "Not authorized" } }
```
*Encoded*
```
4{"message":"Not authorized"}
```
#### Sending and receiving data
- with the main namespace
*Packet*
```
{ type: EVENT, namespace: "/", data: ["foo"] }
```
*Encoded*
```
2["foo"]
```
- with a custom namespace
*Packet*
```
{ type: EVENT, namespace: "/admin", data: ["bar"] }
```
*Encoded*
```
2/admin,["bar"]
```
- with binary data
*Packet*
```
{ type: BINARY_EVENT, namespace: "/", data: ["baz", <Buffer <01 02 03 04>> ] }
```
*Encoded*
```
51-["baz",{"_placeholder":true,"num":0}]
+ <Buffer <01 02 03 04>>
```
- with multiple attachments
*Packet*
```
{ type: BINARY_EVENT, namespace: "/admin", data: ["baz", <Buffer <01 02>>, <Buffer <03 04>> ] }
```
*Encoded*
```
52-/admin,["baz",{"_placeholder":true,"num":0},{"_placeholder":true,"num":1}]
+ <Buffer <01 02>>
+ <Buffer <03 04>>
```
Please remember that each Socket.IO packet is wrapped in a Engine.IO `message` packet, so they will be prefixed by the character `"4"` when sent over the wire.
Example: `{ type: EVENT, namespace: "/", data: ["foo"] }` will be sent as `42["foo"]`
#### Acknowledgement
- with the main namespace
*Packet*
```
{ type: EVENT, namespace: "/", data: ["foo"], id: 12 }
```
*Encoded*
```
212["foo"]
```
- with a custom namespace
*Packet*
```
{ type: ACK, namespace: "/admin", data: ["bar"], id: 13 }
```
*Encoded*
```
3/admin,13["bar"]`
```
- with binary data
*Packet*
```
{ type: BINARY_ACK, namespace: "/", data: ["bar", <Buffer <01 02 03 04>>], id: 15 }
```
*Encoded*
```
61-15["bar",{"_placeholder":true,"num":0}]
+ <Buffer <01 02 03 04>>
```
#### Disconnection from a namespace
- with the main namespace
*Packet*
```
{ type: DISCONNECT, namespace: "/" }
```
*Encoded*
```
1
```
- with a custom namespace
```
{ type: DISCONNECT, namespace: "/admin" }
```
*Encoded*
```
1/admin,
```
## Sample session
Here is an example of what is sent over the wire when combining both the Engine.IO and the Socket.IO protocols.
- Request n°1 (open packet)
```
GET /socket.io/?EIO=4&transport=polling&t=N8hyd6w
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=UTF-8
0{"sid":"lv_VI97HAXpY6yYWAAAC","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":5000,"maxPayload":1000000}
```
Details:
```
0 => Engine.IO "open" packet type
{"sid":... => the Engine.IO handshake data
```
Note: the `t` query param is used to ensure that the request is not cached by the browser.
- Request n°2 (namespace connection request):
```
POST /socket.io/?EIO=4&transport=polling&t=N8hyd7H&sid=lv_VI97HAXpY6yYWAAAC
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=UTF-8
40
```
Details:
```
4 => Engine.IO "message" packet type
0 => Socket.IO "CONNECT" packet type
```
- Request n°3 (namespace connection approval)
```
GET /socket.io/?EIO=4&transport=polling&t=N8hyd7H&sid=lv_VI97HAXpY6yYWAAAC
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=UTF-8
40{"sid":"wZX3oN0bSVIhsaknAAAI"}
```
- Request n°4
`socket.emit('hey', 'Jude')` is executed on the server:
```
GET /socket.io/?EIO=4&transport=polling&t=N8hyd7H&sid=lv_VI97HAXpY6yYWAAAC
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=UTF-8
42["hey","Jude"]
```
Details:
```
4 => Engine.IO "message" packet type
2 => Socket.IO "EVENT" packet type
[...] => content
```
- Request n°5 (message out)
`socket.emit('hello'); socket.emit('world');` is executed on the client:
```
POST /socket.io/?EIO=4&transport=polling&t=N8hzxke&sid=lv_VI97HAXpY6yYWAAAC
> Content-Type: text/plain; charset=UTF-8
42["hello"]\x1e42["world"]
< HTTP/1.1 200 OK
< Content-Type: text/plain; charset=UTF-8
ok
```
Details:
```
4 => Engine.IO "message" packet type
2 => Socket.IO "EVENT" packet type
["hello"] => the 1st content
\x1e => separator
4 => Engine.IO "message" packet type
2 => Socket.IO "EVENT" packet type
["world"] => the 2nd content
```
- Request n°6 (WebSocket upgrade)
```
GET /socket.io/?EIO=4&transport=websocket&sid=lv_VI97HAXpY6yYWAAAC
< HTTP/1.1 101 Switching Protocols
```
WebSocket frames:
```
< 2probe => Engine.IO probe request
> 3probe => Engine.IO probe response
> 5 => Engine.IO "upgrade" packet type
> 42["hello"]
> 42["world"]
> 40/admin, => request access to the admin namespace (Socket.IO "CONNECT" packet)
< 40/admin,{"sid":"-G5j-67EZFp-q59rADQM"} => grant access to the admin namespace
> 42/admin,1["tellme"] => Socket.IO "EVENT" packet with acknowledgement
< 461-/admin,1[{"_placeholder":true,"num":0}] => Socket.IO "BINARY_ACK" packet with a placeholder
< <binary> => the binary attachment (sent in the following frame)
... after a while without message
> 2 => Engine.IO "ping" packet type
< 3 => Engine.IO "pong" packet type
> 1 => Engine.IO "close" packet type
```
## History
### Difference between v5 and v4
The 5th revision (current) of the Socket.IO protocol is used in Socket.IO v3 and above (`v3.0.0` was released in November 2020).
It is built on top of the 4th revision of [the Engine.IO protocol](https://github.com/socketio/engine.io-protocol) (hence the `EIO=4` query parameter).
List of changes:
- remove the implicit connection to the default namespace
In previous versions, a client was always connected to the default namespace, even if it requested access to another namespace.
This is not the case anymore, the client must send a `CONNECT` packet in any case.
Commits: [09b6f23](https://github.com/socketio/socket.io/commit/09b6f2333950b8afc8c1400b504b01ad757876bd) (server) and [249e0be](https://github.com/socketio/socket.io-client/commit/249e0bef9071e7afd785485961c4eef0094254e8) (client)
- rename `ERROR` to `CONNECT_ERROR`
The meaning and the code number (4) are not modified: this packet type is still used by the server when the connection to a namespace is refused. But we feel the name is more self-descriptive.
Commits: [d16c035](https://github.com/socketio/socket.io/commit/d16c035d258b8deb138f71801cb5aeedcdb3f002) (server) and [13e1db7c](https://github.com/socketio/socket.io-client/commit/13e1db7c94291c583d843beaa9e06ee041ae4f26) (client).
- the `CONNECT` packet now can contain a payload
The client can send a payload for authentication/authorization purposes. Example:
```json
{
"type": 0,
"nsp": "/admin",
"data": {
"token": "123"
}
}
```
In case of success, the server responds with a payload contain the ID of the Socket. Example:
```json
{
"type": 0,
"nsp": "/admin",
"data": {
"sid": "CjdVH4TQvovi1VvgAC5Z"
}
}
```
This change means that the ID of the Socket.IO connection will now be different from the ID of the underlying Engine.IO connection (the one that is found in the query parameters of the HTTP requests).
Commits: [2875d2c](https://github.com/socketio/socket.io/commit/2875d2cfdfa463e64cb520099749f543bbc4eb15) (server) and [bbe94ad](https://github.com/socketio/socket.io-client/commit/bbe94adb822a306c6272e977d394e3e203cae25d) (client)
- the payload `CONNECT_ERROR` packet is now an object instead of a plain string
Commits: [54bf4a4](https://github.com/socketio/socket.io/commit/54bf4a44e9e896dfb64764ee7bd4e8823eb7dc7b) (server) and [0939395](https://github.com/socketio/socket.io-client/commit/09393952e3397a0c71f239ea983f8ec1623b7c21) (client)
### Difference between v4 and v3
The 4th revision of the Socket.IO protocol is used in Socket.IO v1 (`v1.0.3` was released in June 2014) and v2 (`v2.0.0` was released in May 2017).
The details of the revision can be found here: https://github.com/socketio/socket.io-protocol/tree/v4
It is built on top of the 3rd revision of [the Engine.IO protocol](https://github.com/socketio/engine.io-protocol) (hence the `EIO=3` query parameter).
List of changes:
- add a `BINARY_ACK` packet type
Previously, an `ACK` packet was always treated as if it may contain binary objects, with recursive search for such
objects, which could hurt performance.
Reference: https://github.com/socketio/socket.io-parser/commit/ca4f42a922ba7078e840b1bc09fe3ad618acc065
### Difference between v3 and v2
The 3rd revision of the Socket.IO protocol is used in early Socket.IO v1 versions (`socket.io@1.0.0...1.0.2`) (released in May 2014).
The details of the revision can be found here: https://github.com/socketio/socket.io-protocol/tree/v3
List of changes:
- remove the usage of msgpack to encode packets containing binary objects (see also [299849b](https://github.com/socketio/socket.io-parser/commit/299849b00294c3bc95817572441f3aca8ffb1f65))
### Difference between v2 and v1
List of changes:
- add a `BINARY_EVENT` packet type
This was added during the work towards Socket.IO 1.0, in order to add support for binary objects. The `BINARY_EVENT`
packets were encoded with [msgpack](https://msgpack.org/).
### Initial revision
This first revision was the result of the split between the Engine.IO protocol (low-level plumbing with WebSocket / HTTP
long-polling, heartbeat) and the Socket.IO protocol. It was never included in a Socket.IO release, but paved the way for
the next iterations.
## Test suite
The test suite in the [`test-suite/`](https://github.com/socketio/socket.io-protocol/tree/main/test-suite) directory lets you check the compliance of a server implementation.
Usage:
- in Node.js: `npm ci && npm test`
- in a browser: simply open the `index.html` file in your browser
For reference, here is expected configuration for the JavaScript server to pass all tests:
```js
import { Server } from "socket.io";
const io = new Server(3000, {
pingInterval: 300,
pingTimeout: 200,
maxPayload: 1000000,
connectTimeout: 1000,
cors: {
origin: "*"
}
});
io.on("connection", (socket) => {
socket.emit("auth", socket.handshake.auth);
socket.on("message", (...args) => {
socket.emit.apply(socket, ["message-back", ...args]);
});
socket.on("message-with-ack", (...args) => {
const ack = args.pop();
ack(...args);
})
});
io.of("/custom").on("connection", (socket) => {
socket.emit("auth", socket.handshake.auth);
});
```
## License
MIT

View File

@@ -0,0 +1 @@
node_modules

View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Test suite for the Socket.IO protocol</title>
<link rel="stylesheet" href="https://unpkg.com/mocha@9/mocha.css" />
</head>
<body>
<div id="mocha"></div>
<script src="https://unpkg.com/mocha@9/mocha.js"></script>
<script src="https://unpkg.com/chai@4/chai.js" ></script>
<script src="https://unpkg.com/chai-string@1/chai-string.js" ></script>
<script class="mocha-init">
mocha.setup("bdd");
mocha.checkLeaks();
</script>
<script type="module" src="test-suite.js"></script>
<script class="mocha-exec">
mocha.run();
</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
import fetch from "node-fetch";
import { WebSocket } from "ws";
import chai from "chai";
import chaiString from "chai-string";
chai.use(chaiString);
globalThis.fetch = fetch;
globalThis.WebSocket = WebSocket;
globalThis.chai = chai;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,18 @@
{
"name": "socket.io-protocol-test-suite",
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"format": "prettier -w *.js",
"test": "mocha test-suite.js"
},
"devDependencies": {
"chai": "^4.3.6",
"chai-string": "^1.5.0",
"mocha": "^9.2.1",
"node-fetch": "^3.2.0",
"prettier": "^2.5.1",
"ws": "^8.5.0"
}
}

View File

@@ -0,0 +1,656 @@
const isNodejs = typeof window === "undefined";
if (isNodejs) {
// make the tests runnable in both the browser and Node.js
await import("./node-imports.js");
}
const { expect } = chai;
const URL = "http://localhost:3000";
const WS_URL = URL.replace("http", "ws");
const PING_INTERVAL = 300;
const PING_TIMEOUT = 200;
function sleep(delay) {
return new Promise((resolve) => setTimeout(resolve, delay));
}
function createWebSocket(url) {
const socket = new WebSocket(url);
socket._eventBuffer = {};
socket._pendingPromises = {};
for (const eventType of ["open", "close", "message"]) {
socket._eventBuffer[eventType] = [];
socket._pendingPromises[eventType] = [];
socket.addEventListener(eventType, (event) => {
if (socket._pendingPromises[eventType].length) {
socket._pendingPromises[eventType].shift()(event);
} else {
socket._eventBuffer[eventType].push(event);
}
});
}
return socket;
}
function waitFor(socket, eventType) {
if (socket._eventBuffer[eventType].length) {
return Promise.resolve(socket._eventBuffer[eventType].shift());
} else {
return new Promise((resolve) => {
socket._pendingPromises[eventType].push(resolve);
});
}
}
function waitForPackets(socket, count) {
const packets = [];
return new Promise((resolve) => {
const handler = (event) => {
if (event.data === "2") {
// ignore PING packets
return;
}
packets.push(event.data);
if (packets.length === count) {
socket.removeEventListener("message", handler);
resolve(packets);
}
};
socket.addEventListener("message", handler);
});
}
async function initLongPollingSession() {
const response = await fetch(`${URL}/socket.io/?EIO=4&transport=polling`);
const content = await response.text();
return JSON.parse(content.substring(1)).sid;
}
async function initSocketIOConnection() {
const socket = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket`
);
socket.binaryType = "arraybuffer";
await waitFor(socket, "message"); // Engine.IO handshake
socket.send("40");
await waitFor(socket, "message"); // Socket.IO handshake
await waitFor(socket, "message"); // "auth" packet
return socket;
}
describe("Engine.IO protocol", () => {
describe("handshake", () => {
describe("HTTP long-polling", () => {
it("should successfully open a session", async () => {
const response = await fetch(
`${URL}/socket.io/?EIO=4&transport=polling`
);
expect(response.status).to.eql(200);
const content = await response.text();
expect(content).to.startsWith("0");
const value = JSON.parse(content.substring(1));
expect(value).to.have.all.keys(
"sid",
"upgrades",
"pingInterval",
"pingTimeout",
"maxPayload"
);
expect(value.sid).to.be.a("string");
expect(value.upgrades).to.eql(["websocket"]);
expect(value.pingInterval).to.eql(PING_INTERVAL);
expect(value.pingTimeout).to.eql(PING_TIMEOUT);
expect(value.maxPayload).to.eql(1000000);
});
it("should fail with an invalid 'EIO' query parameter", async () => {
const response = await fetch(`${URL}/socket.io/?transport=polling`);
expect(response.status).to.eql(400);
const response2 = await fetch(
`${URL}/socket.io/?EIO=abc&transport=polling`
);
expect(response2.status).to.eql(400);
});
it("should fail with an invalid 'transport' query parameter", async () => {
const response = await fetch(`${URL}/socket.io/?EIO=4`);
expect(response.status).to.eql(400);
const response2 = await fetch(`${URL}/socket.io/?EIO=4&transport=abc`);
expect(response2.status).to.eql(400);
});
it("should fail with an invalid request method", async () => {
const response = await fetch(
`${URL}/socket.io/?EIO=4&transport=polling`,
{
method: "post",
}
);
expect(response.status).to.eql(400);
const response2 = await fetch(
`${URL}/socket.io/?EIO=4&transport=polling`,
{
method: "put",
}
);
expect(response2.status).to.eql(400);
});
});
describe("WebSocket", () => {
it("should successfully open a session", async () => {
const socket = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket`
);
const { data } = await waitFor(socket, "message");
expect(data).to.startsWith("0");
const value = JSON.parse(data.substring(1));
expect(value).to.have.all.keys(
"sid",
"upgrades",
"pingInterval",
"pingTimeout",
"maxPayload"
);
expect(value.sid).to.be.a("string");
expect(value.upgrades).to.eql([]);
expect(value.pingInterval).to.eql(PING_INTERVAL);
expect(value.pingTimeout).to.eql(PING_TIMEOUT);
expect(value.maxPayload).to.eql(1000000);
socket.close();
});
it("should fail with an invalid 'EIO' query parameter", async () => {
const socket = createWebSocket(
`${WS_URL}/socket.io/?transport=websocket`
);
if (isNodejs) {
socket.on("error", () => {});
}
await waitFor(socket, "close");
const socket2 = createWebSocket(
`${WS_URL}/socket.io/?EIO=abc&transport=websocket`
);
if (isNodejs) {
socket2.on("error", () => {});
}
await waitFor(socket2, "close");
});
it("should fail with an invalid 'transport' query parameter", async () => {
const socket = createWebSocket(`${WS_URL}/socket.io/?EIO=4`);
if (isNodejs) {
socket.on("error", () => {});
}
await waitFor(socket, "close");
const socket2 = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=abc`
);
if (isNodejs) {
socket2.on("error", () => {});
}
await waitFor(socket2, "close");
});
});
});
describe("heartbeat", function () {
this.timeout(5000);
describe("HTTP long-polling", () => {
it("should send ping/pong packets", async () => {
const sid = await initLongPollingSession();
for (let i = 0; i < 3; i++) {
const pollResponse = await fetch(
`${URL}/socket.io/?EIO=4&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(200);
const pollContent = await pollResponse.text();
expect(pollContent).to.eql("2");
const pushResponse = await fetch(
`${URL}/socket.io/?EIO=4&transport=polling&sid=${sid}`,
{
method: "post",
body: "3",
}
);
expect(pushResponse.status).to.eql(200);
}
});
it("should close the session upon ping timeout", async () => {
const sid = await initLongPollingSession();
await sleep(PING_INTERVAL + PING_TIMEOUT);
const pollResponse = await fetch(
`${URL}/socket.io/?EIO=4&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(400);
});
});
describe("WebSocket", () => {
it("should send ping/pong packets", async () => {
const socket = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket`
);
await waitFor(socket, "message"); // handshake
for (let i = 0; i < 3; i++) {
const { data } = await waitFor(socket, "message");
expect(data).to.eql("2");
socket.send("3");
}
socket.close();
});
it("should close the session upon ping timeout", async () => {
const socket = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket`
);
await waitFor(socket, "close"); // handshake
});
});
});
describe("close", () => {
describe("HTTP long-polling", () => {
it("should forcefully close the session", async () => {
const sid = await initLongPollingSession();
const [pollResponse] = await Promise.all([
fetch(`${URL}/socket.io/?EIO=4&transport=polling&sid=${sid}`),
fetch(`${URL}/socket.io/?EIO=4&transport=polling&sid=${sid}`, {
method: "post",
body: "1",
}),
]);
expect(pollResponse.status).to.eql(200);
const pullContent = await pollResponse.text();
expect(pullContent).to.eql("6");
const pollResponse2 = await fetch(
`${URL}/socket.io/?EIO=4&transport=polling&sid=${sid}`
);
expect(pollResponse2.status).to.eql(400);
});
});
describe("WebSocket", () => {
it("should forcefully close the session", async () => {
const socket = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket`
);
await waitFor(socket, "message"); // handshake
socket.send("1");
await waitFor(socket, "close");
});
});
});
describe("upgrade", () => {
it("should successfully upgrade from HTTP long-polling to WebSocket", async () => {
const sid = await initLongPollingSession();
const socket = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket&sid=${sid}`
);
await waitFor(socket, "open");
// send probe
socket.send("2probe");
const probeResponse = await waitFor(socket, "message");
expect(probeResponse.data).to.eql("3probe");
// complete upgrade
socket.send("5");
});
it("should ignore HTTP requests with same sid after upgrade", async () => {
const sid = await initLongPollingSession();
const socket = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket&sid=${sid}`
);
await waitFor(socket, "open");
socket.send("2probe");
await waitFor(socket, "message"); // "3probe"
socket.send("5");
const pollResponse = await fetch(
`${URL}/socket.io/?EIO=4&transport=polling&sid=${sid}`
);
expect(pollResponse.status).to.eql(400);
});
it("should ignore WebSocket connection with same sid after upgrade", async () => {
const sid = await initLongPollingSession();
const socket = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket&sid=${sid}`
);
await waitFor(socket, "open");
socket.send("2probe");
await waitFor(socket, "message"); // "3probe"
socket.send("5");
const socket2 = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket&sid=${sid}`
);
await waitFor(socket2, "close");
});
});
});
describe("Socket.IO protocol", () => {
describe("connect", () => {
it("should allow connection to the main namespace", async () => {
const socket = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket`
);
await waitFor(socket, "message"); // Engine.IO handshake
socket.send("40");
const { data } = await waitFor(socket, "message");
expect(data).to.startsWith("40");
const handshake = JSON.parse(data.substring(2));
expect(handshake).to.have.all.keys("sid");
expect(handshake.sid).to.be.a("string");
const authPacket = await waitFor(socket, "message");
expect(authPacket.data).to.eql('42["auth",{}]');
});
it("should allow connection to the main namespace with a payload", async () => {
const socket = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket`
);
await waitFor(socket, "message"); // Engine.IO handshake
socket.send('40{"token":"123"}');
const { data } = await waitFor(socket, "message");
expect(data).to.startsWith("40");
const handshake = JSON.parse(data.substring(2));
expect(handshake).to.have.all.keys("sid");
expect(handshake.sid).to.be.a("string");
const authPacket = await waitFor(socket, "message");
expect(authPacket.data).to.eql('42["auth",{"token":"123"}]');
});
it("should allow connection to a custom namespace", async () => {
const socket = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket`
);
await waitFor(socket, "message"); // Engine.IO handshake
socket.send("40/custom,");
const { data } = await waitFor(socket, "message");
expect(data).to.startsWith("40/custom,");
const handshake = JSON.parse(data.substring(10));
expect(handshake).to.have.all.keys("sid");
expect(handshake.sid).to.be.a("string");
const authPacket = await waitFor(socket, "message");
expect(authPacket.data).to.eql('42/custom,["auth",{}]');
});
it("should allow connection to a custom namespace with a payload", async () => {
const socket = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket`
);
await waitFor(socket, "message"); // Engine.IO handshake
socket.send('40/custom,{"token":"abc"}');
const { data } = await waitFor(socket, "message");
expect(data).to.startsWith("40/custom,");
const handshake = JSON.parse(data.substring(10));
expect(handshake).to.have.all.keys("sid");
expect(handshake.sid).to.be.a("string");
const authPacket = await waitFor(socket, "message");
expect(authPacket.data).to.eql('42/custom,["auth",{"token":"abc"}]');
});
it("should disallow connection to an unknown namespace", async () => {
const socket = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket`
);
await waitFor(socket, "message"); // Engine.IO handshake
socket.send("40/random");
const { data } = await waitFor(socket, "message");
expect(data).to.eql('44/random,{"message":"Invalid namespace"}');
});
it("should disallow connection with an invalid handshake", async () => {
const socket = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket`
);
await waitFor(socket, "message"); // Engine.IO handshake
socket.send("4abc");
await waitFor(socket, "close");
});
it("should close the connection if no handshake is received", async () => {
const socket = createWebSocket(
`${WS_URL}/socket.io/?EIO=4&transport=websocket`
);
await waitFor(socket, "close");
});
});
describe("disconnect", () => {
it("should disconnect from the main namespace", async () => {
const socket = await initSocketIOConnection();
socket.send("41");
const { data } = await waitFor(socket, "message");
expect(data).to.eql("2");
});
it("should connect then disconnect from a custom namespace", async () => {
const socket = await initSocketIOConnection();
await waitFor(socket, "message"); // ping
socket.send("40/custom");
await waitFor(socket, "message"); // Socket.IO handshake
await waitFor(socket, "message"); // auth packet
socket.send("41/custom");
socket.send('42["message","message to main namespace"]');
const { data } = await waitFor(socket, "message");
expect(data).to.eql('42["message-back","message to main namespace"]');
});
});
describe("message", () => {
it("should send a plain-text packet", async () => {
const socket = await initSocketIOConnection();
socket.send('42["message",1,"2",{"3":[true]}]');
const { data } = await waitFor(socket, "message");
expect(data).to.eql('42["message-back",1,"2",{"3":[true]}]');
});
it("should send a packet with binary attachments", async () => {
const socket = await initSocketIOConnection();
socket.send(
'452-["message",{"_placeholder":true,"num":0},{"_placeholder":true,"num":1}]'
);
socket.send(Uint8Array.from([1, 2, 3]));
socket.send(Uint8Array.from([4, 5, 6]));
const packets = await waitForPackets(socket, 3);
expect(packets[0]).to.eql(
'452-["message-back",{"_placeholder":true,"num":0},{"_placeholder":true,"num":1}]'
);
expect(packets[1]).to.eql(Uint8Array.from([1, 2, 3]).buffer);
expect(packets[2]).to.eql(Uint8Array.from([4, 5, 6]).buffer);
socket.close();
});
it("should send a plain-text packet with an ack", async () => {
const socket = await initSocketIOConnection();
socket.send('42456["message-with-ack",1,"2",{"3":[false]}]');
const { data } = await waitFor(socket, "message");
expect(data).to.eql('43456[1,"2",{"3":[false]}]');
});
it("should send a packet with binary attachments and an ack", async () => {
const socket = await initSocketIOConnection();
socket.send(
'452-789["message-with-ack",{"_placeholder":true,"num":0},{"_placeholder":true,"num":1}]'
);
socket.send(Uint8Array.from([1, 2, 3]));
socket.send(Uint8Array.from([4, 5, 6]));
const packets = await waitForPackets(socket, 3);
expect(packets[0]).to.eql(
'462-789[{"_placeholder":true,"num":0},{"_placeholder":true,"num":1}]'
);
expect(packets[1]).to.eql(Uint8Array.from([1, 2, 3]).buffer);
expect(packets[2]).to.eql(Uint8Array.from([4, 5, 6]).buffer);
socket.close();
});
it("should close the connection upon invalid format (unknown packet type)", async () => {
const socket = await initSocketIOConnection();
socket.send("4abc");
await waitFor(socket, "close");
});
it("should close the connection upon invalid format (invalid payload format)", async () => {
const socket = await initSocketIOConnection();
socket.send("42{}");
await waitFor(socket, "close");
});
it("should close the connection upon invalid format (invalid ack id)", async () => {
const socket = await initSocketIOConnection();
socket.send('42abc["message-with-ack",1,"2",{"3":[false]}]');
await waitFor(socket, "close");
});
});
});

1
examples/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
package-lock.json

View File

@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1

View File

@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@react-native',
};

66
examples/ReactNativeExample/.gitignore vendored Normal file
View File

@@ -0,0 +1,66 @@
# OSX
#
.DS_Store
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
ios/.xcode.env.local
# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof
.cxx/
*.keystore
!debug.keystore
# node.js
#
node_modules/
npm-debug.log
yarn-error.log
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/
**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output
# Bundle artifact
*.jsbundle
# Ruby / CocoaPods
/ios/Pods/
/vendor/bundle/
# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
# testing
/coverage

View File

@@ -0,0 +1,7 @@
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
};

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1,119 @@
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/
import React from 'react';
import type {PropsWithChildren} from 'react';
import {
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
useColorScheme,
View,
} from 'react-native';
import { socket } from './socket';
import { useEffect, useState } from 'react';
import {
Colors,
DebugInstructions,
Header,
LearnMoreLinks,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
type SectionProps = PropsWithChildren<{
title: string;
}>;
function Section({children, title}: SectionProps): React.JSX.Element {
const isDarkMode = useColorScheme() === 'dark';
return (
<View style={styles.sectionContainer}>
<Text
style={[
styles.sectionTitle,
{
color: isDarkMode ? Colors.white : Colors.black,
},
]}>
{title}
</Text>
<Text
style={[
styles.sectionDescription,
{
color: isDarkMode ? Colors.light : Colors.dark,
},
]}>
{children}
</Text>
</View>
);
}
function App(): React.JSX.Element {
const [isConnected, setIsConnected] = useState(false);
const [transport, setTransport] = useState('N/A');
useEffect(() => {
if (socket.connected) {
onConnect();
}
function onConnect() {
setIsConnected(true);
setTransport(socket.io.engine.transport.name);
socket.io.engine.on('upgrade', (transport) => {
setTransport(transport.name);
});
}
function onDisconnect() {
setIsConnected(false);
setTransport('N/A');
}
socket.on('connect', onConnect);
socket.on('disconnect', onDisconnect);
return () => {
socket.off('connect', onConnect);
socket.off('disconnect', onDisconnect);
};
}, []);
return (
<View style={styles.container}>
<Text>Status: { isConnected ? 'connected' : 'disconnected' }</Text>
<Text>Transport: { transport }</Text>
</View>
);
}
const styles = StyleSheet.create({
sectionContainer: {
marginTop: 32,
paddingHorizontal: 24,
},
sectionTitle: {
fontSize: 24,
fontWeight: '600',
},
sectionDescription: {
marginTop: 8,
fontSize: 18,
fontWeight: '400',
},
highlight: {
fontWeight: '700',
},
});
export default App;

View File

@@ -0,0 +1,9 @@
source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'

View File

@@ -0,0 +1,89 @@
This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
# Getting Started
>**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
## Step 1: Start the Metro Server
First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
To start Metro, run the following command from the _root_ of your React Native project:
```bash
# using npm
npm start
# OR using Yarn
yarn start
```
## Step 2: Start your Application
Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:
### For Android
```bash
# using npm
npm run android
# OR using Yarn
yarn android
```
### For iOS
```bash
# using npm
npm run ios
# OR using Yarn
yarn ios
```
If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
## Step 3: Start the Socket.IO server
```bash
cd server
npm install
npm start
```
## Step 4: Modifying your App
Now that you have successfully run the app, let's modify it.
1. Open `App.tsx` in your text editor of choice and edit some lines.
2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes!
For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
## Congratulations! :tada:
You've successfully run and modified your React Native App. :partying_face:
### Now what?
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
# Troubleshooting
If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
# Learn More
To learn more about React Native, take a look at the following resources:
- [React Native Website](https://reactnative.dev) - learn more about React Native.
- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.

View File

@@ -0,0 +1,17 @@
/**
* @format
*/
import 'react-native';
import React from 'react';
import App from '../App';
// Note: import explicitly to use the types shipped with jest.
import {it} from '@jest/globals';
// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
it('renders correctly', () => {
renderer.create(<App />);
});

View File

@@ -0,0 +1,119 @@
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
/**
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
*/
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
// codegenDir = file("../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")
/* Variants */
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
// debuggableVariants = ["liteDebug", "prodDebug"]
/* Bundling */
// A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
//
// The command to run when bundling. By default is 'bundle'
// bundleCommand = "ram-bundle"
//
// The path to the CLI configuration file. Default is empty.
// bundleConfig = file(../rn-cli.config.js)
//
// The name of the generated asset file containing your JS bundle
// bundleAssetName = "MyApplication.android.bundle"
//
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/MyApplication.android.js")
//
// A list of extra flags to pass to the 'bundle' commands.
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
// extraPackagerArgs = []
/* Hermes Commands */
// The hermes compiler command to run. By default it is 'hermesc'
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]
}
/**
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore (JSC)
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
android {
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion
namespace "com.reactnativeexample"
defaultConfig {
applicationId "com.reactnativeexample"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
}
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation("com.facebook.react:flipper-integration")
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

Binary file not shown.

View File

@@ -0,0 +1,10 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning"/>
</manifest>

View File

@@ -0,0 +1,25 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@@ -0,0 +1,22 @@
package com.reactnativeexample
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate
class MainActivity : ReactActivity() {
/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
override fun getMainComponentName(): String = "ReactNativeExample"
/**
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
*/
override fun createReactActivityDelegate(): ReactActivityDelegate =
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
}

View File

@@ -0,0 +1,45 @@
package com.reactnativeexample
import android.app.Application
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.flipper.ReactNativeFlipper
import com.facebook.soloader.SoLoader
class MainApplication : Application(), ReactApplication {
override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())
}
override fun getJSMainModuleName(): String = "index"
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
}
override val reactHost: ReactHost
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
}
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
}
}

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
android:insetTop="@dimen/abc_edit_text_inset_top_material"
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
<selector>
<!--
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
<item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.
-->
<item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
<item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
</selector>
</inset>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,3 @@
<resources>
<string name="app_name">ReactNativeExample</string>
</resources>

View File

@@ -0,0 +1,9 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
</style>
</resources>

View File

@@ -0,0 +1,21 @@
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 21
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "25.1.8937393"
kotlinVersion = "1.8.0"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
}
}
apply plugin: "com.facebook.react.rootproject"

View File

@@ -0,0 +1,41 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# Use this property to enable support to the new architecture.
# This will allow you to use TurboModules and the Fabric render in
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true

View File

@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

249
examples/ReactNativeExample/android/gradlew vendored Executable file
View File

@@ -0,0 +1,249 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

View File

@@ -0,0 +1,92 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@@ -0,0 +1,4 @@
rootProject.name = 'ReactNativeExample'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')

View File

@@ -0,0 +1,4 @@
{
"name": "ReactNativeExample",
"displayName": "ReactNativeExample"
}

View File

@@ -0,0 +1,3 @@
module.exports = {
presets: ['module:@react-native/babel-preset'],
};

View File

@@ -0,0 +1,9 @@
/**
* @format
*/
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
AppRegistry.registerComponent(appName, () => App);

View File

@@ -0,0 +1,11 @@
# This `.xcode.env` file is versioned and is used to source the environment
# used when running script phases inside Xcode.
# To customize your local environment, you can create an `.xcode.env.local`
# file that is not versioned.
# NODE_BINARY variable contains the PATH to the node executable.
#
# Customize the NODE_BINARY variable here.
# For example, to use nvm with brew, add the following line
# . "$(brew --prefix nvm)/nvm.sh" --no-use
export NODE_BINARY=$(command -v node)

View File

@@ -0,0 +1,55 @@
# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
platform :ios, min_ios_version_supported
prepare_react_native_project!
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
#
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
# ```js
# module.exports = {
# dependencies: {
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# ```
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
target 'ReactNativeExample' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
:flipper_configuration => flipper_config,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'ReactNativeExampleTests' do
inherit! :complete
# Pods for testing
end
post_install do |installer|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
)
end
end

View File

@@ -0,0 +1,684 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
00E356F31AD99517003FC87E /* ReactNativeExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ReactNativeExampleTests.m */; };
0C80B921A6F3F58F76C31292 /* libPods-ReactNativeExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-ReactNativeExample.a */; };
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
7699B88040F8A987B510C191 /* libPods-ReactNativeExample-ReactNativeExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-ReactNativeExample-ReactNativeExampleTests.a */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
remoteInfo = ReactNativeExample;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
00E356EE1AD99517003FC87E /* ReactNativeExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ReactNativeExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* ReactNativeExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReactNativeExampleTests.m; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* ReactNativeExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReactNativeExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ReactNativeExample/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = ReactNativeExample/AppDelegate.mm; sourceTree = "<group>"; };
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = ReactNativeExample/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ReactNativeExample/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ReactNativeExample/main.m; sourceTree = "<group>"; };
19F6CBCC0A4E27FBF8BF4A61 /* libPods-ReactNativeExample-ReactNativeExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ReactNativeExample-ReactNativeExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3B4392A12AC88292D35C810B /* Pods-ReactNativeExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeExample.debug.xcconfig"; path = "Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample.debug.xcconfig"; sourceTree = "<group>"; };
5709B34CF0A7D63546082F79 /* Pods-ReactNativeExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeExample.release.xcconfig"; path = "Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample.release.xcconfig"; sourceTree = "<group>"; };
5B7EB9410499542E8C5724F5 /* Pods-ReactNativeExample-ReactNativeExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeExample-ReactNativeExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests.debug.xcconfig"; sourceTree = "<group>"; };
5DCACB8F33CDC322A6C60F78 /* libPods-ReactNativeExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ReactNativeExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = ReactNativeExample/LaunchScreen.storyboard; sourceTree = "<group>"; };
89C6BE57DB24E9ADA2F236DE /* Pods-ReactNativeExample-ReactNativeExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeExample-ReactNativeExampleTests.release.xcconfig"; path = "Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests.release.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
00E356EB1AD99517003FC87E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7699B88040F8A987B510C191 /* libPods-ReactNativeExample-ReactNativeExampleTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0C80B921A6F3F58F76C31292 /* libPods-ReactNativeExample.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
00E356EF1AD99517003FC87E /* ReactNativeExampleTests */ = {
isa = PBXGroup;
children = (
00E356F21AD99517003FC87E /* ReactNativeExampleTests.m */,
00E356F01AD99517003FC87E /* Supporting Files */,
);
path = ReactNativeExampleTests;
sourceTree = "<group>";
};
00E356F01AD99517003FC87E /* Supporting Files */ = {
isa = PBXGroup;
children = (
00E356F11AD99517003FC87E /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
13B07FAE1A68108700A75B9A /* ReactNativeExample */ = {
isa = PBXGroup;
children = (
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.mm */,
13B07FB51A68108700A75B9A /* Images.xcassets */,
13B07FB61A68108700A75B9A /* Info.plist */,
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
13B07FB71A68108700A75B9A /* main.m */,
);
name = ReactNativeExample;
sourceTree = "<group>";
};
2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
isa = PBXGroup;
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
5DCACB8F33CDC322A6C60F78 /* libPods-ReactNativeExample.a */,
19F6CBCC0A4E27FBF8BF4A61 /* libPods-ReactNativeExample-ReactNativeExampleTests.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
);
name = Libraries;
sourceTree = "<group>";
};
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
13B07FAE1A68108700A75B9A /* ReactNativeExample */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
00E356EF1AD99517003FC87E /* ReactNativeExampleTests */,
83CBBA001A601CBA00E9B192 /* Products */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
BBD78D7AC51CEA395F1C20DB /* Pods */,
);
indentWidth = 2;
sourceTree = "<group>";
tabWidth = 2;
usesTabs = 0;
};
83CBBA001A601CBA00E9B192 /* Products */ = {
isa = PBXGroup;
children = (
13B07F961A680F5B00A75B9A /* ReactNativeExample.app */,
00E356EE1AD99517003FC87E /* ReactNativeExampleTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
BBD78D7AC51CEA395F1C20DB /* Pods */ = {
isa = PBXGroup;
children = (
3B4392A12AC88292D35C810B /* Pods-ReactNativeExample.debug.xcconfig */,
5709B34CF0A7D63546082F79 /* Pods-ReactNativeExample.release.xcconfig */,
5B7EB9410499542E8C5724F5 /* Pods-ReactNativeExample-ReactNativeExampleTests.debug.xcconfig */,
89C6BE57DB24E9ADA2F236DE /* Pods-ReactNativeExample-ReactNativeExampleTests.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
00E356ED1AD99517003FC87E /* ReactNativeExampleTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ReactNativeExampleTests" */;
buildPhases = (
A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */,
00E356EA1AD99517003FC87E /* Sources */,
00E356EB1AD99517003FC87E /* Frameworks */,
00E356EC1AD99517003FC87E /* Resources */,
C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */,
F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
00E356F51AD99517003FC87E /* PBXTargetDependency */,
);
name = ReactNativeExampleTests;
productName = ReactNativeExampleTests;
productReference = 00E356EE1AD99517003FC87E /* ReactNativeExampleTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
13B07F861A680F5B00A75B9A /* ReactNativeExample */ = {
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeExample" */;
buildPhases = (
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */,
E235C05ADACE081382539298 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = ReactNativeExample;
productName = ReactNativeExample;
productReference = 13B07F961A680F5B00A75B9A /* ReactNativeExample.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
83CBB9F71A601CBA00E9B192 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1210;
TargetAttributes = {
00E356ED1AD99517003FC87E = {
CreatedOnToolsVersion = 6.2;
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
LastSwiftMigration = 1120;
};
};
};
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactNativeExample" */;
compatibilityVersion = "Xcode 12.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 83CBB9F61A601CBA00E9B192;
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
13B07F861A680F5B00A75B9A /* ReactNativeExample */,
00E356ED1AD99517003FC87E /* ReactNativeExampleTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
00E356EC1AD99517003FC87E /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
13B07F8E1A680F5B00A75B9A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"$(SRCROOT)/.xcode.env.local",
"$(SRCROOT)/.xcode.env",
);
name = "Bundle React Native code and images";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
};
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-ReactNativeExample-ReactNativeExampleTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-ReactNativeExample-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample/Pods-ReactNativeExample-resources.sh\"\n";
showEnvVarsInLog = 0;
};
F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeExample-ReactNativeExampleTests/Pods-ReactNativeExample-ReactNativeExampleTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
00E356EA1AD99517003FC87E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
00E356F31AD99517003FC87E /* ReactNativeExampleTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
13B07F871A680F5B00A75B9A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */,
13B07FC11A68108700A75B9A /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 13B07F861A680F5B00A75B9A /* ReactNativeExample */;
targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
00E356F61AD99517003FC87E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-ReactNativeExample-ReactNativeExampleTests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = ReactNativeExampleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
"$(inherited)",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactNativeExample.app/ReactNativeExample";
};
name = Debug;
};
00E356F71AD99517003FC87E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-ReactNativeExample-ReactNativeExampleTests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = ReactNativeExampleTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
"$(inherited)",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactNativeExample.app/ReactNativeExample";
};
name = Release;
};
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-ReactNativeExample.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = ReactNativeExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = ReactNativeExample;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-ReactNativeExample.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
INFOPLIST_FILE = ReactNativeExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = ReactNativeExample;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
83CBBA201A601CBA00E9B192 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
);
LIBRARY_SEARCH_PATHS = (
"\"$(SDKROOT)/usr/lib/swift\"",
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
"\"$(inherited)\"",
);
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DFOLLY_NO_CONFIG",
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
"-DFOLLY_CFG_NO_COROUTINES=1",
);
SDKROOT = iphoneos;
};
name = Debug;
};
83CBBA211A601CBA00E9B192 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
);
LIBRARY_SEARCH_PATHS = (
"\"$(SDKROOT)/usr/lib/swift\"",
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
"\"$(inherited)\"",
);
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DFOLLY_NO_CONFIG",
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
"-DFOLLY_CFG_NO_COROUTINES=1",
);
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ReactNativeExampleTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
00E356F61AD99517003FC87E /* Debug */,
00E356F71AD99517003FC87E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
13B07F941A680F5B00A75B9A /* Debug */,
13B07F951A680F5B00A75B9A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactNativeExample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
83CBBA201A601CBA00E9B192 /* Debug */,
83CBBA211A601CBA00E9B192 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
}

View File

@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "ReactNativeExample.app"
BlueprintName = "ReactNativeExample"
ReferencedContainer = "container:ReactNativeExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "ReactNativeExampleTests.xctest"
BlueprintName = "ReactNativeExampleTests"
ReferencedContainer = "container:ReactNativeExample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "ReactNativeExample.app"
BlueprintName = "ReactNativeExample"
ReferencedContainer = "container:ReactNativeExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "ReactNativeExample.app"
BlueprintName = "ReactNativeExample"
ReferencedContainer = "container:ReactNativeExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,6 @@
#import <RCTAppDelegate.h>
#import <UIKit/UIKit.h>
@interface AppDelegate : RCTAppDelegate
@end

View File

@@ -0,0 +1,31 @@
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.moduleName = @"ReactNativeExample";
// You can add your custom initial props in the dictionary below.
// They will be passed down to the ViewController used by React Native.
self.initialProps = @{};
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
return [self getBundleURL];
}
- (NSURL *)getBundleURL
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
@end

View File

@@ -0,0 +1,53 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>ReactNativeExample</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<!-- Do not change NSAllowsArbitraryLoads to true, or you will risk app rejection! -->
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ReactNativeExample" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
<rect key="frame" x="0.0" y="202" width="375" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="MN2-I3-ftu">
<rect key="frame" x="0.0" y="626" width="375" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="Bcu-3y-fUS" firstAttribute="bottom" secondItem="MN2-I3-ftu" secondAttribute="bottom" constant="20" id="OZV-Vh-mqD"/>
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
<constraint firstItem="MN2-I3-ftu" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="akx-eg-2ui"/>
<constraint firstItem="MN2-I3-ftu" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" id="i1E-0Y-4RG"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/>
</constraints>
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="52.173913043478265" y="375"/>
</scene>
</scenes>
</document>

View File

@@ -0,0 +1,10 @@
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@@ -0,0 +1,66 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
#import <React/RCTLog.h>
#import <React/RCTRootView.h>
#define TIMEOUT_SECONDS 600
#define TEXT_TO_LOOK_FOR @"Welcome to React"
@interface ReactNativeExampleTests : XCTestCase
@end
@implementation ReactNativeExampleTests
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test
{
if (test(view)) {
return YES;
}
for (UIView *subview in [view subviews]) {
if ([self findSubviewInView:subview matching:test]) {
return YES;
}
}
return NO;
}
- (void)testRendersWelcomeScreen
{
UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
BOOL foundElement = NO;
__block NSString *redboxError = nil;
#ifdef DEBUG
RCTSetLogFunction(
^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
if (level >= RCTLogLevelError) {
redboxError = message;
}
});
#endif
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
foundElement = [self findSubviewInView:vc.view
matching:^BOOL(UIView *view) {
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
return YES;
}
return NO;
}];
}
#ifdef DEBUG
RCTSetLogFunction(RCTDefaultLogFunction);
#endif
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
}
@end

View File

@@ -0,0 +1,3 @@
module.exports = {
preset: 'react-native',
};

View File

@@ -0,0 +1,11 @@
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
/**
* Metro configuration
* https://facebook.github.io/metro/docs/configuration
*
* @type {import('metro-config').MetroConfig}
*/
const config = {};
module.exports = mergeConfig(getDefaultConfig(__dirname), config);

View File

@@ -0,0 +1,37 @@
{
"name": "ReactNativeExample",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"react": "18.2.0",
"react-native": "0.73.6",
"socket.io-client": "^4.7.5"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.73.21",
"@react-native/eslint-config": "0.73.2",
"@react-native/metro-config": "0.73.5",
"@react-native/typescript-config": "0.73.1",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "18.2.0",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}
}

View File

@@ -0,0 +1,13 @@
import { Server } from 'socket.io';
const io = new Server();
io.on('connection', (socket) => {
console.log(`connect: ${socket.id}`, socket.request.headers);
socket.on('disconnect', () => {
console.log(`disconnect: ${socket.id}`);
});
});
io.listen(3000);

View File

@@ -0,0 +1,15 @@
{
"name": "server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"start": "node index.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"socket.io": "^4.7.5"
}
}

View File

@@ -0,0 +1,3 @@
import { io } from 'socket.io-client';
export const socket = io('http://192.168.0.10:3000'); // use the IP address of your machine

Some files were not shown because too many files have changed in this diff Show More