導入 node.js で socket.io を使って、なんかゲーム作れないかな?と最近いろいろ試している。 そこで、例えばこういうケース ユーザが「部屋の新規作成」を選ぶと、新しいチャットルーム的なものができる に対応する場合、動的に名前空間を追加したくなる。 本題 socket.io で動的に名前空間を追加する際の情報って意外と少ないし、 なんか良さげな方法が見つかりにくいのでとりあえず自分が使っている方法を残す。 説明 クライアント側で、接続時に ID を送る socket.io は「クライアントがサーバに接続した時」というフックを持っている [サーバ側] io.configure(function () { io.set('authorization', function (handshake, callback) { // 処理 }); }); 上記のようにかける。 また、クライ
What is it? Faye is a publish-subscribe messaging system based on the Bayeux protocol. It provides message servers for Node.js and Ruby, and clients for use on the server and in all major web browsers. Who uses it? 1. Start a server var http = require('http'), faye = require('faye'); var server = http.createServer(), bayeux = new faye.NodeAdapter({mount: '/'}); bayeux.attach(server); server.listen
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く