proxy

command
v0.22.4 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: ISC Imports: 24 Imported by: 0

README

gRPC HTTP Gateway Proxy Server

A proxy server can be used when a client application is not able to connect to BCHD via gRPC for one reason or another.

Build

$ make

This builds the gw proxy binary. The generated gateway code in ../pb and the swagger API docs in ./web are checked in. To regenerate them after changing ../bchrpc.proto or ./bchrpc.yaml, run make generate (or ../regen.sh), which needs the protoc version named in ../regen.sh. The protoc plugins are built from the versions pinned in the root go.mod, with the Go toolchain version set in ../regen.sh.

Run the Proxy

$ ./gw -http-addr :8080 -bchd-grpc-url <BCHD gRPC server url>:8335 -bchd-grpc-certpath <path to self-signed cert>

If you are using a certificate signed by a CA then you do not need to specify a value for -bchd-grpc-certpath.

Swagger API Docs

The proxy server will also host the static swagger files located in the ./web directory.

Run tests

go test gw_test.go

You can specify another BCHD backend using the same parameters as above for gw.go.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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