diff --git a/examples/typescript/client.ts b/examples/typescript/client.ts index 7c8ed2eb7c..cfa8a0dab1 100644 --- a/examples/typescript/client.ts +++ b/examples/typescript/client.ts @@ -1,7 +1,6 @@ -import { Manager } from "socket.io-client"; +import { io } from "socket.io-client"; -const manager = new Manager("ws://localhost:8080"); -const socket = manager.socket("/"); +const socket = io("ws://localhost:8080/", {}); socket.on("connect", () => { console.log(`connect ${socket.id}`); diff --git a/examples/typescript/package-lock.json b/examples/typescript/package-lock.json index fddd9a9e95..6dba92aa3b 100644 --- a/examples/typescript/package-lock.json +++ b/examples/typescript/package-lock.json @@ -9,6 +9,21 @@ "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.10.tgz", "integrity": "sha512-bsjleuRKWmGqajMerkzox19aGbscQX5rmmvvXl3wlIp5gMG1HgkiwPxsN5p070fBDKTNSPgojVbuY1+HWMbFhg==" }, + "@types/cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-y7mImlc/rNkvCRmg8gC3/lj87S7pTUIJ6QGjwHR9WQJcFs+ZMTOaoPrkdFA/YdbuqVEmEbb5RdhVxMkAcgOnpg==" + }, + "@types/cors": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.9.tgz", + "integrity": "sha512-zurD1ibz21BRlAOIKP8yhrxlqKx6L9VCwkB5kMiP6nZAhoF5MvC7qS1qPA7nRcr1GJolfkQC7/EAL4hdYejLtg==" + }, + "@types/node": { + "version": "14.14.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.16.tgz", + "integrity": "sha512-naXYePhweTi+BMv11TgioE2/FXU4fSl29HAH1ffxVciNsH3rYXjNP2yM8wqmSm7jS20gM8TIklKiTen+1iVncw==" + }, "accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -81,9 +96,9 @@ "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==" }, "engine.io": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-4.0.2.tgz", - "integrity": "sha512-sumdttqWLNjbuSMOSgDdL2xiEld9s5QZDk9VLyr4e28o+lzNNADhU3qpQDAY7cm2VZH0Otw/U0fL8mEjZ6kBMg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-4.0.5.tgz", + "integrity": "sha512-Ri+whTNr2PKklxQkfbGjwEo+kCBUM4Qxk4wtLqLrhH+b1up2NFL9g9pjYWiCV/oazwB0rArnvF/ZmZN2ab5Hpg==", "requires": { "accepts": "~1.3.4", "base64id": "2.0.0", @@ -95,9 +110,9 @@ } }, "engine.io-client": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-4.0.2.tgz", - "integrity": "sha512-cfzFu0u7rr/Gmz/CefwZ6mBj9kxtsOtOavV/YLbn+2sPGE1ZTSWh3tj8427a0od+BK27zsWDpnDx98fnpnmksA==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-4.0.5.tgz", + "integrity": "sha512-1lkn0QdekHQPMTcxUh8LqIuxQHNtKV5GvqkQzmZ1rYKAvB6puMm13U7K1ps3OQZ4joE46asQiAKrcdL9weNEVw==", "requires": { "base64-arraybuffer": "0.1.4", "component-emitter": "~1.3.0", @@ -119,9 +134,12 @@ } }, "engine.io-parser": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-4.0.1.tgz", - "integrity": "sha512-v5aZK1hlckcJDGmHz3W8xvI3NUHYc9t8QtTbqdR5OaH3S9iJZilPubauOm+vLWOMMWzpE3hiq92l9lTAHamRCg==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-4.0.2.tgz", + "integrity": "sha512-sHfEQv6nmtJrq6TKuIz5kyEKH/qSdK56H/A+7DnAuUPWosnIZAS2NHNcPLmyjtY3cGS/MqJdZbUjW97JU72iYg==", + "requires": { + "base64-arraybuffer": "0.1.4" + } }, "has-cors": { "version": "1.1.0", @@ -147,9 +165,9 @@ } }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "negotiator": { "version": "0.6.2", @@ -172,10 +190,13 @@ "integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==" }, "socket.io": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-3.0.1.tgz", - "integrity": "sha512-oVYbCQ4sCwm4wVi+f1bsE3YFXcvd6b4JjVP8D7IZnQqBeJOKX9XrdgJWSbXqBEqUXPY3jdTqb1M3s4KFTa/IHg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-3.0.4.tgz", + "integrity": "sha512-Vj1jUoO75WGc9txWd311ZJJqS9Dr8QtNJJ7gk2r7dcM/yGe9sit7qOijQl3GAwhpBOz/W8CwkD7R6yob07nLbA==", "requires": { + "@types/cookie": "^0.4.0", + "@types/cors": "^2.8.8", + "@types/node": "^14.14.7", "accepts": "~1.3.4", "base64id": "~2.0.0", "debug": "~4.1.0", @@ -190,9 +211,9 @@ "integrity": "sha512-2wo4EXgxOGSFueqvHAdnmi5JLZzWqMArjuP4nqC26AtLh5PoCPsaRbRdah2xhcwTAMooZfjYiNVNkkmmSMaxOQ==" }, "socket.io-client": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-3.0.1.tgz", - "integrity": "sha512-iIzWRDrF/h3KPtHjvLt5LL/1n7Euvv35zVa1r10ScRjVw40yc8DxFj7GnKrj1RNYkbtveWOwEsy2lWp3oFJO7w==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-3.0.4.tgz", + "integrity": "sha512-qMvBuS+W9JIN2mkfAWDCxuIt+jpIKDf8C0604zEqx1JrPaPSS6cN0F3B2GYWC83TqBeVJXW66GFxWV3KD88n0Q==", "requires": { "@types/component-emitter": "^1.2.10", "backo2": "1.0.2", @@ -205,10 +226,11 @@ } }, "socket.io-parser": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.1.tgz", - "integrity": "sha512-5JfNykYptCwU2lkOI0ieoePWm+6stEhkZ2UnLDjqnE1YEjUlXXLd1lpxPZ+g+h3rtaytwWkWrLQCaJULlGqjOg==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.2.tgz", + "integrity": "sha512-Bs3IYHDivwf+bAAuW/8xwJgIiBNtlvnjYRc4PbXgniLmcP1BrakBoq/QhO24rgtgW7VZ7uAaswRGxutUnlAK7g==", "requires": { + "@types/component-emitter": "^1.2.10", "component-emitter": "~1.3.0", "debug": "~4.1.0" } @@ -250,9 +272,9 @@ "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" }, "ws": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.0.tgz", - "integrity": "sha512-kyFwXuV/5ymf+IXhS6f0+eAFvydbaBW3zjpT6hUdAh/hbVjTIB5EHBGi0bPoCLSK2wcuz3BrEkB9LrYv1Nm4NQ==" + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz", + "integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==" }, "xmlhttprequest-ssl": { "version": "1.5.5", diff --git a/examples/typescript/package.json b/examples/typescript/package.json index f50a25b8d7..32b1770966 100644 --- a/examples/typescript/package.json +++ b/examples/typescript/package.json @@ -11,8 +11,8 @@ "author": "Damien Arrachequesne", "license": "MIT", "dependencies": { - "socket.io": "^3.0.1", - "socket.io-client": "^3.0.1", + "socket.io": "^3.0.4", + "socket.io-client": "^3.0.4", "ts-node": "^9.0.0", "typescript": "^4.0.5" }