All Projects → mwitkow → Grpc Proxy

mwitkow / Grpc Proxy

Licence: apache-2.0
gRPC proxy is a Go reverse proxy that allows for rich routing of gRPC calls with minimum overhead.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Labels

Projects that are alternatives of or similar to Grpc Proxy

Grpc Tools
A suite of gRPC debugging tools. Like Fiddler/Charles but for gRPC.
Stars: ✭ 881 (+54.29%)
Mutual labels:  grpc, proxy
Kafka Pixy
gRPC/REST proxy for Kafka
Stars: ✭ 613 (+7.36%)
Mutual labels:  grpc, proxy
Danby
A webserver that's also a grpc proxy for browsers
Stars: ✭ 26 (-95.45%)
Mutual labels:  grpc, proxy
Dubbo Go Pixiu
Based on the proxy gateway service of dubbo-go, it solves the problem that the external protocol calls the internal Dubbo cluster. At present, it supports HTTP and gRPC[developing].
Stars: ✭ 124 (-78.28%)
Mutual labels:  grpc, proxy
Mtproto
Telegram MTProto and its proxy (over gRPC) in Go (golang). API Layer: 71
Stars: ✭ 133 (-76.71%)
Mutual labels:  grpc, proxy
Packetproxy
A local proxy written in Java
Stars: ✭ 352 (-38.35%)
Mutual labels:  grpc, proxy
Fortio
Fortio load testing library, command line tool, advanced echo server and web UI in go (golang). Allows to specify a set query-per-second load and record latency histograms and other useful stats.
Stars: ✭ 2,199 (+285.11%)
Mutual labels:  grpc, proxy
Grpc Websocket Proxy
A proxy to transparently upgrade grpc-gateway streaming endpoints to use websockets
Stars: ✭ 395 (-30.82%)
Mutual labels:  grpc, proxy
Kubeadm Playbook
Fully fledged (HA) Kubernetes Cluster using official kubeadm, ansible and helm. Tested on RHEL/CentOS/Ubuntu with support of http_proxy, dashboard installed, ingress controller, heapster - using official helm charts
Stars: ✭ 533 (-6.65%)
Mutual labels:  proxy
Invoke Socksproxy
Socks proxy, and reverse socks server using powershell.
Stars: ✭ 540 (-5.43%)
Mutual labels:  proxy
Go Shadowsocks2
Experimental Shadowsocks in Go. Stable fork at https://github.com/shadowsocks/go-shadowsocks2
Stars: ✭ 530 (-7.18%)
Mutual labels:  proxy
Proxy
The Istio proxy components.
Stars: ✭ 533 (-6.65%)
Mutual labels:  proxy
Nboost
NBoost is a scalable, search-api-boosting platform for deploying transformer models to improve the relevance of search results on different platforms (i.e. Elasticsearch)
Stars: ✭ 549 (-3.85%)
Mutual labels:  proxy
Tor2web
Tor2web is an HTTP proxy software that enables access to Tor Hidden Services by mean of common web browsers
Stars: ✭ 531 (-7.01%)
Mutual labels:  proxy
Goproxy
A minimalist Go module proxy handler.
Stars: ✭ 561 (-1.75%)
Mutual labels:  proxy
Multi V2ray
v2ray/xray多用户管理部署程序
Stars: ✭ 5,382 (+842.56%)
Mutual labels:  grpc
Prototool
Your Swiss Army Knife for Protocol Buffers
Stars: ✭ 4,932 (+763.75%)
Mutual labels:  grpc
Icaro
Smart and efficient javascript object observer, ideal for batching DOM updates (~1kb)
Stars: ✭ 568 (-0.53%)
Mutual labels:  proxy
Promxy
An aggregating proxy to enable HA prometheus
Stars: ✭ 562 (-1.58%)
Mutual labels:  proxy
Goproxy.cn
The most trusted Go module proxy in China.
Stars: ✭ 5,530 (+868.48%)
Mutual labels:  proxy

gRPC Proxy

Travis Build Go Report Card GoDoc Apache 2.0 License

gRPC Go Proxy server

Project Goal

Build a transparent reverse proxy for gRPC targets that will make it easy to expose gRPC services over the internet. This includes:

  • no needed knowledge of the semantics of requests exchanged in the call (independent rollouts)
  • easy, declarative definition of backends and their mappings to frontends
  • simple round-robin load balancing of inbound requests from a single connection to multiple backends

The project now exists as a proof of concept, with the key piece being the proxy package that is a generic gRPC reverse proxy handler.

Proxy Handler

The package proxy contains a generic gRPC reverse proxy handler that allows a gRPC server to not know about registered handlers or their data types. Please consult the docs, here's an exaple usage.

Defining a StreamDirector that decides where (if at all) to send the request

director = func(ctx context.Context, fullMethodName string) (*grpc.ClientConn, error) {
    // Make sure we never forward internal services.
    if strings.HasPrefix(fullMethodName, "/com.example.internal.") {
        return nil, grpc.Errorf(codes.Unimplemented, "Unknown method")
    }
    md, ok := metadata.FromContext(ctx)
    if ok {
        // Decide on which backend to dial
        if val, exists := md[":authority"]; exists && val[0] == "staging.api.example.com" {
            // Make sure we use DialContext so the dialing can be cancelled/time out together with the context.
            return grpc.DialContext(ctx, "api-service.staging.svc.local", grpc.WithCodec(proxy.Codec()))
        } else if val, exists := md[":authority"]; exists && val[0] == "api.example.com" {
            return grpc.DialContext(ctx, "api-service.prod.svc.local", grpc.WithCodec(proxy.Codec()))
        }
    }
    return nil, grpc.Errorf(codes.Unimplemented, "Unknown method")
}

Then you need to register it with a grpc.Server. The server may have other handlers that will be served locally:

server := grpc.NewServer(
    grpc.CustomCodec(proxy.Codec()),
    grpc.UnknownServiceHandler(proxy.TransparentHandler(director)))
pb_test.RegisterTestServiceServer(server, &testImpl{})

License

grpc-proxy is released under the Apache 2.0 license. See LICENSE.txt.

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].