All Projects → tmc → Grpc Websocket Proxy

tmc / Grpc Websocket Proxy

Licence: mit
A proxy to transparently upgrade grpc-gateway streaming endpoints to use websockets

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Grpc Websocket Proxy

Danby
A webserver that's also a grpc proxy for browsers
Stars: ✭ 26 (-93.42%)
Mutual labels:  grpc, grpc-gateway, proxy
Rules protobuf
Bazel rules for building protocol buffers and gRPC services (java, c++, go, ...)
Stars: ✭ 206 (-47.85%)
Mutual labels:  grpc, grpc-gateway
Istio Micro
istio 微服务示例代码 grpc+protobuf+echo+websocket+mysql+redis+kafka+docker-compose
Stars: ✭ 194 (-50.89%)
Mutual labels:  grpc, websocket
micro
A simple tool kit for building microservices.
Stars: ✭ 15 (-96.2%)
Mutual labels:  grpc, grpc-gateway
Protoeasy Go
Simpler usage of protoc. Deprecated.
Stars: ✭ 129 (-67.34%)
Mutual labels:  grpc, grpc-gateway
Mtproto
Telegram MTProto and its proxy (over gRPC) in Go (golang). API Layer: 71
Stars: ✭ 133 (-66.33%)
Mutual labels:  grpc, proxy
protoc-gen-grpc-gateway-ts
protoc-gen-grpc-gateway-ts is a Typescript client generator for the grpc-gateway project. It generates idiomatic Typescript clients that connect the web frontend and golang backend fronted by grpc-gateway.
Stars: ✭ 68 (-82.78%)
Mutual labels:  grpc, grpc-gateway
Grpc Hello World
An example of gRPC+grpc-gateway
Stars: ✭ 104 (-73.67%)
Mutual labels:  grpc, grpc-gateway
Ovpm
OpenVPN Management Server - Effortless and free OpenVPN server administration
Stars: ✭ 256 (-35.19%)
Mutual labels:  grpc, grpc-gateway
Turbo
A lightweight microservice tool, turn your grpc|thrift APIs into HTTP APIs!
Stars: ✭ 275 (-30.38%)
Mutual labels:  grpc, grpc-gateway
Vosk Server
WebSocket, gRPC and WebRTC speech recognition server based on Vosk and Kaldi libraries
Stars: ✭ 277 (-29.87%)
Mutual labels:  grpc, websocket
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 (-68.61%)
Mutual labels:  grpc, proxy
Grpc Gateway
The gRPC-Gateway is a plugin of the Google protocol buffers compiler protoc. It reads protobuf service definitions and generates a reverse-proxy server which translates a RESTful HTTP API into gRPC. This server is generated according to the google.api.http annotations in your service definitions.
Stars: ✭ 12,223 (+2994.43%)
Mutual labels:  grpc, grpc-gateway
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 (+456.71%)
Mutual labels:  grpc, proxy
Tesla
Tesla is a gateway service that provides dynamic routing,waf,support spring cloud,gRPC,DUBBO and more.
Stars: ✭ 109 (-72.41%)
Mutual labels:  grpc, grpc-gateway
Clay
Proto-first minimal server platform for gRPС+REST+Swagger APIs
Stars: ✭ 212 (-46.33%)
Mutual labels:  grpc, grpc-gateway
Packetproxy
A local proxy written in Java
Stars: ✭ 352 (-10.89%)
Mutual labels:  grpc, proxy
Grpc Tools
A suite of gRPC debugging tools. Like Fiddler/Charles but for gRPC.
Stars: ✭ 881 (+123.04%)
Mutual labels:  grpc, proxy
Micro Mesh
gRPC微服务架构实践
Stars: ✭ 50 (-87.34%)
Mutual labels:  grpc, grpc-gateway
docker-protobuf
An all-inclusive protoc Docker image
Stars: ✭ 105 (-73.42%)
Mutual labels:  grpc, grpc-gateway

grpc-websocket-proxy

GoDoc

Wrap your grpc-gateway mux with this helper to expose streaming endpoints over websockets.

On the wire this uses newline-delimited json encoding of the messages.

Usage:

	mux := runtime.NewServeMux()
	opts := []grpc.DialOption{grpc.WithInsecure()}
	if err := echoserver.RegisterEchoServiceHandlerFromEndpoint(ctx, mux, *grpcAddr, opts); err != nil {
		return err
	}
-	http.ListenAndServe(*httpAddr, mux)
+	http.ListenAndServe(*httpAddr, wsproxy.WebsocketProxy(mux))

wsproxy

import "github.com/tmc/grpc-websocket-proxy/wsproxy"

Package wsproxy implements a websocket proxy for grpc-gateway backed services

Usage

var (
	MethodOverrideParam = "method"
	TokenCookieName     = "token"
)

func WebsocketProxy

func WebsocketProxy(h http.Handler) http.HandlerFunc

WebsocketProxy attempts to expose the underlying handler as a bidi websocket stream with newline-delimited JSON as the content encoding.

The HTTP Authorization header is either populated from the Sec-Websocket-Protocol field or by a cookie. The cookie name is specified by the TokenCookieName value.

example:

Sec-Websocket-Protocol: Bearer, foobar

is converted to:

Authorization: Bearer foobar

Method can be overwritten with the MethodOverrideParam get parameter in the requested URL

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