Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

got it working in browser #77

Closed
wants to merge 2 commits into from

3 participants

@dodo
Owner

fixed some bugs regarding browserify.

@substack

Instead of hacking this into the source, you could just add:

"browser": { "lib/xmpp/srv.js": false }

to the package.json and browserify will skip the file during compilation. Read more about how that works.

@lloydwatkin
Owner

Hey @dodo can you provide me an update on this please? Especially given @substack's comment above. Thanks, Lloyd.

@dodo dodo referenced this pull request
Merged

Upstream+browser #126

@lloydwatkin
Owner

Merged via another pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 12, 2012
  1. @dodo

    dont include srv on browser side

    dodo authored
Commits on Jun 23, 2012
  1. @dodo
This page is out of date. Refresh to see the latest.
View
2  lib/xmpp/bosh.js
@@ -154,7 +154,7 @@ BOSHConnection.prototype.request = function(attrs, children, cb, retry) {
if (err) {
if (retry < that.maxHTTPRetries)
- return request(attrs, children, cb, retry + 1);
+ return that.request(attrs, children, cb, retry + 1);
else
return cb(err);
}
View
3  lib/xmpp/client.js
@@ -5,9 +5,6 @@ var JID = require('./jid').JID;
var ltx = require('ltx');
var sasl = require('./sasl');
var util = require('util');
-try {
- var SRV = require('./srv');
-} catch (e) { }
var NS_CLIENT = 'jabber:client';
var NS_REGISTER = 'jabber:iq:register';
View
4 lib/xmpp/session.js
@@ -6,7 +6,9 @@ var WebSockets = require('./websockets');
var JID = require('./jid').JID;
var tls = require('tls');
var crypto = require('crypto');
-var SRV = require('./srv');
+var srvPath = './srv';
+if (process.title !== 'browser')
+ var SRV = require(srvPath); // HACK: omit from browserify bundle
function Session(opts) {
var self = this;
View
3  lib/xmpp/srv.js
@@ -1,5 +1,4 @@
-var dnsPath = 'dns'
-var dns = require(dnsPath); // HACK: omit from browserify bundle
+var dns = require('dns');
var EventEmitter = require('events').EventEmitter;
function compareNumbers(a, b) {
Something went wrong with that request. Please try again.