-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Giona Righini
committed
Aug 26, 2024
1 parent
2c738df
commit 6f665f1
Showing
4 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const http = require("http"); | ||
const { Server } = require("socket.io"); | ||
const server = http.createServer(); | ||
const io = new Server(server); | ||
|
||
const ioc = require("socket.io-client"); | ||
|
||
server.listen(3000, () => {}); | ||
setTimeout(() => io.emit("test", 12), 2000); | ||
|
||
const socket = ioc("http://localhost:3000"); | ||
|
||
socket.on("connect", () => { | ||
console.log("connected!"); | ||
}); | ||
|
||
socket.on("test", (msg) => { | ||
console.log("Received:", msg); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -440,6 +440,17 @@ [email protected]: | |
resolved "https://registry.yarnpkg.com/enabled/-/enabled-2.0.0.tgz#f9dd92ec2d6f4bbc0d5d1e64e21d61cd4665e7c2" | ||
integrity sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ== | ||
|
||
engine.io-client@~6.5.2: | ||
version "6.5.4" | ||
resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-6.5.4.tgz#b8bc71ed3f25d0d51d587729262486b4b33bd0d0" | ||
integrity sha512-GeZeeRjpD2qf49cZQ0Wvh/8NJNfeXkXXcoGh+F77oEAgo9gUHwT1fCRxSNU+YEEaysOJTnsFHmM5oAcPy4ntvQ== | ||
dependencies: | ||
"@socket.io/component-emitter" "~3.1.0" | ||
debug "~4.3.1" | ||
engine.io-parser "~5.2.1" | ||
ws "~8.17.1" | ||
xmlhttprequest-ssl "~2.0.0" | ||
|
||
engine.io-parser@~5.2.1: | ||
version "5.2.3" | ||
resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-5.2.3.tgz#00dc5b97b1f233a23c9398d0209504cf5f94d92f" | ||
|
@@ -1408,6 +1419,16 @@ socket.io-adapter@~2.5.2: | |
debug "~4.3.4" | ||
ws "~8.17.1" | ||
|
||
socket.io-client@^4.7.5: | ||
version "4.7.5" | ||
resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-4.7.5.tgz#919be76916989758bdc20eec63f7ee0ae45c05b7" | ||
integrity sha512-sJ/tqHOCe7Z50JCBCXrsY3I2k03iOiUe+tj1OmKeD2lXPiGH/RUCdTZFoqVyN7l1MnpIzPrGtLcijffmeouNlQ== | ||
dependencies: | ||
"@socket.io/component-emitter" "~3.1.0" | ||
debug "~4.3.2" | ||
engine.io-client "~6.5.2" | ||
socket.io-parser "~4.2.4" | ||
|
||
socket.io-parser@~4.2.4: | ||
version "4.2.4" | ||
resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-4.2.4.tgz#c806966cf7270601e47469ddeec30fbdfda44c83" | ||
|
@@ -1697,3 +1718,8 @@ ws@~8.17.1: | |
version "8.17.1" | ||
resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" | ||
integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== | ||
|
||
xmlhttprequest-ssl@~2.0.0: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz#91360c86b914e67f44dce769180027c0da618c67" | ||
integrity sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A== |