Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/tetra12/caddy-grpc-web

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/tetra12/caddy-grpc-web

  • v0.0.0-20240216153929-eee89f90a114
  • Source
  • Go
  • Socket score

Version published
Created
Source

gRPC-Web Bridge for Caddy

This module implements a bridge from gRPC-Web clients to gRPC servers. It is similar to Envoy's envoy.filters.http.grpc_web filter. It is EXPERIMENTAL and subject to change.

To convert gRPC-Web requests to gRPC, simply add the grpc_web handler to your HTTP route. It should go before your reverse_proxy or any other handler that would expect a gRPC request.

Installation

A new Caddy server with this module needs to be built to support GRPC-web calls. Build it with:

docker build -t <account_name>/caddy-grpc .

Example

Caddyfile:

{
	order grpc_web before reverse_proxy
}

:5452 {
	grpc_web
	reverse_proxy h2c://127.0.0.1:50051
}

JSON:

{
	"apps": {
		"http": {
			"servers": {
				"srv0": {
					"listen": [
						":5452"
					],
					"routes": [
						{
							"handle": [
								{
									"handler": "grpc_web"
								},
								{
									"handler": "reverse_proxy",
									"transport": {
										"protocol": "http",
										"versions": [
											"h2c",
											"2"
										]
									},
									"upstreams": [
										{
											"dial": "127.0.0.1:50051"
										}
									]
								}
							]
						}
					]
				}
			}
		}
	}
}

You can also specify the websocket_ping parameter to an interval value >= 1s for websocket keep-alive pings to be enabled.

FAQs

Package last updated on 16 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc