All Projects → 3p3r → grpc-express

3p3r / grpc-express

Licence: MIT license
gRPC express based web reverse proxy

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to grpc-express

rpc ts
Remote Procedure Calls in TypeScript made simple 🤞
Stars: ✭ 71 (+273.68%)
Mutual labels:  rpc, grpc-web
SuperSimpleTcp
Simple wrapper for TCP client and server in C# with SSL support
Stars: ✭ 263 (+1284.21%)
Mutual labels:  rpc
fluid
🐙 Code-generated, Auto-versioned, & Smart Web APIs
Stars: ✭ 37 (+94.74%)
Mutual labels:  rpc
protobuf-ts
Protobuf and RPC for TypeScript
Stars: ✭ 527 (+2673.68%)
Mutual labels:  grpc-web
xmlrpcwsc-dotnet
XML-RPC Web Service Client C# implementation
Stars: ✭ 30 (+57.89%)
Mutual labels:  rpc
grpc-web-istio-demo
A demo for showcasing gRPC-Web with Istio.
Stars: ✭ 67 (+252.63%)
Mutual labels:  grpc-web
grpc-web-chat
A simple project demonstrating how both a Go and Java back end can power the same Vue.js front end using gRPC.
Stars: ✭ 21 (+10.53%)
Mutual labels:  grpc-web
Ether1
Official Go implementation of The Etho Protocol
Stars: ✭ 41 (+115.79%)
Mutual labels:  rpc
frodo
A code generator that turns plain old Go services into RPC-enabled (micro)services with robust HTTP APIs.
Stars: ✭ 21 (+10.53%)
Mutual labels:  rpc
DoubleStar
A personalized/enhanced re-creation of the Darkhotel "Double Star" APT exploit chain with a focus on Windows 8.1 and mixed with some of my own techniques
Stars: ✭ 140 (+636.84%)
Mutual labels:  rpc
monero-java
A Java library for using Monero
Stars: ✭ 76 (+300%)
Mutual labels:  rpc
cirrina
cirrina is an opinionated asynchronous web framework based on aiohttp
Stars: ✭ 32 (+68.42%)
Mutual labels:  rpc
thrift-typescript
Generate TypeScript from Thrift IDL files
Stars: ✭ 129 (+578.95%)
Mutual labels:  rpc
gothic
🦇 Gothic is a user registration and authentication SWT/JWT microservice. It supports REST, gRPC, and gRPC Web API, reCAPTCHA & a variety of DBs with Gorm.
Stars: ✭ 65 (+242.11%)
Mutual labels:  grpc-web
micro-service-practice
OpenStack+Docker+RestAPI+OAuth/HMAC+RabbitMQ/ZMQ+OpenResty/HAProxy/Nginx/APIGateway+Bootstrap/AngularJS+Ansible+K8S/Mesos/Marathon构建/探索微服务最佳实践。
Stars: ✭ 25 (+31.58%)
Mutual labels:  rpc
gcv
Federating genomes with love (and synteny derived from functional annotations)
Stars: ✭ 22 (+15.79%)
Mutual labels:  grpc-web
rpc
RPC-like client-service implementation over messaging queue
Stars: ✭ 26 (+36.84%)
Mutual labels:  rpc
RRQMSocket
TouchSocket是.Net(包括 C# 、VB.Net、F#)的一个整合性的、超轻量级的网络通信框架。包含了 tcp、udp、ssl、http、websocket、rpc、jsonrpc、webapi、xmlrpc等一系列的通信模块。一键式解决 TCP 黏分包问题,udp大数据包分片组合问题等。使用协议模板,可快速实现「固定包头」、「固定长度」、「区间字符」等一系列的数据报文解析。
Stars: ✭ 286 (+1405.26%)
Mutual labels:  rpc
hrpc
Common interface definition based rpc implementation
Stars: ✭ 21 (+10.53%)
Mutual labels:  rpc
rmp-rpc
a msgpack-rpc rust library based on tokio
Stars: ✭ 45 (+136.84%)
Mutual labels:  rpc

grpc-express

An Express middleware to reverse-proxy HTTP 1.1 REST requests into HTTP 2.0 gRPC requests and back. CircleCI

summary

You can use this middleware with NodeJS and Express to serve a gRPC backed service API to browsers. Focus of this middleware is ease of use and not performance. This middleware only supports Unary gRPC and server side streaming calls. As it is mentioned in gRPC-web protocol it's unlikely that bidrectional or client side streaming calls would be supported by browsers any time soon with pure REST endpoints.

why express middleware

Take a look at alternative methods of doing this:

On the other hand, Express middlewares are easy to use and the chance that your app already ships with Express is extremely high! Also it's NodeJS only and requires no additional setups in client or server side.

how does it work

Begin by making a connection to a gRPC server in Node using official gRPC client for Node:

var PROTO_PATH = __dirname + '/path/to/some/service.proto';
var grpc = require('grpc');
var hello_proto = grpc.load(PROTO_PATH).helloworld;
var grpcClient = new hello_proto.Greeter('localhost:50051', grpc.credentials.createInsecure());

Then pass this already connected gRPC client to the middleware:

var grpcExpress = require('grpc-express');
var express = require('express');
var app = express();
// ...
app.use(grpcExpress(grpcClient));

Done! The middleware automatically registers REST endpoints and proxies requests to your gRPC server and back. If your service is in packageName, and its name is serviceName, you can access its methods over the following REST endpoints: http://expressServer/packageName.serviceName/[METHOD NAME].

Arguments are passed as JSON objects in. Unary calls return JSON objects back and streaming calls return a JSON array of objects back. For a more detailed and in-depth example of calling REST endpoints look at tests.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].