rproxy

package module
v0.0.0-...-11a6770 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

README

rproxy

rproxy supports transparent reverse proxy for multiple protocols(HTTP1.*/gRPC/gRPC-Web) with single entry port

Protocols

protocol desc
HTTP 1.*
gRPC Native gRPC
gRPC-Web gRPC for web

Structure

Reference

rproxy use the following package:

package desc
soheilhy/cmux serve different services on the same port
improbable-eng/grpc-web in process grpc-web wrapper
mwitkow/grpc-proxy gRPC reverse proxy

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(l net.Listener)

Run start running reverse proxy

Types

type GRPCRule

type GRPCRule struct {
	ServicePrefix, ForwardDst string
	Insecure                  bool
}

GRPCRule defines the rule structure

type GRPCRuleMgr

type GRPCRuleMgr struct {
	sync.Map
}

GRPCRuleMgr ...

var GRPC *GRPCRuleMgr

GRPC global rule manager ...

func (*GRPCRuleMgr) ClearRules

func (h *GRPCRuleMgr) ClearRules()

ClearRules removes all rules

func (*GRPCRuleMgr) CreateOrUpdateRule

func (h *GRPCRuleMgr) CreateOrUpdateRule(servicePrefix, forwardDst string, insecure bool)

CreateOrUpdateRule creates or update rule for uri prefix servicePrefix is like /proto.TestService/xxxxx forwardDst is the full access address the request will be forward to

func (*GRPCRuleMgr) ListRules

func (h *GRPCRuleMgr) ListRules() []GRPCRule

ListRules lists all rules

func (*GRPCRuleMgr) RemoveRule

func (h *GRPCRuleMgr) RemoveRule(uriPrefix string) error

RemoveRule removes rule for prefix

type HTTPRule

type HTTPRule struct {
	URIPrefix, ForwardDst string
}

HTTPRule defines the rule structure

type HTTPRuleMgr

type HTTPRuleMgr struct {
	sync.Map
}

HTTPRuleMgr ...

var HTTP *HTTPRuleMgr

HTTP global rule manager ...

func (*HTTPRuleMgr) ClearRules

func (h *HTTPRuleMgr) ClearRules()

ClearRules removes all rules

func (*HTTPRuleMgr) CreateOrUpdateRule

func (h *HTTPRuleMgr) CreateOrUpdateRule(uriPrefix, forwardDst string)

CreateOrUpdateRule creates or update rule for uri prefix uriPrefix is like /path forwardDst is the full access address the request will be forward to

func (*HTTPRuleMgr) ListRules

func (h *HTTPRuleMgr) ListRules() []HTTPRule

ListRules lists all rules

func (*HTTPRuleMgr) RemoveRule

func (h *HTTPRuleMgr) RemoveRule(uriPrefix string) error

RemoveRule removes rule for prefix

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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