Files
socket.io/build.js
Guillermo Rauch 587c579504 Implementation of buffering for XHR send messages
XHR sending is now handled exclusively by XHR.js
HTMLFile inherits from XHR for POST handling
Implemented heartbeats echoing
Events integrated directly into socket.js
New default method to add events is `on`.
Added aliases for old event handling methods
Simplified utilities / removed legacy code
Updated build.js
Actually implemented the private method _get for XHR transports (we were overriding connect() before)
Updated example/API
2010-07-21 23:16:03 -07:00

49 lines
1.2 KiB
JavaScript
Executable File

#!/usr/bin/env node
/**
* Socket.IO client
*
* @author Guillermo Rauch <guillermo@learnboost.com>
* @license The MIT license.
* @copyright Copyright (c) 2010 LearnBoost <dev@learnboost.com>
*/
/*
* This file will help you take all the Socket.IO client files and build socket.io.js.
* You can later use Google Closure Compiler on it.
*/
var fs = require('fs'),
sys = require('sys'),
socket = require('./lib/io'),
files = [
'io.js',
'util.js',
'transport.js',
'transports/xhr.js',
'transports/websocket.js',
'transports/flashsocket.js',
'transports/htmlfile.js',
'transports/xhr-multipart.js',
'transports/xhr-polling.js',
'socket.js',
'vendor/web-socket-js/swfobject.js',
'vendor/web-socket-js/FABridge.js',
'vendor/web-socket-js/web_socket.js'
],
content = "/** Socket.IO "+ socket.io.version +" - Built with build.js */\n";
sys.log('Reading files…');
files.forEach(function(file){
var path = __dirname + '/lib/' + file;
sys.log (' + ' + path);
content += fs.readFileSync(path) + "\n";
});
sys.log('Generating…');
fs.write(fs.openSync(__dirname + '/socket.io.js', 'w'), content, 0, 'utf8');
sys.log(' + ' + __dirname + '/socket.io.js');
sys.log('All done!');