proxy

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const HandleRequestRecursionLimit = 3
View Source
const InfuraURL = "https://%s.infura.io/v3/%s"

Config

View Source
const InfuraWsURL = "wss://%s.infura.io/ws/v3/%s"

Config

View Source
const PocketURL = "https://%s.gateway.pokt.network/v1/%s"

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpProxyServer added in v1.0.0

type HttpProxyServer struct {
	Port         string
	ProviderUrl  string
	Verbose      bool
	ProviderType string
	// contains filtered or unexported fields
}

Proxy server

func NewHttpProxyServer added in v1.0.0

func NewHttpProxyServer(port string, providerUrl string, network string, projectId string, providerType string, verbose bool) *HttpProxyServer

Create new proxy server

func (*HttpProxyServer) ServeHTTP added in v1.0.0

func (p *HttpProxyServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

Handle request / serve response

func (*HttpProxyServer) Start added in v1.0.0

func (p *HttpProxyServer) Start() error

Start proxy server

type InfuraRateLimitError added in v1.0.0

type InfuraRateLimitError struct {
	Error struct {
		Code    int    `json:"code"`
		Message string `json:"message"`
		Data    struct {
			Rate struct {
				BackoffSeconds float64 `json:"backoff_seconds"`
			} `json:"rate"`
		} `json:"data"`
	} `json:"error"`
}

Infura rate limit error

type WsProxyServer added in v1.0.0

type WsProxyServer struct {
	Port        string
	ProviderUrl string
	Verbose     bool
}

Proxy server

func NewWsProxyServer added in v1.0.0

func NewWsProxyServer(port string, providerUrl string, network string, projectId string, verbose bool) *WsProxyServer

Create new proxy server

func (*WsProxyServer) ServeHTTP added in v1.0.0

func (p *WsProxyServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

Handle request / serve response

func (*WsProxyServer) Start added in v1.0.0

func (p *WsProxyServer) Start() error

Start proxy server

Jump to

Keyboard shortcuts

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