From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- .../thrift/lib/nodejs/examples/httpClient.js | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/jaegertracing/thrift/lib/nodejs/examples/httpClient.js (limited to 'src/jaegertracing/thrift/lib/nodejs/examples/httpClient.js') diff --git a/src/jaegertracing/thrift/lib/nodejs/examples/httpClient.js b/src/jaegertracing/thrift/lib/nodejs/examples/httpClient.js new file mode 100644 index 000000000..19cc0c362 --- /dev/null +++ b/src/jaegertracing/thrift/lib/nodejs/examples/httpClient.js @@ -0,0 +1,23 @@ +var thrift = require('thrift'); +var helloSvc = require('./gen-nodejs/HelloSvc.js'); + +var options = { + transport: thrift.TBufferedTransport, + protocol: thrift.TJSONProtocol, + path: "/hello", + headers: {"Connection": "close"}, + https: false +}; + +var connection = thrift.createHttpConnection("localhost", 9090, options); +var client = thrift.createHttpClient(helloSvc, connection); + +connection.on("error", function(err) { + console.log("Error: " + err); +}); + +client.hello_func(function(error, result) { + console.log("Msg from server: " + result); +}); + + -- cgit v1.2.3