blob: 19cc0c362784b72d1f5b80676f0b7066eda42562 [file] [log] [blame]
ra779b9ac2014-04-23 20:04:23 -07001var thrift = require('thrift');
2var helloSvc = require('./gen-nodejs/HelloSvc.js');
3
4var options = {
5 transport: thrift.TBufferedTransport,
6 protocol: thrift.TJSONProtocol,
7 path: "/hello",
8 headers: {"Connection": "close"},
9 https: false
10};
11
12var connection = thrift.createHttpConnection("localhost", 9090, options);
13var client = thrift.createHttpClient(helloSvc, connection);
14
15connection.on("error", function(err) {
16 console.log("Error: " + err);
17});
18
19client.hello_func(function(error, result) {
20 console.log("Msg from server: " + result);
21});
22
23