Skip to content

Instantly share code, notes, and snippets.

View toshirot's full-sized avatar

Toshiro Takahashi toshirot

View GitHub Profile
@toshirot
toshirot / websocket-protocol-fallback.js
Created December 4, 2011 00:09 — forked from nicokaiser/websocket-protocol-fallback.js
WebSocket library fallback for old protocol clients
// This code is fallback for https://github.com/Worlize/WebSocket-Node
// add the broadcast to https://gist.github.com/1219165
// 2011.11.30 tato@http://www.facebook.com/javascripting
// Example of how to fallback to alternative websocket library for old protocol clients
// see https://gist.github.com/1148686
var http = require('http'),
WebSocketRequest = require('websocket').request,