infra/proxyd/proxyd
2023-02-15 10:11:05 -07:00
..
cmd/proxyd adds log level conf to proxyd (#3704) 2022-10-14 13:56:27 -05:00
integration_tests proxyd: Add global flag to method overrides 2023-02-15 00:44:19 -07:00
.gitignore maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
backend_rate_limiter.go proxyd: Allow disabling backend rate limiting 2022-10-13 15:02:35 -05:00
backend.go proxyd: Add sender-based rate limiter 2023-01-23 10:59:40 -07:00
cache_test.go maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
cache.go proxyd: Integrate custom rate limiter 2022-10-11 17:20:23 -05:00
CHANGELOG.md Version Packages 2023-02-15 16:36:28 +00:00
config.go proxyd: Add global flag to method overrides 2023-02-15 00:44:19 -07:00
Dockerfile maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
entrypoint.sh maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
errors.go Last unwrapped errors 2022-09-09 04:56:59 -07:00
example.config.toml adds log level conf to proxyd (#3704) 2022-10-14 13:56:27 -05:00
frontend_rate_limiter_test.go proxyd: Integrate custom rate limiter 2022-10-11 17:20:23 -05:00
frontend_rate_limiter.go proxyd: Integrate custom rate limiter 2022-10-11 17:20:23 -05:00
go.mod proxyd: Add global flag to method overrides 2023-02-15 00:44:19 -07:00
go.sum proxyd: Add global flag to method overrides 2023-02-15 00:44:19 -07:00
lvc.go maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
Makefile maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
methods.go maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
metrics.go proxyd: Integrate custom rate limiter 2022-10-11 17:20:23 -05:00
package.json Version Packages 2023-02-15 16:36:28 +00:00
proxyd.go proxyd: Add sender-based rate limiter 2023-01-23 10:59:40 -07:00
README.md maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
redis.go proxyd: Integrate custom rate limiter 2022-10-11 17:20:23 -05:00
rpc_test.go fix(proxyd): Fix compliance with JSON-RPC 2.0 spec by adding optional RPCError.Data (#3683) 2022-10-11 08:51:02 -06:00
rpc.go fix(proxyd): Fix compliance with JSON-RPC 2.0 spec by adding optional RPCError.Data (#3683) 2022-10-11 08:51:02 -06:00
server.go proxyd: Remove logging 2023-02-15 10:07:44 -07:00
string_set.go maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
tls.go style(batch-submitter,bss-core,proxyd): Fix lint Go (#3328) 2022-08-26 19:39:30 -06:00

rpc-proxy

This tool implements proxyd, an RPC request router and proxy. It does the following things:

  1. Whitelists RPC methods.
  2. Routes RPC methods to groups of backend services.
  3. Automatically retries failed backend requests.
  4. Provides metrics the measure request latency, error rates, and the like.

Usage

Run make proxyd to build the binary. No additional dependencies are necessary.

To configure proxyd for use, you'll need to create a configuration file to define your proxy backends and routing rules. Check out example.config.toml for how to do this alongside a full list of all options with commentary.

Once you have a config file, start the daemon via proxyd <path-to-config>.toml.

Metrics

See metrics.go for a list of all available metrics.

The metrics port is configurable via the metrics.port and metrics.host keys in the config.

Adding Backend SSL Certificates in Docker

The Docker image runs on Alpine Linux. If you get SSL errors when connecting to a backend within Docker, you may need to add additional certificates to Alpine's certificate store. To do this, bind mount the certificate bundle into a file in /usr/local/share/ca-certificates. The entrypoint.sh script will then update the store with whatever is in the ca-certificates directory prior to starting proxyd.