THRIFT-2976: add browserify support and tests
Client: nodejs
Patch: Andrew de Andrade
diff --git a/lib/nodejs/test/browser_client.js b/lib/nodejs/test/browser_client.js
new file mode 100644
index 0000000..27db543
--- /dev/null
+++ b/lib/nodejs/test/browser_client.js
@@ -0,0 +1,27 @@
+
+var assert = require('assert');
+var thrift = require('thrift');
+var helpers = require('./helpers');
+var ThriftTest = require('./gen-nodejs/ThriftTest');
+var ThriftTestDriver = require('./test_driver').ThriftTestDriver;
+
+// createXHRConnection createWSConnection
+var connection = thrift.createXHRConnection("localhost", 9090, {
+    transport: helpers.transports['buffered'],
+    protocol: helpers.protocols['json'],
+    path: '/test'
+});
+
+connection.on('error', function(err) {
+    assert(false, err);
+});
+
+// Uncomment the following line to start a websockets connection
+// connection.open();
+
+// createWSClient createXHRClient
+var client = thrift.createXHRClient(ThriftTest, connection);
+
+ThriftTestDriver(client, function (status) {
+    console.log('Browser:', status);
+});