proxy

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: Apache-2.0 Imports: 15 Imported by: 12 modules, 20 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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RPCRoutes

func RPCRoutes(c *lrpc.Client) map[string]*rpcserver.RPCFunc

Types

type Proxy

type Proxy struct {
	Addr     string // TCP address to listen on, ":http" if empty
	Config   *rpcserver.Config
	Client   *lrpc.Client
	Logger   log.Logger
	Listener net.Listener
}

A Proxy defines parameters for running an HTTP server proxy.

func NewProxy added in v0.34.9

func NewProxy(
	lightClient *light.Client,
	listenAddr, providerAddr string,
	config *rpcserver.Config,
	logger log.Logger,
	opts ...lrpc.Option,
) (*Proxy, error)

NewProxy creates the struct used to run an HTTP server for serving light client rpc requests.

func (*Proxy) ListenAndServe

func (p *Proxy) ListenAndServe() error

ListenAndServe configures the rpcserver.WebsocketManager, sets up the RPC routes to proxy via Client, and starts up an HTTP server on the TCP network address p.Addr. See http#Server#ListenAndServe.

func (*Proxy) ListenAndServeTLS

func (p *Proxy) ListenAndServeTLS(certFile, keyFile string) error

ListenAndServeTLS acts identically to ListenAndServe, except that it expects HTTPS connections. See http#Server#ListenAndServeTLS.

Jump to

Keyboard shortcuts

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