proxy

command
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Proxy

Example REST front end for an RPC backend the proxy has no Go types for. One forwarding method is built per RPC from the service descriptor alone, so the same code proxies any service whose schema it can load.

Both halves run in one process over HTTP/1.1. Speaking gRPC to the backend instead is possible but requires giving the client an h2c transport.

Documentation

Overview

This program puts a REST front end on an RPC backend it has no Go types for. It builds one forwarding method per RPC from the service descriptor alone, using dynamicpb messages, so the same code proxies any service whose schema it can load. Demonstrates combining the inbound REST binding with an outbound RPC client.

Both halves run in one process over HTTP/1.1, which the Connect protocol needs no special setup for. Talking gRPC to the backend instead would require giving the client an h2c transport.

Run: go run ./internal/examples/proxy -p 8102 Then: curl http://localhost:8102/v1/shelves/tolkien/books/hobbit

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL