blob: 27db543be2aeabc427f5af10c1a0b6bf3ff261ae [file] [log] [blame]
Randy Abernethyd8187c52015-02-16 01:25:53 -08001
2var assert = require('assert');
3var thrift = require('thrift');
4var helpers = require('./helpers');
5var ThriftTest = require('./gen-nodejs/ThriftTest');
6var ThriftTestDriver = require('./test_driver').ThriftTestDriver;
7
8// createXHRConnection createWSConnection
9var connection = thrift.createXHRConnection("localhost", 9090, {
10 transport: helpers.transports['buffered'],
11 protocol: helpers.protocols['json'],
12 path: '/test'
13});
14
15connection.on('error', function(err) {
16 assert(false, err);
17});
18
19// Uncomment the following line to start a websockets connection
20// connection.open();
21
22// createWSClient createXHRClient
23var client = thrift.createXHRClient(ThriftTest, connection);
24
25ThriftTestDriver(client, function (status) {
26 console.log('Browser:', status);
27});