GithubHelp home page GithubHelp logo

caddy-grpc's Introduction

Caddy grpc

grpc plugin for Caddy Server

grpc makes it possible for gRPC services to be consumed from browsers using the gRPC-Web protocol and normal gRPC clients. (If the request is not a grpc-web request, it will be served as a normal grpc request)

The plugin is meant to serve the same purpose as grpcwebproxy by Improbable, but as a Caddy middleware plugin instead of a standalone Go application.

Downloading

The plugin will be available to download as a plugin from Caddy's Download page. Click on Add plugins option and scroll down to the section where you can tick the http.grpc box.

To verify the plugin is part of your downloaded instance of Caddy, run Caddy with the -plugins command line flag: caddy -plugins

http.grpc should be listed under Other plugins along with http and any other plugins also included.

Note, because the plugin is still in development it's not yet available on the Caddy download page

Roadmap/TODO

  • Inject Go gRPC Middleware into the underlying gRPC proxy using the Caddyfile.
  • Load balancing features

Proposed Caddyfile

example.com 
grpc localhost:9090

The first line example.com is the hostname/address of the site to serve. The second line is a directive called grpc where the backend gRPC service endpoint address (i.e localhost:9090 as in the example) can be specified. (Note: The above configuration will default to having TLS 1.2 to the backend gRPC service)

Caddyfile syntax

grpc backend_addr {
    backend_is_insecure 
    backend_tls_noverify
    backend_tls_ca_files path_to_ca_file1 path_to_ca_file2 
}

backend_is_insecure

By default the proxy will connect to backend using TLS, however if the backend is serving in plaintext this option need to be added

backend_tls_noverify

By default the TLS to the backend will be verified, however if this is not the case then this option need to be added

backend_tls_ca_files

Paths (comma separated) to PEM certificate chains used for verification of backend certificates. If empty, host CA chain will be used.

Caddyfile example with other directives

grpc.example.com 
prometheus
log
grpc localhost:9090

Status

This plugin is in BETA

grpc-web client implementations/examples

Javascript and Typescript

Vue.js

GopherJS

References

Extending Caddy

Writing a Plugin: Directives

Caddyfile

gRPC

grpcwebproxy

gRPC-Web protocol

gRPC-Web: Moving past REST+JSON towards type-safe Web APIs

caddy-grpc's People

Contributors

pieterlouw avatar shaxbee avatar

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.