0.3.1 • Published 7 years ago

grpc-bus-websocket-client v0.3.1

Weekly downloads
10
License
MIT
Repository
github
Last release
7 years ago

GRPC-Bus WebSocket Proxy Client

This client library connects a browser's JavaScript context to standard GRPC service(s) via a WebSocket Proxy Server

Install

npm install grpc-bus-websocket-client

You'll also need to install and run a GRPC Bus WebSocket Proxy Server

Usage

new GBC(<grpc-bus-websocket-proxy address>, <protofile>, <service map>)

Example

var GBC = require("grpc-bus-websocket-client");

new GBC("ws://localhost:8080/", 'helloworld.proto', {helloworld: {Greeter: 'localhost:50051'}})
  .connect()
  .then(function(gbc) {
    gbc.services.helloworld.Greeter.sayHello({name: 'Gabriel'}, function(err, res){
      console.log(res);
    });  // --> Hello Gabriel
  });

For more complex proto defs that import other .proto files, the proto def tree should be compiled into a single JSON file using the pbjs command line utility included with the protobufjs lib from NPM.

After installing grpc-bus-websocket-client, run the compilation from your project directory:

./node_modules/protobufjs/bin/pbjs helloworld.proto > helloworld.proto.json
0.3.1

7 years ago

0.3.0

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago