]>
git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/thrift/lib/nodejs/examples/httpClient.js
1 var thrift
= require('thrift');
2 var helloSvc
= require('./gen-nodejs/HelloSvc.js');
5 transport
: thrift
.TBufferedTransport
,
6 protocol
: thrift
.TJSONProtocol
,
8 headers
: {"Connection": "close"},
12 var connection
= thrift
.createHttpConnection("localhost", 9090, options
);
13 var client
= thrift
.createHttpClient(helloSvc
, connection
);
15 connection
.on("error", function(err
) {
16 console
.log("Error: " + err
);
19 client
.hello_func(function(error
, result
) {
20 console
.log("Msg from server: " + result
);