mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
* WebSocketServer wrapper + socket.io initial support * fix up backpressure * fix up backpressure * fix http address * add socket.io tests * add closing tests * add connection state recovery tests for socket.io * add handshake test * add middeware tests for socket.io * added socket.io socket middleware tests * add more socket.io test comment/skip hang tests * add pending package for tests * add server attachment servers for socket.io * add utility-methods tests for socket.io * rename * rename * add messaging-many socket.io tests * add namespaces tests to socket.io * skip some tests * fmt * add packages to general package.json
12 lines
314 B
TypeScript
12 lines
314 B
TypeScript
const server = require("http").createServer();
|
|
const ioc = require("socket.io-client");
|
|
const io = require("socket.io")(server);
|
|
|
|
const srv = server.listen(() => {
|
|
const socket = ioc.connect("ws://localhost:" + server.address().port);
|
|
socket.on("connect", () => {
|
|
io.close();
|
|
socket.close();
|
|
});
|
|
});
|