1.0.1 • Published 9 years ago

thrift-http v1.0.1

Weekly downloads
17
License
Apache-2.0
Repository
github
Last release
9 years ago

nodejs-thrift-http

nodejs thrift library, http supported

#Install#

npm install thrift-http

#Important# In your generated code(e.g: gen-nodejs/*.js), replace

var Thrift = require('thrift').Thrift; 

with

var Thrift = require('thrift-http').Thrift;

#Usage#

var thrift = require('thrift-http');
var helloSvc = require('./gen-nodejs/helloSvc.js');

var options = {
   transport: thrift.TBufferedTransport,
   protocol: thrift.TJSONProtocol,
   path: "/hello",
   headers: {"Connection": "close"}
};

var connection = thrift.createHttpConnection("localhost", 9090, options);
var client = thrift.createHttpClient(helloSvc, connection);

client.getMessage("Thurston Howell", function(error, result) {
  console.log("Msg from server: " + result);
});
1.0.1

9 years ago

1.0.0

10 years ago

1.0.0-dev

10 years ago