Giter Site home page Giter Site logo

pachyderm / grpc-bus-websocket-proxy-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gabrielgrant/grpc-bus-websocket-proxy-server

0.0 2.0 1.0 116 KB

Provides a WebSocket Proxy Server for browsers to connect to any GRPC service

JavaScript 99.63% Dockerfile 0.37%

grpc-bus-websocket-proxy-server's Introduction

GRPC-Bus WebSocket Proxy Server

This Node.js server acts as a proxy, connecting GRPC clients running in a browser context to standard GRPC service(s) via a WebSocket.

You'll want to use the GRPC Bus WebSocket Proxy Client to connect from the browser.

Usage

node server.js

How it Works

The browser client loads the Protobuf definition (either as a .proto file or compiled as a .proto.json), and passes it to the server via the initial message after creating the WebSocket connection.

Deployment

There is a Docker image built that can be run with:

docker run gabrielgrant/grpc-bus-websocket-proxy

It can also be deployed on a Kubernetes cluster using the included manifest:

kubectl create -f kubernetes-manifest.yaml

If redeploying, delete the earlier deployment first:

kubectl delete -f kubernetes-manifest.yaml && kubectl create -f kubernetes-manifest.yaml

TODO

  • Upgrade to Protobuf JS v6
  • Serve static content
  • Allow server to load .proto file directly
  • Push .proto file from server to client
  • Validate service map against proto file
  • Beter Error Handling
  • Support bundled/synchronous loading of JSON-formatted protoDefs
  • Specify allowed connections as CLI arg: --allow [service_name:]server:port
  • Specify port as CLI arg: --port 8080

Publishing a new version:

git checkout master
git pull
npm version patch
git push
VERSION=$(cat package.json| jq --raw-output .version)
docker build -t gabrielgrant/grpc-bus-websocket-proxy:latest -t gabrielgrant/grpc-bus-websocket-proxy:$VERSION .
docker push gabrielgrant/grpc-bus-websocket-proxy:$VERSION
docker push gabrielgrant/grpc-bus-websocket-proxy:latest

grpc-bus-websocket-proxy-server's People

Contributors

gabrielgrant avatar sjezewski avatar

Watchers

 avatar  avatar

Forkers

dsisodia14

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.