2026-03-01から1日間の記事一覧
WebSocketの使い方メモ サーバ const WebSocket = require("ws"); // サーバを作成 const wss = new WebSocket.Server({ port: PORT }); // 接続時の処理 wss.on("connection", (ws) => { let id = clientIdCounter++; const client = { ws, name: "Anonymou…
WebSocketの使い方メモ サーバ const WebSocket = require("ws"); // サーバを作成 const wss = new WebSocket.Server({ port: PORT }); // 接続時の処理 wss.on("connection", (ws) => { let id = clientIdCounter++; const client = { ws, name: "Anonymou…