Node.jsでwebsocket Node.jsにwebsocketモジュールをインストールする。 > npm install websocketWebSocketサーバーをちょっとアレンジして写経してみる。 [server.js] var http = require('http'); var WSServer = require('websocket').server; var url = require('url'); var clientHtml = require('fs').readFileSync('client.html'); var plainHttpServer = http.createServer(function(req, res) { res.writeHead(200, { 'Content-Type': 'text/html'}); res.end(cli
![Node.jsでWebSocketサーバを作ってみる。 - 感謝のプログラミング](https://cdn-ak-scissors.b.st-hatena.com/image/square/2b9a4dd181fb00c6f30e3fd37a4663b99356b2b3/height=288;version=1;width=512/http%3A%2F%2Fecx.images-amazon.com%2Fimages%2FI%2F51mlvcBMKgL.jpg)