Skip to content

Commit

Permalink
* android compatible: CommonJS(module/1.1) *require* method.
Browse files Browse the repository at this point in the history
* android HttpClient.responseText default data isNull problem(iOS responseText was ''::emptyString)
** compat: responseText defaults ''
  • Loading branch information
nowelium committed May 25, 2011
1 parent ad2b9b7 commit 814c354
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Resources/socket.io-titanium.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,20 @@ var io = this.io;
return req;
};
io.Transport.XHR.request = function (){
return Titanium.Network.createHTTPClient();
var client = Titanium.Network.createHTTPClient();
if(/android/i.test(Titanium.Platform.osname)){
client.responseText = '';
}
return client;
};
})();

require('socket.io/lib/transports/xhr-polling');

exports = {
io: io,
Socket: io.Socket,
createSocket: function (host, options){
return new io.Socket(host, options);
}
};

0 comments on commit 814c354

Please sign in to comment.