Files
socket.io/lib/io.js
Guillermo Rauch 13c638178a Leverage node.js serving of the client side files
Make sure we can load io.js from node (window check)
2010-09-09 14:06:41 -07:00

25 lines
684 B
JavaScript

/**
* Socket.IO client
*
* @author Guillermo Rauch <guillermo@learnboost.com>
* @license The MIT license.
* @copyright Copyright (c) 2010 LearnBoost <dev@learnboost.com>
*/
this.io = {
version: '0.6',
setPath: function(path){
this.path = /\/$/.test(path) ? path : path + '/';
// this is temporary until we get a fix for injecting Flash WebSocket javascript files dynamically,
// as io.js shouldn't be aware of specific transports.
if ('WebSocket' in window){
WebSocket.__swfLocation = path + 'lib/vendor/web-socket-js/WebSocketMain.swf';
}
}
};
if ('jQuery' in this) jQuery.io = this.io;
if (typeof window != 'undefined') this.io.setPath('/socket.io/');