// See ./README.md for instructions on how to run this benchmark. const port = process.env.PORT || 4001; const CLIENTS_TO_WAIT_FOR = parseInt(process.env.CLIENTS_COUNT || "", 10) || 16; import { createRequire } from "module"; const require = createRequire(import.meta.url); var WebSocketServer = require("ws").Server, config = { host: "0.0.0.0", port, }, wss = new WebSocketServer(config, function () { console.log(`Waiting for ${CLIENTS_TO_WAIT_FOR} clients to connect..`); }); var clients = []; wss.on("connection", function (ws, { url }) { const name = new URL(new URL(url, "http://localhost:3000")).searchParams.get( "name" ); console.log( `${name} connected (${CLIENTS_TO_WAIT_FOR - clients.length} remain)` ); clients.push(ws); ws.on("message", function (message) { const out = `${name}: ${message}`; for (let client of clients) { client.send(out); } }); // when a connection is closed ws.on("close", function (ws) { clients.splice(clients.indexOf(ws), 1); }); if (clients.length === CLIENTS_TO_WAIT_FOR) { sendReadyMessage(); } }); function sendReadyMessage() { console.log("All clients connected"); setTimeout(() => { console.log("Starting benchmark"); for (let client of clients) { client.send(`ready`); } }, 100); } lue='ciro/fix-maxRequestBodySize'>ciro/fix-maxRequestBodySize Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/integration/snippets/styledcomponents-output.js (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2021-10-03Add Three.js benchmarkGravatar Jarred SUmner 5-14/+33
2021-10-02Linux works now.Gravatar Jarred SUmner 21-100/+320
2021-10-01Add support for INotify-based filesystem watcherGravatar Jarred Sumner 6-93/+287
2021-10-01Build stuffGravatar Jarred SUmner 9-1371/+71
2021-10-01Bump webkitGravatar Jarred Sumner 1-0/+0
2021-10-01Split out the macOS specific partsGravatar Jarred Sumner 4-207/+238
2021-09-30Update README.mdGravatar Jarred Sumner 1-1/+1
2021-09-30Update README.mdGravatar Jarred Sumner 1-1/+1
2021-09-30Update README.mdGravatar Jarred Sumner 1-1/+1
2021-09-30Update README.mdGravatar Jarred Sumner 1-5/+5
2021-09-30Fix up readmeGravatar Jarred Sumner 2-9/+24
2021-09-30Bump versionGravatar Jarred Sumner 3-3/+3
2021-09-30Add a readmeGravatar Jarred Sumner 3-3/+119
2021-09-30Bump build-idbun-v0.0.27jarred/relayGravatar Jarred Sumner 1-1/+1
2021-09-30runtime.versionGravatar Jarred Sumner 1-1/+1
2021-09-30SnapshotsGravatar Jarred Sumner 9-36/+63