Registry / communication / grpc-bus-websocket-client

grpc-bus-websocket-client

JSON →
library0.3.1jsnpmunverified

Connects browser JavaScript to gRPC services via a WebSocket proxy server (v0.3.1). Requires a running GRPC Bus WebSocket Proxy Server. Differentiates from other gRPC-Web libraries by using raw WebSockets instead of HTTP/2, enabling simple proxy setups. Release cadence is low; last release was 2018. Supports standard gRPC unary calls with proto file/service mapping.

npm install grpc-bus-websocket-client
INSTALL
IMPORT
SIG · GRPC-BUS-WEBSOCKET
G
grpc-bus-websocket-client
communicationjavascriptv0.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GBC
const GBC = require('grpc-bus-websocket-client');
import GBC from 'grpc-bus-websocket-client';
Package does not provide ESM exports; only CommonJS supported. No TypeScript types.

Connects to WebSocket proxy, maps proto service, and makes a unary gRPC call.

const GBC = require('grpc-bus-websocket-client'); const gbc = new GBC( 'ws://localhost:8080/', 'helloworld.proto', { helloworld: { Greeter: 'localhost:50051' } } ); gbc.connect().then(client => { client.services.helloworld.Greeter.sayHello({ name: 'Gabriel' }, (err, res) => { console.log(res); }); });
Debug
Known issues
deprecatedPackage is unmaintained; last release in 2018.
fix
Consider using @grpc/grpc-js or grpc-web for modern gRPC-Web support.
affects: >=0.0.0
gotchaWebSocket proxy server must be running; this library alone does not connect to gRPC services directly.
fix
Set up and run https://github.com/gabrielgrant/grpc-bus-websocket-proxy-server
affects: >=0.0.0
gotchaProto files with imports must be compiled to JSON using pbjs; direct .proto not supported for complex files.
fix
Run ./node_modules/protobufjs/bin/pbjs <protofile> > compiled.json, then pass 'compiled.json' to GBC constructor.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'grpc-bus-websocket-client'
Package not installed or incorrectly installed.
fix
npm install grpc-bus-websocket-client
GBC is not a constructor
Using ES6 import syntax with this CommonJS-only package.
fix
Use require('grpc-bus-websocket-client') instead of import.
Upgrade
Version history
0.3.1latest on npm
Audit
Dependencies
protobufjsoptionalUsed for compiling .proto files to JSON for complex imports
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
grpc-bus-websocket-client — npm install grpc-bus-websocket-client · libregistry